> I am writing an application that requires me to load a (Win32 C)
> libray and then register several call back functions.
[quoted text clipped - 6 lines]
> 1). Does loadlibrary(0 run the executable in the same thread as the
> calee (probably not)
LoadLibrary doesn't "run the executable" when loading a DLL, except for the
DllMain function. That IS run in the context of the thread that called
LoadLibrary. Subsequent calls to fuinctions in the DLL will occur in
whatever thread(s) make the call(s) - there's no hidden thread switch back
to the thread that loaded the DLL or anything like that (in contrast with,
for example, calling into a STA-threaded COM object, where such a thread
switch does indeed occur).
> 2). Is it safe to register/call callback funcs accross threads
> (assuming functions are written so as note to alter state of calee)
As long as the callback registration mechanism is thread safe, then yes.
-cd
Bit byte - 03 Apr 2006 08:43 GMT
>>I am writing an application that requires me to load a (Win32 C)
>>libray and then register several call back functions.
[quoted text clipped - 21 lines]
>
> -cd
Thanks for the clarification