Click here to Skip to main content
16,005,316 members
Home / Discussions / COM
   

COM

 
GeneralProblem identified... Pin
Jamie Hale18-Dec-01 9:27
Jamie Hale18-Dec-01 9:27 
GeneralRe: Problem identified... Pin
Ernest Laurentin18-Dec-01 9:48
Ernest Laurentin18-Dec-01 9:48 
GeneralRe: Problem identified... Pin
Jamie Hale18-Dec-01 10:19
Jamie Hale18-Dec-01 10:19 
GeneralOutput parameter for COM local server Pin
18-Dec-01 4:54
suss18-Dec-01 4:54 
GeneralRe: Output parameter for COM local server Pin
Michael P Butler18-Dec-01 5:04
Michael P Butler18-Dec-01 5:04 
GeneralRe: Output parameter for COM local server Pin
18-Dec-01 6:05
suss18-Dec-01 6:05 
QuestionHow to capture IE Event in WTL.... Pin
Huu Quynh18-Dec-01 3:37
Huu Quynh18-Dec-01 3:37 
GeneralSome Basic COM Questions Pin
ragamuffin16-Dec-01 8:49
ragamuffin16-Dec-01 8:49 
There are a few questions. I am desperately seeking answers. Please do reply if you know any of them as it will save me a lot of time.

#1. What exactly is an apartment? Do we mean a method / function? What if a method call to a COM object internally calls another method of the same COM object? Will it still be ONE apartment?

#2. Do we ever need proxy / stubs for COM objects packaged as DLLs? Can you please come up with a scenario? DLLs are in-process so what process is the stub part of?

#3. This last one is lengthy and will require some concentration:

I have Beginning ATL 3 COM Programming (borrowed from Safri Ustaad). According to the example in the book (bare bone pure C++ COM implemented as a DLL), a COM class implementing IFoo should have these: a CFoo class implementing IFoo (and thus IUnknown) and a CClassFactory class implementing IClassFactory (and thus IUnknown). The DLL should have a method DllGetClassObject that should call CreateInstance of CClassFactory which should internally create a new CFoo and call it's QueryInterface. The pointer to CFoo should be returned by DllGetClassObject. However, to the best of my experiments, things are not working this way. I am afraid the book is wrong.

The call to DllGetClassObject should not call CreateInstance; instead it should return a pointer to CClassFactory. The CoCreateInstance of COM mechanism will then _itself_ call CreateInstance on this pointer (as it implements IClassFactory). The CreateInstance should then create a new CFoo and call it's QueryInterface and return it to the caller.

In short, the difference is between the stuff returned by DllGetClassObject and calling CreateInstance of CClassFactory. Do tell me whether my hypothesis is right or wrong as I am still not confident that the book from Wrox has such an error. Overall, the book is an excellent introduction to ATL programming and there are a couple of chapters on the background theory.


Waiting for a response....
Muhammad Ali Shah

~~~~~~~~~~~~~~~
Our scientific power has outrun our spiritual power. We have guided missiles and misguided men (Martin Luther King Jr)
GeneralRe: Some Basic COM Questions Pin
Aaron Schaefer17-Dec-01 6:58
Aaron Schaefer17-Dec-01 6:58 
GeneralSIngletons, Threading, and Marshalling Pin
Not Active15-Dec-01 3:55
mentorNot Active15-Dec-01 3:55 
GeneralRe: SIngletons, Threading, and Marshalling Pin
Ernest Laurentin15-Dec-01 6:12
Ernest Laurentin15-Dec-01 6:12 
GeneralRe: SIngletons, Threading, and Marshalling Pin
Not Active15-Dec-01 9:30
mentorNot Active15-Dec-01 9:30 
GeneralCOM & Duel Processors Pin
Ancient Dragon13-Dec-01 13:06
Ancient Dragon13-Dec-01 13:06 
GeneralRe: COM & Duel Processors Pin
Ganesh Ramaswamy19-Dec-01 5:24
Ganesh Ramaswamy19-Dec-01 5:24 
GeneralCoInitializeEx ( ) Pin
Tim Rymer13-Dec-01 4:12
Tim Rymer13-Dec-01 4:12 
GeneralRe: CoInitializeEx ( ) Pin
Michael P Butler13-Dec-01 5:11
Michael P Butler13-Dec-01 5:11 
GeneralRe: CoInitializeEx ( ) Pin
Ernest Laurentin13-Dec-01 5:38
Ernest Laurentin13-Dec-01 5:38 
GeneralRe: CoInitializeEx ( ) Pin
Tim Rymer13-Dec-01 10:08
Tim Rymer13-Dec-01 10:08 
GeneralRe: CoInitializeEx ( ) Pin
Tim Rymer13-Dec-01 10:33
Tim Rymer13-Dec-01 10:33 
GeneralRe: CoInitializeEx ( ) Pin
Ernest Laurentin13-Dec-01 11:26
Ernest Laurentin13-Dec-01 11:26 
GeneralRe: CoInitializeEx ( ) Pin
Tim Rymer14-Dec-01 6:45
Tim Rymer14-Dec-01 6:45 
GeneralRe: CoInitializeEx ( ) Pin
Ernest Laurentin14-Dec-01 11:00
Ernest Laurentin14-Dec-01 11:00 
GeneralRe: CoInitializeEx ( ) Pin
Tim Rymer17-Dec-01 5:59
Tim Rymer17-Dec-01 5:59 
GeneralRe: CoInitializeEx ( ) Pin
Ernest Laurentin17-Dec-01 6:50
Ernest Laurentin17-Dec-01 6:50 
GeneralRe: CoInitializeEx ( ) Pin
Ernest Laurentin17-Dec-01 10:31
Ernest Laurentin17-Dec-01 10:31 

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.