Click here to Skip to main content
15,889,595 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CListBox Customize Pin
David Crow23-Sep-05 2:28
David Crow23-Sep-05 2:28 
GeneralRe: CListBox Customize Pin
fjlv200525-Sep-05 14:41
fjlv200525-Sep-05 14:41 
QuestionAbout image processing Pin
om_trupti21-Sep-05 21:47
om_trupti21-Sep-05 21:47 
AnswerRe: About image processing Pin
Alexander M.,22-Sep-05 3:23
Alexander M.,22-Sep-05 3:23 
QuestionCOM Single-Threaded Or Multi-Threaded Pin
yccheok21-Sep-05 21:13
yccheok21-Sep-05 21:13 
AnswerRe: COM Single-Threaded Or Multi-Threaded Pin
Calc2021-Sep-05 22:15
Calc2021-Sep-05 22:15 
GeneralRe: COM Single-Threaded Or Multi-Threaded Pin
yccheok22-Sep-05 15:36
yccheok22-Sep-05 15:36 
GeneralRe: COM Single-Threaded Or Multi-Threaded Pin
Calc2022-Sep-05 19:47
Calc2022-Sep-05 19:47 
Yes something like that, but in single threaded apartment model other threads have to call CoInitialize before using the control, not after.

In multi threaded apartment although it's not necessary for each thread to call CoInitialize, it's recommended to make that call, to avoid problems, like access violations.

If you access a COM interface from another apartment you'll get an exception, so when you are using single threaded apaprment model you have to marshall interfaces between threads. You do that by calling CoMarshalInterThreadInterfaceInStream() from the thread in which you called first CoInitialize(), and pass the IStream interface you get to the other thread, from which you want to access the object. In that thread call CoGetInterfaceAndReleaseStream() passing the IStream as argument and you'll get the interface.
The easiest way is to marshall the IDispatch interface, because after that you can call directly any methods you want.
GeneralRe: COM Single-Threaded Or Multi-Threaded Pin
yccheok22-Sep-05 23:06
yccheok22-Sep-05 23:06 
QuestionCreating Excel files in VC Pin
kk.tvm21-Sep-05 21:07
kk.tvm21-Sep-05 21:07 
AnswerRe: Creating Excel files in VC Pin
LOUIS Christian21-Sep-05 21:43
LOUIS Christian21-Sep-05 21:43 
AnswerRe: Creating Excel files in VC Pin
David Crow22-Sep-05 3:01
David Crow22-Sep-05 3:01 
QuestionChange font of tooltip of Toolbar ? Pin
ana_v12321-Sep-05 21:01
ana_v12321-Sep-05 21:01 
AnswerRe: Change font of tooltip of Toolbar ? Pin
douglasjordan26-Sep-05 10:18
douglasjordan26-Sep-05 10:18 
Questionhelp me with VC++ Pin
Member 226824821-Sep-05 20:59
Member 226824821-Sep-05 20:59 
AnswerRe: help me with VC++ Pin
kk.tvm21-Sep-05 21:15
kk.tvm21-Sep-05 21:15 
GeneralRe: help me with VC++ Pin
Member 226824821-Sep-05 22:08
Member 226824821-Sep-05 22:08 
NewsRe: help me with VC++ Pin
kk.tvm21-Sep-05 22:24
kk.tvm21-Sep-05 22:24 
GeneralRe: help me with VC++ Pin
*Dreamz22-Sep-05 0:25
*Dreamz22-Sep-05 0:25 
AnswerRe: help me with VC++ Pin
David Crow22-Sep-05 3:03
David Crow22-Sep-05 3:03 
GeneralRe: help me with VC++ Pin
Member 226824822-Sep-05 18:17
Member 226824822-Sep-05 18:17 
QuestionChange Font of Menu ? Pin
ana_v12321-Sep-05 20:58
ana_v12321-Sep-05 20:58 
AnswerRe: Change Font of Menu ? Pin
Steen Krogsgaard22-Sep-05 2:07
Steen Krogsgaard22-Sep-05 2:07 
QuestionStatic OnPaint question Pin
followait21-Sep-05 20:18
followait21-Sep-05 20:18 
AnswerRe: Static OnPaint question Pin
Mircea Puiu21-Sep-05 20:25
Mircea Puiu21-Sep-05 20:25 

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.