LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CINs, ODBC and MS Visual C++ .NET 2003

I am attempting to use ODBC within a CIN using MS VC++ .NET 2003. After I set up the CIN and the environment, I tested a compile and it worked fine. However, after I included an ODBC header file, the program no longer compiles. The only change I made was including the two required headers for ODBC:

/* CIN source file */

#include "extcode.h"
#include "sql.h"
#include "sqlext.h"

/* typedefs removed for brevity of post */

MgErr CINRun(TD1 *ConnectionOptions, LStrHandle *Number, TD2Hdl *RecordSet)
{
return noErr;
}

_____

Compiling...
Connect.c
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\sqltypes.h(137) : error C2061: syntax error : identifier 'SQLHWND'
c:\Program Files\Micro
soft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\sqltypes.h(137) : error C2059: syntax error : ';'

_____

sqltypes.h
136: #if defined(WIN32) || defined(OS2)
137: typedef HWND SQLHWND;

The errors are in files I did not write/change. This is a fresh install of VC++. Is it not possible to use ODBC with a CIN? If it is, how do I fix this error. There are many more like this one, this is simply the first. The rest are very similar for similar lines.
0 Kudos
Message 1 of 2
(2,846 Views)
> Compiling...
> Connect.c
> c:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\PlatformSDK\Include\sqltypes.h(137) : error C2061: syntax
> error : identifier 'SQLHWND'
> c:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\PlatformSDK\Include\sqltypes.h(137) : error C2059: syntax
> error : ';'
>
> _____
>
> sqltypes.h
> 136: #if defined(WIN32) || defined(OS2)
> 137: typedef HWND SQLHWND;
>

This looks like you probably need to include another windows header
file, such as windows.h. CINs are often used for simple mathematics and
the platform specific headers aren't included automatically. It would
be ideal of the sql header included what it needed, but perhaps it has a
dependency that it doesn't handle on its own. Try addi
ng

#include "windows.h"

before your sql header file and see if that helps.
0 Kudos
Message 2 of 2
(2,846 Views)