vs.net(vc)为什么不能编译idl文件中的属性呢?该如何解决
vs.net(vc)为什么不能编译idl文件中的属性呢?
我的idl文件是这样的:interface ICar: IDispatch
{
[
propget,
id(0x000000C9),
helpstring( "车载机名称 ")
]
HRESULT _stdcall CarName([out, retval] LPSTR * Value );
[
propput,
id(0x000000C9),
helpstring( "车载机名称 ")
]
HRESULT _stdcall CarName([in] LPSTR Value );
[
propget,
id(0x000000CA),
helpstring( "回应数据 ")
]
HRESULT _stdcall ResponseData([out, retval] TResponseData * Value /*Warning: unable to validate structure name: */ );
};
但vc编译后变成了: MIDL_INTERFACE( "3839DAF6-A64F-4FCD-979B-2A75529C58B4 ")
ICar : public IDispatch
{
public:
virtual /* [helpstring][id][propget] */ HRESULT __stdcall get_CarName(
/* [retval][out] */ LPSTR *Value) = 0;
virtual /* [helpstring][id][propput] */ HRESULT __stdcall put_CarName(
/* [in] */ LPSTR Value) = 0;
virtual /* [helpstring][id][propget] */ HRESULT __stdcall get_ResponseData(
/* [retval][out] */ TResponseData *Value) = 0;
};
是不是vc调用com时不支持属性啊。
------解决方案--------------------
什么意思?
支持get和put啊.
------解决方案--------------------
C++不支持属性,所以用get put来区分
------解决方案--------------------
这是没办法的事情
写文档的时候当然只能写属性名字了,put,get是编译器加上的。
我的idl文件是这样的:interface ICar: IDispatch
{
[
propget,
id(0x000000C9),
helpstring( "车载机名称 ")
]
HRESULT _stdcall CarName([out, retval] LPSTR * Value );
[
propput,
id(0x000000C9),
helpstring( "车载机名称 ")
]
HRESULT _stdcall CarName([in] LPSTR Value );
[
propget,
id(0x000000CA),
helpstring( "回应数据 ")
]
HRESULT _stdcall ResponseData([out, retval] TResponseData * Value /*Warning: unable to validate structure name: */ );
};
但vc编译后变成了: MIDL_INTERFACE( "3839DAF6-A64F-4FCD-979B-2A75529C58B4 ")
ICar : public IDispatch
{
public:
virtual /* [helpstring][id][propget] */ HRESULT __stdcall get_CarName(
/* [retval][out] */ LPSTR *Value) = 0;
virtual /* [helpstring][id][propput] */ HRESULT __stdcall put_CarName(
/* [in] */ LPSTR Value) = 0;
virtual /* [helpstring][id][propget] */ HRESULT __stdcall get_ResponseData(
/* [retval][out] */ TResponseData *Value) = 0;
};
是不是vc调用com时不支持属性啊。
------解决方案--------------------
什么意思?
支持get和put啊.
------解决方案--------------------
C++不支持属性,所以用get put来区分
------解决方案--------------------
这是没办法的事情
写文档的时候当然只能写属性名字了,put,get是编译器加上的。