using mscomm32.ocx in c/c++

Hi guys

I have been tasked to write and read to the serial port using the mscomm32.ocx library.

My problem is that, i try to
#import "libpath\mscomm32.ocx"

to my project, but i get the following errors,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
1>stdafx.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'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(116) : 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 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(697) : error C2146: syntax error : missing ';' before identifier 'abData'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(697) : 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(697) : 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(722) : error C2146: syntax error : missing ';' before identifier 'abData'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(722) : 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(722) : 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(739) : error C2143: syntax error : missing ';' before '*'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(739) : 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(739) : 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(853) : error C2146: syntax error : missing ';' before identifier 'pBuffer'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wtypes.h(853) : 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(853) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(3130) : error C2061: syntax error : identifier 'byte'
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(3421) : error C2061: syntax error : identifier 'byte'
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(3435) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(3435) : error C2143: syntax error : missing ',' before '*'
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(4155) : error C2061: syntax error : identifier 'byte'
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(4187) : error C2061: syntax error : identifier 'byte'
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(4631) : error C2061: syntax error : identifier 'byte'
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(4646) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(4646) : error C2143: syntax error : missing ',' before '*'
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(5076) : error C2146: syntax error : missing ';' before identifier 'data'
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(5076) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(5076) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(8285) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(8285) : error C2143: syntax error : missing ',' before '*'
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(8300) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(8300) : error C2143: syntax error : missing ',' before '*'
...

what could be the problem?
if you notice, the errors do not arise from my project files
Note:

am working on windows xp sp3, i have installed vs6, but i work on the vs8 environment

Thanks in advance
Last edited on
you do not need to #import "libpath\mscomm32.ocx"
if you use VC6, you can choose menu "project"->"add to project"->"components & controls"
and choose microsoft communication control or something like that.
then you get a new class CMSComm, and you can use that class directly
Topic archived. No new replies allowed.