PRB: BroadcastSystemMessageA Not Found in User32.dll on Win 95

Last reviewed: March 20, 1998
Article ID: Q182809
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK) on the following platform:

    - Windows 95

  • Microsoft Visual C++, 32-bit Edition, versions 4.0, 4.1, 4.2, 5.0
  • Microsoft Win32 Application Programming Interface (API)

SYMPTOMS

If you use BroadcastSystemMessage() in an application written with Visual C++ 4.x or 5.x or the Platform SDK, the application fails on Windows 95 with the following error:

   BroadcastSystemMessageA not found in User32.dll.

CAUSE

The Winuser.h file included with Visual C++ 4.x and 5.x and the Platform SDK defines BroadcastSystemMessage as BroadcastSystemMessageA if UNICODE is not defined. Because Windows NT 4.0 exports BroadcastSystemMessage and BroadcastSystemMessageA as the same ordinal, this works as expected. Because Windows 95 does not export BroadcastSystemMessageA, the run-time bind to User32.dll fails and the application is aborted.

RESOLUTION

In Winuser.h, change the #define that reads:

   #define BroadcastSystemMessage  BroadcastSystemMessageA

to read:

   #define BroadcastSystemMessage  BroadcastSystemMessage

Because Windows NT exports both BroadcastSystemMessage and BroadcastSystemMessageA for the same ordinal, this work-around allows the application to work on Windows NT 4.x and Windows 95.

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

You can reproduce this problem by creating a dialog-based MFC application and placing the following code in InitInstance (replacing "TODO: Place code here to handle when the dialog is dismissed with OK"):

   BroadcastSystemMessage(BSF_POSTMESSAGE,BSM_ALLCOMPONENTS,WM_NULL,0,0);

This sends a harmless message to all components in the system. On a system that demonstrates the problem, the error dialog box appears and the application fails.


Additional query words: Win95 NT4 BroadcastSystemMessage User32.dll
Keywords : KBShell
Platform : Win95
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 20, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.