FIX: SNMP Sample Generates an Application ErrorLast reviewed: October 29, 1997Article ID: Q124961 |
3.50
WINDOWS NT
kbnetwork kbnetwork kbfixlist kbbuglist
The information in this article applies to:
SYMPTOMSThe Win32 SDK for Windows NT 3.5 contains a SNMP sample called SNMPUTIL (\MSTOOLS\SAMPLES\WIN32\SNMP\SNMPUTIL). Building this sample generates an executable file that causes an access violation. The message box displayed resembles the following:
snmputil.exe - Application Error ----------------------------------------------------------------- The instruction at <address> referenced memory at <address>. The memory could not be "read". CAUSEOne part of the SNMP run times uses the C run-time routines provided by CRTDLL.DLL. The other part of the SNMP run times uses the C run-time routines that the application uses. Because many people are using Visual C++ to build the samples, the run time routines used are in MSVCRT20.DLL. The access violation occurs when memory allocated using one run time version are freed using a different copy of the run time library.
RESOLUTIONOne possible solution is to build the sample application using the CRTDLL.DLL version of the run time library. If you are using the makefile supplied with the Win32 SDK, one way to accomplish this is to:
If you are using a Visual C++ make file, you can:
Project Settings property page.NOTE: CRTDLL.LIB does not ship with Visual C++. You can get the CRTDLL.LIB file from the Win32 SDK in the \MSTOOLS\LIB\CRT\<PLATFORM> directory, where <PLATFORM> would be replaced with the type of machine you are using (I386, alpha, and so forth). If you are using MFC 3.0, you will not be able to use CRTDLL.DLL because MFC 3.0 uses some functions that are not supplied in CRTDLL.DLL.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in the Win32 SDK version 3.51.
|
Additional reference words: 3.50
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |