How to Broadcast Messages Using NetMessageBufferSend()

Last reviewed: September 29, 1995
Article ID: Q131458
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK) versions 3.5, 3.51

The NetMessageBufferSend() API can be used to broadcast a message. To broadcast a copy a of a particular message to all workstations running messanger service in a particular domain, the LPWSTR msgname parameter needs to be specified as "DOMAINNAME*" - where DOMAINNAME is the name of the domain to which a message is to be sent. In this case, you can use the following piece of code to call this API:

   #define UNICODE
   #define MESGLEN 50
   WCHAR awcToName[] = TEXT("DomainName*");
   WCHAR awcFromName[] = Text("MyComputer");
   WCHAR awcMesgBuffer[MESGLEN] = Text("This ia Test Message");
   NET_API_STATUS nasStatus;

   nasStatus = NetMessageBufferSend(NULL,
                                    awcToName,
                                    awcFromName,
                                    awcMesgBuffer,
                                    MESGLEN);


Additional reference words: 3.50 3.51 LanMan
KBCategory: kbnetwork kbnetwork
KBSubcategory: NtwkMisc


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: September 29, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.