BroadcastSystemMessage - Unknown Identifier

G

Guest

Hi,

We have a C++ project written in Visual Studio 6 and we try to compile it in VS 2003 standard version but it gives an error Unknown Identifier on the call of
BroadcastSystemMessage. The VS 2003 installed on Windows XP. Any hints or project settings to make it compiled?

Thanks
A Pham
 
J

john2004

Anybody able to comment on this? I too have a dirt simple shell (Windows
App ) on Windows XP (Studio .NET 2003) Using Standard Windows Libraries,
that calls BroadcastSystemMessage and it will not link. LNK2019 .

included winuser.h
Added user32.lib to project (in Platform SDK, user32.lib is not in the
top level lib folder under V7).

Changed proj to Unicode , no change.
Tried extern "C" in front of the function declaration, but that just
makes it look for
_BroadcastSystemMessage without any other decoration.

Just calling a simple function in a C++ file (no extern "C" ) makes it
look for
long __cdecl BroadcastSystemMessage(...)

But what is in the lib is
__imp__BroadcastSystemMessage@20... ( given by LibView )

So I'm lost on how to make it use the function that is actually in
user32.lib Seems to need something that is undocumented, but I don't
have the background to say.

John
 
J

Jeff Partch [MVP]

john2004 said:
Anybody able to comment on this? I too have a dirt simple shell (Windows
App ) on Windows XP (Studio .NET 2003) Using Standard Windows Libraries,
that calls BroadcastSystemMessage and it will not link. LNK2019 .

included winuser.h
Added user32.lib to project (in Platform SDK, user32.lib is not in the
top level lib folder under V7).

Changed proj to Unicode , no change.
Tried extern "C" in front of the function declaration, but that just
makes it look for
_BroadcastSystemMessage without any other decoration.

Just calling a simple function in a C++ file (no extern "C" ) makes it
look for
long __cdecl BroadcastSystemMessage(...)

But what is in the lib is
__imp__BroadcastSystemMessage@20... ( given by LibView )

So I'm lost on how to make it use the function that is actually in
user32.lib Seems to need something that is undocumented, but I don't
have the background to say.

John

Do you not obtain the function prototype by using #include <Windows.h>?

It looks like you might just be missing WINAPI in the declaration, but --
depending on the platform and UNICODE, there appear to be three possible
exports: BroadcastSystemMessageA, BroadcastSystemMessageW, and
BroadcastSystemMessage.
 
J

john2004

Jeff,
Thanks, I had to add
extern "C" __stdcall long BroadcastSystemMessage( ...

at the top of the file to make it work.
I know WINAPI is the __stdcall part but it took all of it to work.
Joh


-
john200
 
R

Ronald Laeremans [MSFT]

john2004 said:
Jeff,
Thanks, I had to add
extern "C" __stdcall long BroadcastSystemMessage( ...

at the top of the file to make it work.
I know WINAPI is the __stdcall part but it took all of it to work.
Including windows.h is enought to get the right definition. At least if
uou correctly #defined WINVER to at least 0x0400 because the declaration
of BroadcastSystemMessage is guarded with:

#if(WINVER >= 0x0400)

Ronald Laeremans
Visual C++ team
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top