I generated a "Hello, World" console app. using Win2000ProSP3 and
VisualStudioSP5. I added two statements: an OutputDebugString statement and
an "include" statement for Winbase.h, as follows:
#include <Winbase.h>
#include "stdafx.h"
int main(int argc, char* argv[])
{
OutputDebugString("Hello World!\n");
printf("Hello World!\n");
return 0;
}
The compiler complains:
error C2065: 'OutputDebugString' : undeclared identifier
However, 'OutputDebugString' *is* defined in Winbase.h, lines 4438, etc., as
follows:
#ifdef UNICODE
#define OutputDebugString OutputDebugStringW
#else
#define OutputDebugString OutputDebugStringA
#endif // !UNICODE
I'd expect a link error, but I don't understand why there's a compile error.
Thanks in advance for any suggestions.
Richard
The stdafx pragma fired, but the winbase pragma did not, yet the compiler
didn't complain that it couldn't find the winbase header.
Though I thougt it pointless, I added the above include dir. to
Project|Settings| Settings for All Configs|C++ tab|Preprocessor
category|Additional include directories. That made no difference.
Any suggestions would be greatly appreciated.
#include <windows.h>
WINBASEAPI
VOID
WINAPI
OutputDebugStringA(
LPCSTR lpOutputString
);
WINBASEAPI
VOID
WINAPI
OutputDebugStringW(
LPCWSTR lpOutputString
);
>.
>
Thanks for your response. That got me to look at my problem anew and, sure
enough, windows.h in a brand new Win32 App supports OutputDebugString. I
don't know why I thought I needed the kludge I concocted last month.
Regards,
Richard
"Joseph Steel" <j.s...@rmcs.cranfield.ac.uk> wrote in message
news:02c801c2d5fb$92a37a50$3001...@phx.gbl...