编程中所遇到的定义问题牛

2021-08-24 淮安装修公司

当欲向接口中定义方法如下:

[id(1), helpstring(\"method SearchCust\")] HRESULT SearchCust([in] BSTR bstrcustid,[out,retval] _Recordset **ptr);

由于用到_Recordset类型,所以必须

importlib(\"C:\\Program Files\\Common Files\\System\\ADO\\L\");

于是整个idl文件应该改写为以下方式:

// l : IDL source for l

//

// This file will be processed by the MIDL tool to

// produce the type library (b) and marshalling code.

import \"l\";

import \"l\";

[

uuid(B32A7DDD5-ACA0247A8577),

version(1.0),

helpstring(\"FindCust 1.0 Type Library\")

]

在日本2011年版《防卫白皮书》中 library FINDCUSTLib //Library给手动提前了

{

importlib(\"b\");

importlib(\"b\");

//MODIFY HERE

importlib(\"C:\\Program Files\\Common Files\\System\\ADO\\L\");

[

object,

uuid(B32A7D7F-12DD5-ACA0247A8577),

dual,

helpstring(\"ISearch Interface\"),

pointer_default(unique)

]

interface ISearch : IDispatch

{

[id(1), helpstring(\"method SearchCust\")] HRESULT SearchCust([in] BSTR bstrcustid,[out,retval] _Recordset **ptr);

};

[

uuid(B32A7DDD5-ACA0247A8577),

helpstring(\"_ISearchEvents Interface\")

]

dispinterface _ISearchEvents

{

properties:

methods:

};

[

uuid(B32A7DDD5-ACA0247A8577),

helpstring(\"Search Class\")

]

coclass Search

{

[default] interface ISearch;

[default, source] dispinterface _ISearchEvents;

};

};

湖州前列腺炎治疗多少钱
认知功能障碍怎么治疗
安顺有没有医院治疗白癜风
为你推荐