|
Dammit... *Smashes head into monitor*
Nevermind that... You know what this problem, plus all previous ones, were? I don't know, but my program's output is very different when I run it on MSYS than when I run it on the WinXP command prompt! MSYS actually gives me what I expect, XP-DOS (that's how I'll call it) just gives me random crap... Anyone know why this is? Maybe it's a bug in GCC? Man, I'm angry and happy at the same time, so I'll use this smiley to express myself: Yes, it is 3:19AM. See y'all, thanks, and sorry for asking dumb questions! Thanks!
\|/ Thrift Store Floppy Collection \|/
(Server currently down due to mainteneance, aka comp not detecting monitor and acting weird)
|
|
|
|
|
You would have to provide some source code to look at. I hope you're not returning pointers to local (stack) memory out of a function.
|
|
|
|
|
Hey! Yeah, that's exactly what I'm doing...
I'm gonna change that now, but, can I malloc the pointer passed to the function, inside the function? If not, how does the caller know how much char s it has to allocate? Thanks!
\|/ Thrift Store Floppy Collection \|/
(Server currently down due to mainteneance, aka comp not detecting monitor and acting weird)
|
|
|
|
|
|
Yeahp, thanks! I tried doing that, but then... Well, the next day, my laptop started acting weird, then I rebooted, and the hard drive died. Goodbye Mythax (this program), goodbye Windows Vista, goodbye... nah, I'm afraid of remembering another important thing I lost. But, I'll start this program again someday, taking all the advise I got from you all guys... Thanks!
I will be back.
\|/ Thrift Store Floppy Collection \|/
(Server currently down due to mainteneance, aka comp not detecting monitor and acting weird)
|
|
|
|
|
I think this is solved. The problem probably was that functions need to be exported when using Detours version 2.1 that did not need to be exported using version 1.5.
I was getting the following error message:
"The application failed to initialize properly (0xc000007b). Click on OK to terminate the application."
Error 0x7B is "The filename, directory name, or volume label syntax is incorrect.".
I don't know if this is a problem with Detours[^] or if it is a problem with VC 2005 or something else new that I am not familiar with.
I will first clarify assuming you are familiar with Detours. If I use a command line such as:
withdll.exe -d:slept.dll sleepold.exe then Detours works. If I use my own DLL instead, then I get the error, even if the DLL is very, very simple. Note that the command line I show here is simplified with the paths eliminated, but I am using a script that validates that the files exist.
For those not familiar with Detours, the withdll.exe sample program uses Detours which uses CreateProcess to create a suspended process (executes sleepold.exe), then injects the DLL into the process. When Detours is installed, the sample programs and Detours itself need to be compiled, so I have the makefile and such for the builds.
It is the Detours function that does the CreateProcess that is getting the error. I have tried to compare my VC 2005 project settings to the options used to make slept.dll and I can't find anything significantly different.
My VC is: Microsoft Visual C++ 2005 77626-009-0000007-41476
-- modified at 19:47 Monday 26th June, 2006
|
|
|
|
|
I am posting this question in both the C# and C++ boards as I think the solution may be the same in both the cases.
I have an IE toolbar which gets hold of the IWebBrowser. I then imlplement the event DocumentComplete. In the event I get hold of the Document as a IHTMLDocument.
now here is my question. For an image in the Document, how do I get to know the exact path of that image in my temporary Internet files? If I get the images list, then for each element in the collection I can get the src property but that gives me the url not the location in the temp internet files. I know the file may not exist in the temp folder, but if it did, is there a way to get the path?
Thanks,
|
|
|
|
|
RetrieveUrlCacheEntryFile() fills in a INTERNET_CACHE_ENTRY_INFO struct if the URL is cached. The lpszLocalFileName member of the struct is the full path to the file in the cache.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
Thanks. Of course, given my luck, it couldnt be a simple AxWebBrowser method 
|
|
|
|
|
|
I know. Just my luck. however, had I known that when I started my search I would have found this:
http://www.codeproject.com/csharp/WebCacheTool.asp[^]
Hopefully this will act as a reference to anyone else.
Of course now I am finding plenty of wininet functions that can be used. I had that strange feeling in my gut that I should have done this toolbar in C++. Too late now
Thanks.
|
|
|
|
|
Hey Guys,
I'm using VC++ 6.0 and I'm having a very stupid problem. I get an unhandled exception error when try to output a string to console. Even the simplest program such as the one below:
main.cpp
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
void main(void )
{
string s = "test=2321";
cout << s;
}
Will produce an error. I built the same program in Metrowerks Codewarrior, and the program runs fine. No problems whatsoever. For some reason I have problems with it in VC++. This is what i have in my other include file:
stdfx.h
#if !defined(AFX_STDAFX_H__A9693917_A7C9_4A6A_B3E1_58638AE54078__INCLUDED_)
#define AFX_STDAFX_H__A9693917_A7C9_4A6A_B3E1_58638AE54078__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <iostream>
#include <string>
#endif // !defined(AFX_STDAFX_H__A9693917_A7C9_4A6A_B3E1_58638AE54078__INCLUDED_)
I will also list my project options:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/testing_project2.pdb" /debug /machine:I386 /out:"Debug/testing_project2.exe" /pdbtype:sept
Does anyone know the reason why this is occuring? I would appreciate any light on the issue.
Thanks,
Robbie
-- modified at 18:50 Saturday 24th June, 2006
|
|
|
|
|
Do you have SP6 installed? I recall getting some very strange compiler/runtime errors on previous SPs. Mostly with _bstr_t , but I wouldn't be shocked if errors happened in other parts of the runtime libraries.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
Hey Mike,
I applied the update and also removed any intermidiate files as well as the precompiled header files, but still I am getting the same error. Do you think it could be an issue with the project options?
Robbie
|
|
|
|
|
I don't have a fix, just some clue. It has something to do with incompatible STL libraries. I encountered similar problem on a UNIX platform long time ago. We couldn't fix it cleanly because we were not allowed to alter the platform setup. But we were able to get rid of it by using old STL implementation.
Try to use old STL headers like string.h and iostream.h and see how it goes.
Best,
Jun
|
|
|
|
|
I used the following code in a simple VC 6 console project I use for testing purposes. I turned off precompiled headers, so the project should be unaffected by anything significant. The program works for me as it should, so you probably have something messed up by your setup.
#include <iostream>
#include <string>
using namespace std;
void main(void ){
string s = "test=2321";
cout << s;
}
-- modified at 21:36 Saturday 24th June, 2006
|
|
|
|
|
I use code like this all the time and have no problems. What is the exeption? Can you attach a call stack when the exception is thrown?
Steve
|
|
|
|
|
Hey guys,
Thanks for the input. I have a few question though:
1) How would I turn off the pre-compiled headers? Is it just as good as cleaning out the the intermediate and precompiled headers before a build or do I still need to turn them off?
2) I tried including iostream.h and string.h however that doesnt seem to work either. I still receive the same error.
3) As for the unhandled exception, its an access violation with error code: 0xC0000005, but I'm not sure how I would get the call stack. I can see it but windows does not export the log file for it, and I cant copy it from the error report window.
|
|
|
|
|
can i get help on wat this line does
response.redirect("login.asp?l=incorrect_login_or_password")
i understand the redirect part but wat is this " l=incorrect_login_or_password"
can anyone help me this....will be very greatefull....
thank you..
|
|
|
|
|
|
hey, I need some help passing a char. When the app. starts, it has an assertion failure, because the NetWkstaTransportEnum() function fails when I pass the netbios name of a server on my network to it. If I use NULL, it outputs the local MAC address.
#include "stdafx.h"
#include <Windows.h>
#include <lm.h>
#include <assert.h>
#pragma comment(lib, "Netapi32.lib")
static void PrintMACaddress(unsigned char MACData[])
{
printf("MAC Address: %02X-%02X-%02X-%02X-%02X-%02X\n",
MACData[0], MACData[1], MACData[2], MACData[3], MACData[4], MACData[5]);
}
static void GetMACaddress(void)
{
unsigned char MACData[8];
WKSTA_TRANSPORT_INFO_0 *pwkti;
DWORD dwEntriesRead;
DWORD dwTotalEntries;
BYTE *pbBuffer;
NET_API_STATUS dwStatus = NetWkstaTransportEnum(
"\\server",
0,
&pbBuffer,
MAX_PREFERRED_LENGTH,
&dwEntriesRead,
&dwTotalEntries,
NULL);
assert(dwStatus == NERR_Success);
pwkti = (WKSTA_TRANSPORT_INFO_0 *)pbBuffer;
for(DWORD i=1; i< dwEntriesRead; i++)
{
swscanf((wchar_t *)pwkti[i].wkti0_transport_address, L"%2hx%2hx%2hx%2hx%2hx%2hx",
&MACData[0], &MACData[1], &MACData[2], &MACData[3], &MACData[4], &MACData[5]);
PrintMACaddress(MACData);
}
dwStatus = NetApiBufferFree(pbBuffer);
assert(dwStatus == NERR_Success);
}
int _tmain(int argc, _TCHAR* argv[])
{
GetMACaddress();
return 0;
}
I think I may need to do a unicode conversion, but am not sure how. It may not even be that, as well. So, I need help passing the netbios name of a remote server (e.g. \\SERVER001), to the NetWkstaTransportEnum() function. All help is very much appreciated, thanks in advance.
salut
|
|
|
|
|
Prefix a string literal with L to make it Unicode, eg L"\\\\server001"
Note that you need to escape backslashes in a literal, so to create two backslashes you write \\\\
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
tried that using : char *netbios = L"\\\\server";
...but, compiler says this : error C2440: 'initializing' : cannot convert from 'unsigned short [10]' to 'char *'
...at this line in my source:
NET_API_STATUS dwStatus = NetWkstaTransportEnum(
netbios,
0,
&pbBuffer,
MAX_PREFERRED_LENGTH,
&dwEntriesRead,
&dwTotalEntries,
NULL);
kinda new to conversions, all help is appreciated. thanks in advance
salut
|
|
|
|
|
|
hey mike, thanks for the heads up on that. It seems I am doing it wrong, because the compiler still says the same thing as I said in my last post. It can not convert an unsigned short * to char*. But, when I send a char* to the function, it raises an assertion failure. Have you actually tested the variable, to see if it works? It doesn't for me. thanks
salut
|
|
|
|
|