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