Click here to Skip to main content
15,899,314 members
Home / Discussions / COM
   

COM

 
GeneralRe: _variant_t Question Pin
prasad_som10-Dec-06 21:29
prasad_som10-Dec-06 21:29 
GeneralRe: _variant_t Question Pin
Gupta Suraj11-Dec-06 18:28
Gupta Suraj11-Dec-06 18:28 
AnswerRe: _variant_t Question Pin
prasad_som11-Dec-06 19:22
prasad_som11-Dec-06 19:22 
GeneralRe: _variant_t Question Pin
Gupta Suraj11-Dec-06 19:36
Gupta Suraj11-Dec-06 19:36 
GeneralRe: _variant_t Question Pin
prasad_som11-Dec-06 19:51
prasad_som11-Dec-06 19:51 
QuestionAutomation, cross thread problem Pin
anderslundsgard6-Dec-06 21:36
anderslundsgard6-Dec-06 21:36 
AnswerRe: Automation, cross thread problem Pin
«_Superman_»6-Dec-06 22:50
professional«_Superman_»6-Dec-06 22:50 
AnswerRe: Automation, cross thread problem Pin
Roger Stoltz6-Dec-06 22:50
Roger Stoltz6-Dec-06 22:50 
Interfaces that cross apartment boundaries has to be marshaled.
No surprises here, it's according to the COM spec.

When you spawn a thread that should use COM stuff, you create another apartment and you have to initalize COM for that apartment with a call to ::CoInitalize() or ::CoInitializeEx(). If you want to use a COM interface that you got in another thread you have to marshal that interface to the new apartment.
There are several ways of doing this, but I think in your case the easiest way would be to use ::CoMarshalInterThreadInterfaceInStream() and ::CoGetInterfaceAndReleaseStream().
Have a look at MSDN here[^].

--
Roger


"It's supposed to be hard, otherwise anybody could do it!" - selfquote

"No one remembers a coward!" - Jan Elfström 1998
"...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

AnswerRe: Automation, cross thread problem Pin
lafleon7-Dec-06 10:25
lafleon7-Dec-06 10:25 
GeneralRe: Automation, cross thread problem Pin
anderslundsgard7-Dec-06 2:40
anderslundsgard7-Dec-06 2:40 
GeneralRe: Automation, cross thread problem Pin
Roger Stoltz7-Dec-06 3:22
Roger Stoltz7-Dec-06 3:22 
GeneralRe: Automation, cross thread problem Pin
anderslundsgard7-Dec-06 4:01
anderslundsgard7-Dec-06 4:01 
GeneralRe: Automation, cross thread problem Pin
Roger Stoltz7-Dec-06 4:50
Roger Stoltz7-Dec-06 4:50 
QuestionCocreateInstance fails Pin
Shailesh Ha5-Dec-06 19:04
Shailesh Ha5-Dec-06 19:04 
AnswerRe: CocreateInstance fails Pin
prasad_som5-Dec-06 20:22
prasad_som5-Dec-06 20:22 
GeneralRe: CocreateInstance fails Pin
Shailesh Ha5-Dec-06 21:55
Shailesh Ha5-Dec-06 21:55 
GeneralRe: CocreateInstance fails Pin
prasad_som5-Dec-06 22:15
prasad_som5-Dec-06 22:15 
GeneralRe: CocreateInstance fails Pin
Shailesh Ha5-Dec-06 22:31
Shailesh Ha5-Dec-06 22:31 
AnswerRe: CocreateInstance fails Pin
prasad_som5-Dec-06 22:40
prasad_som5-Dec-06 22:40 
AnswerRe: CocreateInstance fails Pin
Stephen Hewitt5-Dec-06 20:27
Stephen Hewitt5-Dec-06 20:27 
GeneralRe: CocreateInstance fails Pin
Shailesh Ha5-Dec-06 23:17
Shailesh Ha5-Dec-06 23:17 
GeneralRe: CocreateInstance fails Pin
Stephen Hewitt6-Dec-06 12:03
Stephen Hewitt6-Dec-06 12:03 
GeneralRe: CocreateInstance fails Pin
prasad_som6-Dec-06 18:10
prasad_som6-Dec-06 18:10 
Questionshell programming Pin
sanwalz5-Dec-06 8:57
sanwalz5-Dec-06 8:57 
AnswerRe: shell programming Pin
prasad_som5-Dec-06 17:38
prasad_som5-Dec-06 17:38 

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.