apartment info 
Author Message
 apartment info

hello
can anyone think of a way of doing this: given a process, finding out what
COM apartments it has associated with it, and figuring out which COM objects
live in which apartments..?

thanks
A



Fri, 25 Feb 2005 14:10:06 GMT  
 apartment info
That's impossible given the documented COM APIs. There's no
apartment ID, no way of enumerating aprtments, no way of
enumerating objects. None of the tasks are possible on their
own, much less in conjuction...

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

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

Quote:

> hello
> can anyone think of a way of doing this: given a process, finding out what
> COM apartments it has associated with it, and figuring out which COM objects
> live in which apartments..?

> thanks
> A



Sat, 26 Feb 2005 02:37:21 GMT  
 apartment info
much as i suspected - it's a pity .. and one of the big downfalls of COM...
you're always second guessing what COM is doing under the covers....
there is one interesting looking interface call:

IComThreadingInfo::GetCurrentApartmentType

but as usual, the microsoft documentation is lame and there is no
explanation as to how one might use this interface in an application...

any ideas?


That's impossible given the documented COM APIs. There's no
apartment ID, no way of enumerating aprtments, no way of
enumerating objects. None of the tasks are possible on their
own, much less in conjuction...

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

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


Quote:
> hello
> can anyone think of a way of doing this: given a process, finding out what
> COM apartments it has associated with it, and figuring out which COM
objects
> live in which apartments..?

> thanks
> A



Sat, 26 Feb 2005 03:53:04 GMT  
 apartment info
You don't really need to know in programmatic time what goes
under the hood. If you are interested in the details for yourself,
there are books for that: "Essential COM" by Don Box, Addison
Wesley.

As for IComThreadingInfo, this interface is not in my MSDN
Library (October 2001) and appears to have been added as
late as August 2002 (the date in MSDN Library Online). Newly
documented feature is about as same as an undocumented
one... Just for the sport, try CoGetCallContext to get to the
interface pointer (this is just a guess, though likely to come
out true).

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

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

Quote:

> much as i suspected - it's a pity .. and one of the big downfalls of COM...
> you're always second guessing what COM is doing under the covers....
> there is one interesting looking interface call:

> IComThreadingInfo::GetCurrentApartmentType

> but as usual, the microsoft documentation is lame and there is no
> explanation as to how one might use this interface in an application...

> any ideas?



> That's impossible given the documented COM APIs. There's no
> apartment ID, no way of enumerating aprtments, no way of
> enumerating objects. None of the tasks are possible on their
> own, much less in conjuction...

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

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



> > hello
> > can anyone think of a way of doing this: given a process, finding out what
> > COM apartments it has associated with it, and figuring out which COM
> objects
> > live in which apartments..?

> > thanks
> > A



Sat, 26 Feb 2005 04:44:38 GMT  
 apartment info
sure you do ... in any software system, the more information you have, the
better off you are, especially when debugging. Often you will be dealing
with servers you dont have the source code to. It would be great if there
was some sort of default implementation on every com object that gave you
all its context information - for debugging purposes.. something that could
be used by the vc de{*filter*} for example to display more information about com
pointers. The number of times i'm asking myself..um ok .. is this interface
pointer pointing to the actual object or is it a proxy? what interfaces does
it implement? etc...
I've read all the books thanks.


You don't really need to know in programmatic time what goes
under the hood. If you are interested in the details for yourself,
there are books for that: "Essential COM" by Don Box, Addison
Wesley.

As for IComThreadingInfo, this interface is not in my MSDN
Library (October 2001) and appears to have been added as
late as August 2002 (the date in MSDN Library Online). Newly
documented feature is about as same as an undocumented
one... Just for the sport, try CoGetCallContext to get to the
interface pointer (this is just a guess, though likely to come
out true).

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

MVP VC FAQ: http://www.*-*-*.com/
=====================================


Quote:
> much as i suspected - it's a pity .. and one of the big downfalls of
COM...
> you're always second guessing what COM is doing under the covers....
> there is one interesting looking interface call:

> IComThreadingInfo::GetCurrentApartmentType

> but as usual, the microsoft documentation is lame and there is no
> explanation as to how one might use this interface in an application...

> any ideas?



> That's impossible given the documented COM APIs. There's no
> apartment ID, no way of enumerating aprtments, no way of
> enumerating objects. None of the tasks are possible on their
> own, much less in conjuction...

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

> MVP VC FAQ: http://www.*-*-*.com/
> =====================================



> > hello
> > can anyone think of a way of doing this: given a process, finding out
what
> > COM apartments it has associated with it, and figuring out which COM
> objects
> > live in which apartments..?

> > thanks
> > A



Sun, 27 Feb 2005 00:16:48 GMT  
 apartment info

Quote:
> The number of times i'm asking myself..um ok .. is this interface
> pointer pointing to the actual object or is it a proxy?

Query it for IClientSecurity - only proxies implement it.

Quote:
> what interfaces does it implement?

There is no way to know whether an interface is implemented without
actually querying for it. One way to do it for debugging purposes is to
enumerate all keys under HKCR\Interface and QI for each IID found there.
You only get marshallable interfaces this way though.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken



Sun, 27 Feb 2005 00:28:09 GMT  
 apartment info
Sorry, I didn't realize you were writing a de{*filter*}. My statement
holds true for designing and coding any regular program though
(not for debugging it).

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

MVP VC FAQ: http://www.*-*-*.com/
=====================================

Quote:

> sure you do ... in any software system, the more information you have, the
> better off you are, especially when debugging. Often you will be dealing
> with servers you dont have the source code to. It would be great if there
> was some sort of default implementation on every com object that gave you
> all its context information - for debugging purposes.. something that could
> be used by the vc de{*filter*} for example to display more information about com
> pointers. The number of times i'm asking myself..um ok .. is this interface
> pointer pointing to the actual object or is it a proxy? what interfaces does
> it implement? etc...
> I've read all the books thanks.



> You don't really need to know in programmatic time what goes
> under the hood. If you are interested in the details for yourself,
> there are books for that: "Essential COM" by Don Box, Addison
> Wesley.

> As for IComThreadingInfo, this interface is not in my MSDN
> Library (October 2001) and appears to have been added as
> late as August 2002 (the date in MSDN Library Online). Newly
> documented feature is about as same as an undocumented
> one... Just for the sport, try CoGetCallContext to get to the
> interface pointer (this is just a guess, though likely to come
> out true).

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

> MVP VC FAQ: http://www.*-*-*.com/
> =====================================



> > much as i suspected - it's a pity .. and one of the big downfalls of
> COM...
> > you're always second guessing what COM is doing under the covers....
> > there is one interesting looking interface call:

> > IComThreadingInfo::GetCurrentApartmentType

> > but as usual, the microsoft documentation is lame and there is no
> > explanation as to how one might use this interface in an application...

> > any ideas?



> > That's impossible given the documented COM APIs. There's no
> > apartment ID, no way of enumerating aprtments, no way of
> > enumerating objects. None of the tasks are possible on their
> > own, much less in conjuction...

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

> > MVP VC FAQ: http://www.*-*-*.com/
> > =====================================



> > > hello
> > > can anyone think of a way of doing this: given a process, finding out
> what
> > > COM apartments it has associated with it, and figuring out which COM
> > objects
> > > live in which apartments..?

> > > thanks
> > > A



Sun, 27 Feb 2005 01:44:27 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Retrieving info about apartments

2. Type Info, Parameter Info Not working while mouse is over an object or method

3. slightly OT: need help finding info on quering printers for info

4. Retrieve Info from Version Info Resource

5. Single Thread Apartment???

6. Timer in COM-Multithreaded Apartments model.

7. RTA/TNA apartment attribute?

8. Question regarding apartments vs synchronized regions in CLR

9. Windows service - apartment state

10. Cross Apartment Concepts/Marshalling

11. Is there an apartment before I call CoInitialize?

12. Ole control between apartments

 

 
Powered by phpBB® Forum Software