I am trying to create an interface that passes the ADO interface _Recordset
as an out parameter. However, every attempt I have made fails. Below is my
IDL file. I have been trying two different methods. The first is to use
importlib on the DLL, which seems to be the correct way. However I get the
following error when I do this -
.\junk.idl(41) : warning MIDL2039 : interface does not conform to
[oleautomation] attribute : [ Parameter 'pVal' of Procedure 'GetResult'
Interface 'IDA' ) ]
MIDL error 0xc0000005: unexpected compiler problem. Try to find a work
around.
The other thing I have tried, which is commented out right now, is to use
OleView.exe to get the IDL code and add that to my project using the import
directive. However, when I do that I get this error -
Processing .\msado.idl
msado.idl
MIDL error 0xc0000005: unexpected compiler problem. Try to find a work
around.
Error executing c:\winnt\system32\cmd.exe.
Does anyone have any ideas on how I can accomplish this task?
---Cut----
// junk.idl : IDL source for junk.dll
//
// This file will be processed by the MIDL tool to
// produce the type library (junk.tlb) and marshalling code.
import "oaidl.idl";
import "ocidl.idl";
//import "msado.idl";
[
uuid(C6D87B02-8166-11D1-8C45-00805F0F40FE),
version(1.0),
helpstring("junk 1.0 Type Library")
]
library JUNKLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
importlib ("C:\Program Files\Common Files\System\ado\msador15.dll");
[
uuid(C6D87B12-8166-11D1-8C45-00805F0F40FE),
helpstring("DA Class")
]
coclass DA
{
[default] interface IDA;
};
[Quote:};
object,
uuid(C6D87B11-8166-11D1-8C45-00805F0F40FE),
dual,
helpstring("IDA Interface"),
pointer_default(unique)
]
interface IDA : IDispatch
{
[id(1), helpstring("method GetResult")] HRESULT GetResult([out] _Recordset
** pVal);
};
---Cut---