#import "G:\WINDOWS\system32\MSCHRT20.OCX" raw_interfaces_only, raw_native_types, no_namespace, named_guids 错误:\mschrt20.tlh(2489) : error C2061: syntax error : identifier 'DataMember'
解决方案 »
- 为什么《WINDOWS网络编程技术》的配套源码中程序先WSARecv( )?
- 简单的计算器MFC编程 不知道怎么回事
- FormView凹入问题
- 发送自定义消息传值的问题!!在线等,谢谢
- ATL做的ActiveX控件怎么重绘?
- 一个小问题!(在线等待)
- 关于报表数据不能连续打印的问题?
- 为什么一个ADO查询不支持DISTINCT 或group by? 100分
- .用CoInitialize(NULL)初始化com库,和使用AfxOleInit()初始化com库有什么不一样??
- 有深圳的熟悉C++,熟练运用vs的么
- 在局域网内用UDP协议传输的速度问题.
- 又到了散分的星期五[截止8:13 4:00pm]
编译器错误 C2061语法错误 : 标识符“identifier”编译器在不应有此标识符的地方发现 identifier。初始值设定项可能括在了括号中。为避免该问题,请将声明符括在括号中或使其成为 typedef。在编译器将表达式作为类模板参数检测时也可能导致此错误;使用 typename 告诉编译器它是一个类型。
rename(“OldName”, “NewName”)原因如下
The rename attribute
rename("OldName","NewName")OldNameOld name in the type libraryNewNameName to be used instead of the old nameThe rename attribute is used to work around name collision problems. If this attribute is specified, the compiler replaces all occurrences of OldName in a type library with the user-supplied NewName in the resulting header files.This attribute can be used when a name in the type library coincides with a macro definition in the system header files. If this situation is not resolved, then various syntax errors will be generated, such as C2059 and C2061.Note The replacement is for a name used in the type library, not for a name used in the resulting header file.Here is an example: Suppose a property named MyParent exists in a type library, and a macro GetMyParent is defined in a header file and used before #import. Since GetMyParent is the default name of a wrapper function for the error-handling get property, a name collision will occur. To work around the problem, use the following attribute in the #import statement:rename(“MyParent”,”MyParentX”)which renames the name MyParent in the type library. An attempt to rename the GetMyParent wrapper name will fail:rename(“GetMyParent”,”GetMyParentX”)This is because the name GetMyParent only occurs in the resulting type library header file.
#import "G:\WINDOWS\system32\MSCHRT20.OCX"的路径对不对?