Click here to Skip to main content
15,917,793 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VisualStudio: Copy/Paste a rectangular window Pin
*Dreamz22-Sep-05 19:15
*Dreamz22-Sep-05 19:15 
QuestionMODBUS/TCP communication Pin
Member 216100421-Sep-05 23:52
Member 216100421-Sep-05 23:52 
AnswerRe: MODBUS/TCP communication Pin
Rick York22-Sep-05 10:07
mveRick York22-Sep-05 10:07 
Questionhow to create a DLL Pin
Smith#21-Sep-05 22:36
Smith#21-Sep-05 22:36 
AnswerRe: how to create a DLL Pin
Nilesh K.21-Sep-05 23:14
Nilesh K.21-Sep-05 23:14 
AnswerRe: how to create a DLL Pin
douglasjordan26-Sep-05 14:38
douglasjordan26-Sep-05 14:38 
QuestionCListBox Customize Pin
fjlv200521-Sep-05 22:01
fjlv200521-Sep-05 22:01 
AnswerRe: CListBox Customize Pin
David Crow22-Sep-05 3:00
David Crow22-Sep-05 3:00 
GeneralRe: CListBox Customize Pin
fjlv200522-Sep-05 15:18
fjlv200522-Sep-05 15:18 
GeneralRe: CListBox Customize Pin
fjlv200522-Sep-05 15:55
fjlv200522-Sep-05 15:55 
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 

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.