Microsoft KB Archive/102114

From BetaArchive Wiki

INF: Win32 SDK Sample Build Warnings PSS ID Number: Q102114 Article last modified on 07-27-1994



The information in this article applies to:
- Microsoft Win32 Software Development Kit (SDK) for Windows NT version 3.1


Microsoft’s goal was that the Win32 Software Development Kit (SDK) samples would compile cleanly at warning level 3 (-W3). However, due to time constraints, there are warnings that occur when building two of the samples on both x86 and MIPS.


The warnings are as follows:


anicmd.c(768) : warning C4047: ‘argument’ : ‘long’ differs in levels of indirection from ’void *’ anicmd.c(768) : warning C4024: ‘SendMessageA’ : different types for formal and actual parameter 4


snmputil.c(463) : warning C4101: ‘requestId’ : unreferenced local variable

In addition, you get an error registering the Toaster MIB in the SNMPUTIL sample unless you change the makefile so that TESTDLL.C and TESTMIB.C are compiled with /Gz.

Note that these warnings do not prevent the sample applications from running correctly, and therefore they can be ignored.

One error you may encounter is the following:


sharemem.cpp(204) : error C2106 : “=” : left operand must be l-value

This error is encountered if you rename SHAREMEM.C to SHAREMEM.CPP.

The following changes should be made to avoid these warnings:

anicmd.c(768) : typecast 4th parameter of SendMessage()

  SendMessage( hwndCaller, AIM_SETCHILDAPP, 0, (LPARAM) hwnd );

snmputil.c(79) : delete line

  AsnInteger requestId;

sharemem.cpp(204) : typecast the right-hand side of the equation

  MapView = (LONG *) MapViewOfFile (..);

Additional reference words: 3.10 KBCategory: Prg KBSubcategory: CodeSam


Copyright Microsoft Corporation 1994.