getting interface pointer from another process.. 
Author Message
 getting interface pointer from another process..

Hi,
i have an exe that uses a DLL that right now i load into the desktop's
address space via SHLoadInProc. right now, the DLL is a pseudo-COM object in
that it does have a guid (that i assign) along with the DllXXX exported
functions but it has no interface (idl file) associated with it (it's pretty
much a C/API DLL). what i'd like to do is make this DLL a full-blown COM
object that i would still like to load via SHLoadInProc. but that presents a
problem. since i'm not doing a CoCreateInstance to instantiate it, how can i
get an interface pointer to the object once it's created and its DLL loaded
into the desktops address space??


Sat, 11 Oct 2003 04:27:58 GMT  
 getting interface pointer from another process..
Hello Parallels,

Quote:
> i have an exe that uses a DLL that right now i load into the desktop's
> address space via SHLoadInProc. right now, the DLL is a pseudo-COM object
in
> that it does have a guid (that i assign) along with the DllXXX exported
> functions but it has no interface (idl file) associated with it (it's
pretty
> much a C/API DLL). what i'd like to do is make this DLL a full-blown COM
> object that i would still like to load via SHLoadInProc. but that presents
a
> problem. since i'm not doing a CoCreateInstance to instantiate it, how can
i
> get an interface pointer to the object once it's created and its DLL
loaded
> into the desktops address space??

You can register your object in ROT by RegisterActiveObject and retrieve it
latter in another process by GetActiveObject. Or use monikers to connect
with running object instance.

--
Best regards,
Vadim Melnik,
{*filter*} Consultant.
_____________________________
http://www.*-*-*.com/



Sat, 11 Oct 2003 04:51:59 GMT  
 getting interface pointer from another process..
Call DllGetClassObject exported function manually, then call
IClassFactory::CreateInstance to get your object. Keep in mind it
is still not a full COM object, just COM-compatible. You can call
through interfaces, QI, etc, but no apartments, marshaling, etc.
You have a direct pointer in every thread.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> Hi,
> i have an exe that uses a DLL that right now i load into the desktop's
> address space via SHLoadInProc. right now, the DLL is a pseudo-COM object
in
> that it does have a guid (that i assign) along with the DllXXX exported
> functions but it has no interface (idl file) associated with it (it's
pretty
> much a C/API DLL). what i'd like to do is make this DLL a full-blown COM
> object that i would still like to load via SHLoadInProc. but that presents
a
> problem. since i'm not doing a CoCreateInstance to instantiate it, how can
i
> get an interface pointer to the object once it's created and its DLL
loaded
> into the desktops address space??



Sat, 11 Oct 2003 05:16:27 GMT  
 getting interface pointer from another process..
thanx..
this is probably a tad over my head though since i'm still basically a
beginner..


Quote:
> Hello Parallels,

> > i have an exe that uses a DLL that right now i load into the desktop's
> > address space via SHLoadInProc. right now, the DLL is a pseudo-COM
object
> in
> > that it does have a guid (that i assign) along with the DllXXX exported
> > functions but it has no interface (idl file) associated with it (it's
> pretty
> > much a C/API DLL). what i'd like to do is make this DLL a full-blown COM
> > object that i would still like to load via SHLoadInProc. but that
presents
> a
> > problem. since i'm not doing a CoCreateInstance to instantiate it, how
can
> i
> > get an interface pointer to the object once it's created and its DLL
> loaded
> > into the desktops address space??

> You can register your object in ROT by RegisterActiveObject and retrieve
it
> latter in another process by GetActiveObject. Or use monikers to connect
> with running object instance.

> --
> Best regards,
> Vadim Melnik,
> {*filter*} Consultant.
> _____________________________
> http://www.*-*-*.com/



Sat, 11 Oct 2003 20:35:23 GMT  
 getting interface pointer from another process..
thanx..
i think i do need marshalling though..
here's what i'm after - i'm loading the DLL into the desktop for 2 reasons:
subclass the desktop so i can trap messages, get a hold of the desktops
image list via IStream so i can use it in my exe. is this possible??


Quote:
> Call DllGetClassObject exported function manually, then call
> IClassFactory::CreateInstance to get your object. Keep in mind it
> is still not a full COM object, just COM-compatible. You can call
> through interfaces, QI, etc, but no apartments, marshaling, etc.
> You have a direct pointer in every thread.

> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD

> MVP VC FAQ: http://www.mvps.org/vcfaq
> =====================================



> > Hi,
> > i have an exe that uses a DLL that right now i load into the desktop's
> > address space via SHLoadInProc. right now, the DLL is a pseudo-COM
object
> in
> > that it does have a guid (that i assign) along with the DllXXX exported
> > functions but it has no interface (idl file) associated with it (it's
> pretty
> > much a C/API DLL). what i'd like to do is make this DLL a full-blown COM
> > object that i would still like to load via SHLoadInProc. but that
presents
> a
> > problem. since i'm not doing a CoCreateInstance to instantiate it, how
can
> i
> > get an interface pointer to the object once it's created and its DLL
> loaded
> > into the desktops address space??



Sat, 11 Oct 2003 20:40:25 GMT  
 getting interface pointer from another process..
I don't know the explorer so I can't answr your questions. None of
them seem to require marshaling though... (and Explorer works
well without COM anyway...)

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> thanx..
> i think i do need marshalling though..
> here's what i'm after - i'm loading the DLL into the desktop for 2
reasons:
> subclass the desktop so i can trap messages, get a hold of the desktops
> image list via IStream so i can use it in my exe. is this possible??



> > Call DllGetClassObject exported function manually, then call
> > IClassFactory::CreateInstance to get your object. Keep in mind it
> > is still not a full COM object, just COM-compatible. You can call
> > through interfaces, QI, etc, but no apartments, marshaling, etc.
> > You have a direct pointer in every thread.

> > --
> > =====================================
> > Alexander Nickolov
> > Microsoft MVP [VC], MCSD

> > MVP VC FAQ: http://www.mvps.org/vcfaq
> > =====================================



> > > Hi,
> > > i have an exe that uses a DLL that right now i load into the desktop's
> > > address space via SHLoadInProc. right now, the DLL is a pseudo-COM
> object
> > in
> > > that it does have a guid (that i assign) along with the DllXXX
exported
> > > functions but it has no interface (idl file) associated with it (it's
> > pretty
> > > much a C/API DLL). what i'd like to do is make this DLL a full-blown
COM
> > > object that i would still like to load via SHLoadInProc. but that
> presents
> > a
> > > problem. since i'm not doing a CoCreateInstance to instantiate it, how
> can
> > i
> > > get an interface pointer to the object once it's created and its DLL
> > loaded
> > > into the desktops address space??



Sun, 12 Oct 2003 02:34:32 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Re : Interface pointers over process boundaries

2. Passing interface pointer across process space

3. Getting the C++ class from the Interface pointer

4. Getting the a pointer to IResponse Interface

5. Why it fails getting interface pointer of IExchangeManageStore?

6. Getting undurlying class from interface pointer

7. Getting process name in the process

8. Getting function name/process from within running process.

9. getting process ID of the current process

10. Getting process ID from process handle

11. Interface with Interface pointer from imported type library as argument

12. Communication between interfaces, CoCreateInstance and interface pointers.

 

 
Powered by phpBB® Forum Software