IDL: Interface Parameter 
Author Message
 IDL: Interface Parameter

Hello,
I want to program of components.
One is ConnectionManger, which has a clients thread pool. Another is Entity,
which add, modify and delete data of one table of database. But this kind of
Entity should gain connection pointer from ConnectionMananger.
The ConnectionManager get the Connection Pointer from the third type of
component. It is DatabaseConnection. which task is create a ado connection
object.
One of DatabaseConnection's Interface is IDatabaseConnection and it has a
GetConnection member function.
Now I don't know how to write the function's output parameter. Should I
return two parameter, like following:
HRESULT GetConnection([out]IDispatch* _Connect, [out]IDispatch*
_Catalog,[out,retval]LONG* lErrorInfo).
or just one parameter.
HRESULT GetConnection([out]IDispatch* _Connect, [out,retval]LONG*
lErrorInfo);

1. I have read other's code but I don't know what's the use of Catalog and
How to use it.
2. Does the data type [out]IDispatch* is right? Should I use the
[out]IUnknown* here? Why? I think both Ok.Is it right?
3. Is there any more wrong here?

Thank you for your help.
--
kind regards/chenyu



Fri, 10 Oct 2003 17:57:54 GMT  
 IDL: Interface Parameter


Fri, 19 Jun 1992 00:00:00 GMT  
 IDL: Interface Parameter


Quote:
> Hello,
> I want to program 3 types of components.
> One is ConnectionManger, which has a clients thread pool. Another is
Entity,
> which add, modify and delete data of one table of database. But this kind
of
> Entity should gain connection pointer from ConnectionMananger.
> The ConnectionManager get the Connection Pointer from the third type of
> component. It is DatabaseConnection. which task is create a ado connection
> object.
> One of DatabaseConnection's Interface is IDatabaseConnection and it has a
> GetConnection member function.
> Now I don't know how to write the function's output parameter. Should I
> return two parameter, like following:
> HRESULT GetConnection([out]IDispatch* _Connect, [out]IDispatch*
> _Catalog,[out,retval]LONG* lErrorInfo).

error
HRESULT GetConnection([out]IDispatch** _Connect, [out]IDispatch**
_Catalog,[out,retval]LONG* lErrorInfo).

Quote:
> or just one parameter.
> HRESULT GetConnection([out]IDispatch* _Connect, [out,retval]LONG*
> lErrorInfo);

error
HRESULT GetConnection([out]IDispatch** _Connect, [out,retval]LONG*
lErrorInfo);

- Show quoted text -

Quote:

> 1. I have read other's code but I don't know what's the use of Catalog and
> How to use it.
> 2. Does the data type [out]IDispatch* is right? Should I use the
> [out]IUnknown* here? Why? I think both Ok.Is it right?
> 3. Is there any more wrong here?

> Thank you for your help.
> --
> kind regards/chenyu



Fri, 10 Oct 2003 18:20:13 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Interface pointers as parameter in IDL

2. COM IDL - How to see Defaults of Interface parameters

3. Problem reusing idl interface with VC++.NET (nested interfaces)

4. Optional IDL Parameters and C++

5. IDL functiondeklaration with default-parameters

6. Using _Recordset as a parameter in IDL???

7. User defined parameter in IDL

8. How to use IStream parameter in IDL method declaration

9. IDL [in, out string] Parameters

10. IDL file problem : method parameters

11. IDL optional parameters

12. _Recordset pointer as parameter in my IDL

 

 
Powered by phpBB® Forum Software