其他语言

本类阅读TOP10

·基于Solaris 开发环境的整体构思
·使用AutoMake轻松生成Makefile
·BCB数据库图像保存技术
·GNU中的Makefile
·射频芯片nRF401天线设计的分析
·iframe 的自适应高度
·BCB之Socket通信
·软件企业如何实施CMM
·入门系列--OpenGL最简单的入门
·WIN95中日志钩子(JournalRecord Hook)的使用

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
ADO编程中ATL所遇到的定义问题

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

ADO编程中ATL所遇到的定义问题 
  
 
当欲向接口中定义方法如下:

[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;

       };

};
 




相关文章

相关软件