闂備浇銆€閸嬫捇鏌熼婊冾暭妞ゃ儻鎷� (0) +1 闂佽崵濮嶅鍡楊伓 (0) +1 闂傚倸饪存禍鐑藉箯閿燂拷 (0) +1
闂備浇銆€閸嬫捇鏌熼婊冾暭妞ゃ儲鍨块弻鐔衡偓娑櫭慨鍥р攽椤曞棙瀚�闂備礁鎼悮顐﹀磿閸愯鑰块柛娑欐綑缂佲晠鏌熼婊冾暭妞ゃ儻鎷�>>

正在阅读:ADO编程中ATL所遇到的定义问题ADO编程中ATL所遇到的定义问题

2004-08-02 09:47 出处:CSDN 作者:smallmark 责任编辑:linjixiong

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



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

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

    importlib("C:\Program Files\Common Files\System\ADO\MSADO15.DLL");

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

// FindCust.idl : IDL source for FindCust.dll

//

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

// produce the type library (FindCust.tlb) and marshalling code.

import "oaidl.idl";

import "ocidl.idl";

[

       uuid(B32A7D72-12D4-11D5-AC09-00A0247A8577),

       version(1.0),

       helpstring("FindCust 1.0 Type Library")

]

library FINDCUSTLib    //Library给手动提前了

{

       importlib("stdole32.tlb");

       importlib("stdole2.tlb");

//MODIFY HERE

    importlib("C:\Program Files\Common Files\System\ADO\MSADO15.DLL");

       [

              object,

 


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:


              uuid(B32A7D7F-12D4-11D5-AC09-00A0247A8577),

              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(B32A7D81-12D4-11D5-AC09-00A0247A8577),

              helpstring("_ISearchEvents Interface")

       ]

       dispinterface _ISearchEvents

       {

              properties:

              methods:

       };

       [

              uuid(B32A7D80-12D4-11D5-AC09-00A0247A8577),

              helpstring("Search Class")

       ]

       coclass Search

       {

              [default] interface ISearch;

              [default, source] dispinterface _ISearchEvents;

       };

};
 


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品
闂備礁缍婂ḿ褔顢栭崱妞绘敠闁逞屽墴閹鎷呴崨濠備淮濠碘槅鍋撻幏锟�闂備焦鎮堕崕鎶藉磻濞戙垹鏄ラ悘鐐板嫎娴滄粓鏌涢锝嗙闁告棑鎷�