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

Last reviewed: April 9, 1997
Article ID: Q160763
The information in this article applies to:
  • Microsoft SQL Server, version 6.5
  • Microsoft SQL Server Programmer's Toolkit, version 6.5
  • Microsoft Open Database Connectivity, versions 2.5 and 3.0

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


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