Click here to Skip to main content
15,918,967 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: How to remove type library informationn from atl dll? Pin
Lim Bio Liong4-Nov-09 16:46
Lim Bio Liong4-Nov-09 16:46 
GeneralRe: How to remove type library informationn from atl dll? Pin
kcynic4-Nov-09 16:53
kcynic4-Nov-09 16:53 
GeneralRe: How to remove type library informationn from atl dll? Pin
Lim Bio Liong4-Nov-09 17:04
Lim Bio Liong4-Nov-09 17:04 
GeneralRe: How to remove type library informationn from atl dll? Pin
kcynic4-Nov-09 17:12
kcynic4-Nov-09 17:12 
GeneralRe: How to remove type library informationn from atl dll? Pin
Lim Bio Liong4-Nov-09 17:26
Lim Bio Liong4-Nov-09 17:26 
GeneralRe: How to remove type library informationn from atl dll? Pin
kcynic4-Nov-09 18:38
kcynic4-Nov-09 18:38 
GeneralRe: How to remove type library informationn from atl dll? Pin
kcynic2-Dec-09 19:08
kcynic2-Dec-09 19:08 
GeneralRe: How to remove type library informationn from atl dll? Pin
Lim Bio Liong2-Dec-09 23:24
Lim Bio Liong2-Dec-09 23:24 
GeneralRe: How to remove type library informationn from atl dll? Pin
kcynic3-Dec-09 2:19
kcynic3-Dec-09 2:19 
News[Message Deleted] Pin
Ahmed Charfeddine4-Nov-09 2:07
Ahmed Charfeddine4-Nov-09 2:07 
AnswerRe: How do you profile your C++ code ? Pin
Richard MacCutchan4-Nov-09 3:11
mveRichard MacCutchan4-Nov-09 3:11 
AnswerRe: How do you profile your C++ code ? Pin
Ahmed Charfeddine4-Nov-09 3:19
Ahmed Charfeddine4-Nov-09 3:19 
GeneralRe: How do you profile your C++ code ? Pin
Richard MacCutchan4-Nov-09 4:55
mveRichard MacCutchan4-Nov-09 4:55 
GeneralRe: How do you profile your C++ code ? Pin
Ahmed Charfeddine4-Nov-09 5:06
Ahmed Charfeddine4-Nov-09 5:06 
QuestionBitmap image in static control is flicker Pin
am 20093-Nov-09 22:15
am 20093-Nov-09 22:15 
Questionstd::copy question [modified] Pin
followait3-Nov-09 14:33
followait3-Nov-09 14:33 
AnswerRe: std::copy question Pin
Stuart Dootson3-Nov-09 23:40
professionalStuart Dootson3-Nov-09 23:40 
GeneralRe: std::copy question Pin
followait4-Nov-09 3:17
followait4-Nov-09 3:17 
QuestionHow to use WTL8 Wizard in VC6.0 ? Pin
wangningyu1-Nov-09 4:11
wangningyu1-Nov-09 4:11 
AnswerRe: How to use WTL8 Wizard in VC6.0 ? Pin
Stuart Dootson2-Nov-09 21:23
professionalStuart Dootson2-Nov-09 21:23 
GeneralRe: How to use WTL8 Wizard in VC6.0 ? Pin
wangningyu3-Nov-09 3:42
wangningyu3-Nov-09 3:42 
QuestionFiring a COM Event From Another Thread Pin
Rob Caldecott29-Oct-09 10:50
Rob Caldecott29-Oct-09 10:50 
AnswerRe: Firing a COM Event From Another Thread Pin
Lim Bio Liong1-Nov-09 23:53
Lim Bio Liong1-Nov-09 23:53 
AnswerRe: Firing a COM Event From Another Thread Pin
Roger Stoltz2-Nov-09 5:43
Roger Stoltz2-Nov-09 5:43 
As Lim Bio Liong already said, the problem is that the source interface, i.e. the interface that is called from your secondary thread, is not properly marshalled when crossing apartment boundaries.

Like you suggested yourself, you can post a message to the main thread and call the source interface from there.
But there are two other common ways when firing COM events from other threads:
1. Using ::CoMarshalInterThreadInterfaceInStream()[^] and ::CoGetInterfaceAndReleaseStream()
2. Using the Global Interface Table (GIT)

When the interface to be marshalled is a source interface, alternative #1 is useful if you know that all calls will be made from the thread that you've marshalled the interface into.
Alternative #2 is useful when you will be able to call the interface from any thread, or don't know what thread will make the call. But the downside is that it requires a little overhead compared to alternative #1 since you need to "get" the interface for every call.

Michael Lindig has written a very nice ATL solution that I've used for years which uses the GIT.
You'll find it here[^].


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


AnswerRe: Firing a COM Event From Another Thread Pin
Lim Bio Liong2-Nov-09 18:50
Lim Bio Liong2-Nov-09 18:50 

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.