Threads & dlls

  • Thread starter Thread starter db_From_mn
  • Start date Start date
D

db_From_mn

My C# application interfaces with a dll (which I create)
in un-managed code. This dll is an API to a USB-device.
I'd like to create a thread in the dll to manage the
device. I've tried this, but can't get the thread
function to run. The CreateThread function seem to work
ok, but the function never executes.
Is there any reason that a thread can't be created and
started from a dll?
Thanks in advance,
Dennis
 
Dennis,

I've done multithreading many times in DLLs. Other than being a tad bit
trickier it should work. I wouldn't think your C# app would have anything to
do with the DLL as they are separate. To rule it out I would suggest you
create a simple VC++ console app to do the same thing with the DLL that you
do from your C# app. If your thread runs there than something could be going
on with your managed app- but my guess is you'll find that the thread
doesn't work as expected there either, which would point to the issue being
your code in the DLL regarding the thread.

Regards,
Erin.
 
Back
Top