Click here to Skip to main content
15,914,365 members
Home / Discussions / COM
   

COM

 
AnswerRe: unregistering COM Pin
Steve S29-Aug-06 5:12
Steve S29-Aug-06 5:12 
QuestionPassing an Array of BSTR Pin
HakunaMatada28-Aug-06 20:51
HakunaMatada28-Aug-06 20:51 
AnswerRe: Passing an Array of BSTR Pin
Steve S29-Aug-06 2:39
Steve S29-Aug-06 2:39 
Questionnew vs CoCreateInstance Pin
_AnsHUMAN_ 28-Aug-06 0:10
_AnsHUMAN_ 28-Aug-06 0:10 
AnswerRe: new vs CoCreateInstance Pin
Steve S29-Aug-06 5:18
Steve S29-Aug-06 5:18 
Questionautomatic call Pin
_tasleem27-Aug-06 22:04
_tasleem27-Aug-06 22:04 
AnswerRe: automatic call Pin
prasad_som27-Aug-06 23:19
prasad_som27-Aug-06 23:19 
QuestionThread in COM DLL Pin
rockryan27-Aug-06 3:03
rockryan27-Aug-06 3:03 
Hello,

I am implementing a Shell extension and it create a virtual folder to map to d:\\temp,
I create a thread use ReadDirectoryChange to watch d:\\temp have any write action,
the thread is in COM dll shell extension's EnumObject function(the create's place maybe not the root cause),
and want when user close the explorer, I'll tell the thread to exit(means no more need to watch any write action in virtual folder).
Right now the only place I can thourht is when call DllMain's process_detach,

I have following scenario,

1. when I use SetEvent(hStopEvent) to set a global event in DllMain's process_detach tell thread to stop, the thread's waitforsingleobject(hStopEvent, Infinite) to wait the global event didn't wait the event signal, it still block in waitforsingleobject(hStopEvent, Infinite),
But when I move the SetEvent(hStopEvent) to other place, not in Dllmain's process_detach, it works fine, the thread will wait htat event succes anf exit himself.

2. I can't solve the question one, Because the only place I know can stop thread is DllMain's process_detach, so I decide set a global boolean bStopThread, the thread will keep check that boolean to decide stop thread or not, and set bStopThread to TRUE in DLLMAIN's process_detach,
But after I set the bollean to TRUE, it seems thread didn't run to check bollean point, then the DLL is exit, so I don't know thread is end or not, I thought it didn't end, because I use debug mode to trace, thread didn't run to check bollean point, but the DLL already exit.

Question is,
1. In scenario two, the thread is end or not? it seems thread didn't end? but I can delete that dll afte dll exit, so it means the thread have already end?

2. how to slove Scenario one, to let thread can wait a global event and set event in DLLmains process_detach?

Thanks for your help~!!
AnswerRe: Thread in COM DLL Pin
rockryan27-Aug-06 14:22
rockryan27-Aug-06 14:22 
QuestionIHTMLDocument2 get_applets Pin
nemo26-Aug-06 13:45
nemo26-Aug-06 13:45 
Question"Unadvising" Event sink in VB6 Pin
Ilia Blank25-Aug-06 7:45
Ilia Blank25-Aug-06 7:45 
GeneralRe: "Unadvising" Event sink in VB6 Pin
Guffa25-Aug-06 8:53
Guffa25-Aug-06 8:53 
QuestionDeriving multiple interfaces from base interface (aggregation) Pin
Andre xxxxxxx24-Aug-06 4:38
Andre xxxxxxx24-Aug-06 4:38 
AnswerRe: Deriving multiple interfaces from base interface (aggregation) Pin
Stephen Hewitt24-Aug-06 17:44
Stephen Hewitt24-Aug-06 17:44 
GeneralRe: Deriving multiple interfaces from base interface (aggregation) Pin
Andre xxxxxxx25-Aug-06 3:48
Andre xxxxxxx25-Aug-06 3:48 
GeneralRe: Deriving multiple interfaces from base interface (aggregation) Pin
Stephen Hewitt26-Aug-06 2:43
Stephen Hewitt26-Aug-06 2:43 
QuestionCalling a ATL COM DLL interface from VBScript routine Pin
AKSIVAKUMAR23-Aug-06 23:21
AKSIVAKUMAR23-Aug-06 23:21 
AnswerRe: Calling a ATL COM DLL interface from VBScript routine Pin
Andre xxxxxxx24-Aug-06 12:11
Andre xxxxxxx24-Aug-06 12:11 
GeneralRe: Calling a ATL COM DLL interface from VBScript routine Pin
AKSIVAKUMAR25-Aug-06 7:51
AKSIVAKUMAR25-Aug-06 7:51 
QuestionBest practice for strings Pin
Andre xxxxxxx23-Aug-06 9:47
Andre xxxxxxx23-Aug-06 9:47 
AnswerRe: Best practice for strings Pin
Mike Dimmick23-Aug-06 10:25
Mike Dimmick23-Aug-06 10:25 
GeneralRe: Best practice for strings Pin
Andre xxxxxxx23-Aug-06 11:02
Andre xxxxxxx23-Aug-06 11:02 
GeneralRe: Best practice for strings Pin
Mike Dimmick23-Aug-06 13:49
Mike Dimmick23-Aug-06 13:49 
QuestionEthernet Programming Pin
Muhammad Azeem Azam22-Aug-06 23:01
Muhammad Azeem Azam22-Aug-06 23:01 
AnswerRe: Ethernet Programming Pin
Mike Dimmick23-Aug-06 0:22
Mike Dimmick23-Aug-06 0:22 

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.