ADO编程中ATL所遇到的定义问题
2004-07-28 19:56
393 查看
当欲向接口中定义方法如下: [id(1), helpstring("method SearchCust")] HRESULT SearchCust([in] BSTR bstrcustid,[out,retval] _Recordset **ptr); <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
由于用到_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(B<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />32A7D72-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; }; };
由于用到_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(B<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />32A7D72-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; }; };
相关文章推荐
- ADO编程中ATL所遇到的定义问题
- ADO编程中ATL所遇到的定义问题
- ADO编程中ATL所遇到的定义问题
- ADO编程笔记-记录遇到的问题
- 求助:C#编程中遇到的问题
- 编程时遇到的小问题
- 编程中遇到的问题小结
- MFC编程中遇到的问题记录
- 程序员在编程中遇到的奇葩弱智问题
- C语言编程时遇到的若干问题
- 关于winodows下编程c++遇到的引用文件路径问题
- VS使用SVN协同编程中遇到的小问题
- 网易面试题之小易是一个数论爱好者,并且对于一个数的奇数约数十分感兴趣。一天小易遇到这样一个问题: 定义函数f(x)为x最大的奇数约数,x为正整数。 例如:f(44) = 11. 现在给出一个N,需要求
- 关于使用Entity Framework时遇到的问题 未找到具有固定名称“System.Data.SqlClient”的 ADO.NET 提供程序的实体框架提供程序。请确保在应用程序配置文件的“entityFramework”节中注册了该提供程序
- android编程中容易遇到的若干问题
- 黑马程序员_编程新手遇到问题怎么办?
- Java编程过程中遇到的问题记录
- 编程过程中遇到的python问题与解决方法_来自网络
- .NET 使用ORACLE ADO.NET 经常会遇到的问题
- ipv6 socket 编程中遇到的问题