描述:
我用OLE VIEWER从MSN的EXE文件里生成IDL文件后
用MIDL来编译,但是出错了
该如何解决?
F:\Program Files\Microsoft SDK\Bin>midl c:\msnmsgr.idl
Microsoft (R) 32b/64b MIDL Compiler Version 6.00.0361
Copyright (c) Microsoft Corporation 1991-2002. All rights reserved.
Processing c:\msnmsgr.idl
msnmsgr.idl
Processing F:\Program Files\Microsoft Visual Studio\VC98\include\oaidl.idl
oaidl.idl
Processing F:\Program Files\Microsoft Visual Studio\VC98\include\objidl.idl
objidl.idl
Processing F:\Program Files\Microsoft Visual Studio\VC98\include\unknwn.idl
unknwn.idl
Processing F:\Program Files\Microsoft Visual Studio\VC98\include\wtypes.idl
wtypes.idl
c:\msnmsgr.idl(64) : error MIDL2025 : syntax error : expecting a type specificat
ion near "SESSION_STATE"
c:\msnmsgr.idl(64) : error MIDL2026 : cannot recover from earlier syntax errors;
aborting compilation
F:\Program Files\Microsoft SDK\Bin>
**************************************************************************************************************************************************
解决方案1:
把 SESSION_STATE的定义放在文件比较靠前的位置
typedef [public]
__MIDL___MIDL_itf_msgrpriv_0000_0001 SESSION_STATE;
typedef enum {
SS_UNKNOWN = 0,
SS_READY = 1,
SS_INVITATION = 2,
SS_ACCEPTED = 3,
SS_CONNECTED = 4,
SS_CANCELLED = 5,
SS_DECLINED = 6,
SS_TERMINATED = 7
} __MIDL___MIDL_itf_msgrpriv_0000_0001;