PRB: DLLEntry in SNMP testdll Sample Does Not Get Called

Last reviewed: December 9, 1996
Article ID: Q160621
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK) for Windows 95, versions 3.51, 4.0
  • Microsoft Win32 Software Development Kit (SDK) for Windows NT, versions 3.51, 4.0

SYMPTOMS

DLLEntry, the entry point in the Win32 SDK SNMP extension agent sample, testdll, does not get called. As a result, if you model your own SNMP extension agent on the testdll sample, any code you run during DLL initialization and/or cleanup will not get called. This is not a problem for this sample, however, because it does not run any code during DLL initialization/cleanup and thus does not impact its proper running.

CAUSE

The problem arises because DLLEntry is not specified in the makefile as the DLL entry point.

RESOLUTION

The workaround is to change the DLL entry point to DllMain or to specify DLLEntry as the entry point in the link line of the makefile.

It can be easier and safer to change the DLL entry point name to DllMain than to modify the link line in the makefile to use DLLEntry as the entry point. This is because the C Run Time is automatically initialized if the DLL entry point is named DllMain without any additional changes to the code required.

STATUS

This behavior is by design.

REFERENCES

For more information about DLL entry points, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q94248
   TITLE     : Using the C Run Time


KBCategory: kbnetwork kbprb
KBSubcategory: NtwkSNMP
Additional reference words: 3.51 4.00 kbdsi



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: December 9, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.