Accessing a COM object of a COM object 
Author Message
 Accessing a COM object of a COM object

Hi,

I would advice you against using properties, for two reasons, for one, you
are going to need a module level variable, and two if you are going to use
COM+, you are not giving any safety for your data, unless you are going to
make your object persistent, in which case, you again incure overheads. If
you are not using COM+, then it is fine.

I would suggest, you have a method in your class to invoke the excel
application, and the mothod should return an instance of the same to the
caller. The caller can then directly do whatever it wants with the instance.
Just ensure that if your class gets called in between, you take the Excel
handle as a parameters to all your calls.

HTH

Kartik R.


Quote:
> I am writing an interface for a COM object, which itself
> can initialize an external instance of MS Excel.  The end
> client program, written in VB, needs to get access to the
> instance of Excel through my interface and take control of
> the Excel instance directly.  Does anyone know how to do
> this properly?  I was planning on using a read/write
> property of my interface to pass the pointer to the Excel
> instance to the VB program, but I don't know if that will
> work or how to receive the pointer in VB so I can
> manipulate the Excel instance directly.

> Any help would be appreciated.
> Thanks, Kollin



Fri, 12 Dec 2003 12:57:26 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Access a COM object of a COM object?

2. COM-Object in ASP with COM-Object as parameter

3. COM-Object in ASP with COM-Object as Parameter

4. com object will not read registry when com object called from asp (vb works fine)

5. COM Object-Out of stack space on executing/shell exe from com object

6. Call VB DLL or COM object from within VB COM object or EXE

7. Need to Access ASP Session Objects from External COM Object

8. Accessing the web server's Printer object from a VB6 COM object

9. Accessing the web server's Printer object from a VB6 COM object

10. COM-Gen 2000 - Build 107 released - generates COM objects

11. COM-Gen 2000 - Build 153 released - generates COM objects

12. COM-Gen 2000 - Build 153 released - generates COM objects

 

 
Powered by phpBB® Forum Software