Using ADO interfaces in my own interfaces

Using ADO interfaces in my own interfaces

Post by Paul A. Erg » Thu, 01 Jan 1998 04:00:00



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

Using ADO interfaces in my own interfaces

Post by James M. McNall » Thu, 01 Jan 1998 04:00:00


Quote:>MIDL error 0xc0000005: unexpected compiler problem. Try to find a work
>around.

I got the same message a while back.

The remedy is ........

Turn off compiler optimizations.  That worked for me.  Hopefully it will
work for you.

"It's where you want to go today..." :-)

Jim McNally
Softmed Systems,Inc.


 
 
 

1. Using ADO interfaces in IDL

I am designing a custom COM interface that needs to take an
ADOConnection interface pointer as a parameter. In order to do this I
need to get the definition of the ADOConnection interface into my IDL
file.

I have been unable to find a way to do this. The only declarations for
ADO are in the include files "adoid.h" and "adoint.h" but I can not
import these into my IDL file.

I would appreciate any pointers on how to use ADO interfaces in an IDL

--
Dave Rubin

NOTE: to reply to this message remove the "NOSPAM." prefix from
      the reply address.

2. Procedure Cache

3. Using ADO with vc++ 5.0 and need Interface documentation

4. error 605

5. Using ADO Recordsets in IDL defined interfaces

6. NYC / Senior JFC Swing GUI Developers Needed- URGENT !!

7. Using ADO with vc++ 5.0 and need Interface documentation

8. User Interface - my own record index

9. Interface to get an Interface for installed SQL Server Name

10. pgsql/src interfaces/perl5/test.pl interfaces/ ...