Click here to Skip to main content
15,899,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question_Connection as parameter in IDL file Pin
MrKBA25-Oct-09 22:38
MrKBA25-Oct-09 22:38 
AnswerRe: _Connection as parameter in IDL file Pin
Stuart Dootson26-Oct-09 1:04
professionalStuart Dootson26-Oct-09 1:04 
GeneralRe: _Connection as parameter in IDL file Pin
MrKBA26-Oct-09 1:23
MrKBA26-Oct-09 1:23 
GeneralRe: _Connection as parameter in IDL file Pin
Stuart Dootson26-Oct-09 1:36
professionalStuart Dootson26-Oct-09 1:36 
GeneralRe: _Connection as parameter in IDL file Pin
MrKBA26-Oct-09 2:21
MrKBA26-Oct-09 2:21 
GeneralRe: _Connection as parameter in IDL file Pin
Stuart Dootson26-Oct-09 2:51
professionalStuart Dootson26-Oct-09 2:51 
GeneralRe: _Connection as parameter in IDL file Pin
MrKBA26-Oct-09 3:01
MrKBA26-Oct-09 3:01 
GeneralRe: _Connection as parameter in IDL file Pin
Stuart Dootson26-Oct-09 5:14
professionalStuart Dootson26-Oct-09 5:14 
Spotted it. You define _ISAC_Session OUTSIDE the library, so it cannot see the ADO definitions brought in by the importlib statement, as that is wihtin the library definition.

Changing the importlib to an import statement OUTSIDE the library definition will fix your error. Here's the sample code you posted, modified so it'll work. I've highlighted the import statement I added.

#pragma once
import "oaidl.idl";
import "ocidl.idl";
<big>import "msado15.idl";</big>

[
   uuid(DADD8BCB-AAE5-4E88-9306-1C991A2B77E4),
   version(1.0),
   helpstring("DllService Type Library")
]
library DllServiceLib
{ 
   importlib("stdole2.tlb");
   [
      uuid(EC6DA8D8-DB33-4B29-BBED-8BDDC055D1E4),
      version(1.0),
      helpstring("Enum for UserType: enGroupType(0) - Group, enUserType(1) - User, enAdministaratorType(2) - Administrator") 
   ]
   typedef enum EUserType
   {
      enGroupType = 0,
      enUserType = 1,
      enAdministaratorType = 2
   } _EUserType;
   [
      uuid(38570D0E-A46E-4A43-85DB-2A305D7667A7),
      helpstring("_SAC_Session Class")
   ]
   coclass _SAC_Session
   {
      [default] interface _ISAC_Session;
   };
};
interface _ISAC_Session;
[
   object,
   uuid(148359B4-5D7E-4B7F-82F3-0E8FDBDA0D5D),
   dual,
   nonextensible,
   helpstring("_ISAC_Session Interface"),
   pointer_default(unique)
]
interface _ISAC_Session : IDispatch{
   [id(24), helpstring("get ado connection")] HRESULT get_ADOConnectionObject([in,out] _Connection **ppAdoConnection);
};


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: _Connection as parameter in IDL file Pin
MrKBA26-Oct-09 7:37
MrKBA26-Oct-09 7:37 
GeneralRe: _Connection as parameter in IDL file Pin
Stuart Dootson26-Oct-09 7:56
professionalStuart Dootson26-Oct-09 7:56 
GeneralRe: _Connection as parameter in IDL file Pin
MrKBA26-Oct-09 9:03
MrKBA26-Oct-09 9:03 
GeneralRe: _Connection as parameter in IDL file Pin
Stuart Dootson26-Oct-09 9:11
professionalStuart Dootson26-Oct-09 9:11 
GeneralRe: _Connection as parameter in IDL file Pin
MrKBA27-Oct-09 8:06
MrKBA27-Oct-09 8:06 
GeneralRe: _Connection as parameter in IDL file Pin
Stuart Dootson27-Oct-09 9:02
professionalStuart Dootson27-Oct-09 9:02 
GeneralRe: _Connection as parameter in IDL file Pin
MrKBA27-Oct-09 9:15
MrKBA27-Oct-09 9:15 
GeneralRe: _Connection as parameter in IDL file Pin
Stuart Dootson27-Oct-09 9:20
professionalStuart Dootson27-Oct-09 9:20 
GeneralRe: _Connection as parameter in IDL file Pin
MrKBA27-Oct-09 9:31
MrKBA27-Oct-09 9:31 
GeneralRe: _Connection as parameter in IDL file Pin
Stuart Dootson27-Oct-09 9:37
professionalStuart Dootson27-Oct-09 9:37 
GeneralRe: _Connection as parameter in IDL file Pin
MrKBA27-Oct-09 9:44
MrKBA27-Oct-09 9:44 
GeneralRe: _Connection as parameter in IDL file Pin
MrKBA27-Oct-09 10:45
MrKBA27-Oct-09 10:45 
GeneralRe: _Connection as parameter in IDL file Pin
Stuart Dootson27-Oct-09 13:06
professionalStuart Dootson27-Oct-09 13:06 
QuestionMy texture Problem Pin
Archy_Yu25-Oct-09 21:43
Archy_Yu25-Oct-09 21:43 
AnswerRe: My texture Problem Pin
Cedric Moonen25-Oct-09 22:01
Cedric Moonen25-Oct-09 22:01 
GeneralRe: My texture Problem Pin
Archy_Yu26-Oct-09 4:43
Archy_Yu26-Oct-09 4:43 
GeneralRe: My texture Problem Pin
Cedric Moonen26-Oct-09 4:59
Cedric Moonen26-Oct-09 4:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.