PRB: Error C2061 in Visual C++ with Odssamp.dll

ID: Q160763


The information in this article applies to:


SYMPTOMS

One of the ODBC samples contained in the Programmers Tool Kit (PTK) is the Odssamp.dll file. This file is created to provide resources for the Odsgt32.dll file. The Odssamp.dll must be built with Visual C++ using the project provided in the PTK. When building this project, it is possible for the following errors to occur:

Compiling resources...
Compiling...
LIBMAIN.C
C:\MSDEV\INCLUDE\prsht.h(246) : error C2061: syntax error : identifier
'NMHDR' C:\MSDEV\INCLUDE\prsht.h(248) : error C2059: syntax error : '}'
Error executing cl.exe.
ODSSAMP.dll - 2 error(s), 0 warning(s)


CAUSE

The following define statement, listed in the Libmain.c file, is incorrect for a 32-bit build of the Odssamp.dll file:


   #define WINVER 0x030A               // prevent Windows 3.1 feature usage 


WORKAROUND

To work around this problem, change the #define in the Libmain.c file to either 0x0400 or to the value of the #define WINVER, listed in the Windows.h file provided by Visual C++ versions 4.0 through 4.2.

Additional query words: gateway


Keywords          : kbprg SSrvODS SSrvProg 
Version           : 2.5 3.0 6.5
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: April 7, 1999