Hi guys,
I have been trying to use the mscomm32.ocx library in my project but to no avail.

generally, i try to use the #import directive to import the library.
However, i get some weired errors from non-project files viz:

#import "C:\\Documents and Settings\\Marembo\My Documents\\Visual Studio 2008\\Projects\\BlueTraxGI\\libraries\\mscomm32.ocx" 
//errors include
1>Compiling...
1>bcdatabase.cpp
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(83) : error C2146: syntax error : missing ';' before identifier 'data'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(83) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(83) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(92) : error C2146: syntax error : missing ';' before identifier 'data'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(92) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(92) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(98) : error C2146: syntax error : missing ';' before identifier 'data'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(98) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(98) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(104) : error C2146: syntax error : missing ';' before identifier 'data'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(104) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(104) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(110) : error C2146: syntax error : missing ';' before identifier 'data'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(110) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(110) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(116) : error C2146: syntax error : missing ';' before identifier 'data'
...

can someone really help me on this, because it is really stressful now

thanks in advance

don't know, unless its because you missed a \ in line 1 just before My Documents.

VC++ 6.0 is a very very old compiler that may, or may not support that import statement.

Really, i am using Visual studio 2008,
and after correcting the smaller mistake of '\' before my document, i still do not resolve my problem

If i cannot really #import this correctly, then i will be forced to
programmatically load the dll.

after loading the DLL, how can i instantiate a pointer to an instance of class in
the dynamically loaded DLL so that i can use it to call member functions of that class

viz:

HINSTANCE hdll = LoadLibrary("....path to library");
if(hdll){
//here i want a pointer to the MSComm structure that i will use to connect to the serial port
//what code should i include here, and how to i use the resulting pointer to call member functions
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.