473,386 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Threads & dlls

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

Nov 16 '05 #1
2 1908
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.
--
Visit us on the web at: http://www.databasementsoftware.com
Nov 16 '05 #2
Hello Erin,
Thanks a lot for the help.
Dennis
-----Original Message-----
Dennis,

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

Regards,
Erin.
--
Visit us on the web at: http://www.databasementsoftware.com

.

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: normd | last post by:
I have a text file which contains VB.NET code. The VB.NET code is actually a Class that can contain code, which simply displays a message box or does something more complicated (i.e Excel/Word...
12
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
2
by: db_From_mn | last post by:
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...
2
by: Hollywood | last post by:
I have a system in which I have a single thread that places data on a Queue. Then I have one worker thread that waits until data is put on the thread and dequeues the Queue and processes that...
5
by: MJB | last post by:
I have several dlls that have app.config files tied to them. When adding their primary output to a Setup project everything works fine, but only the app.config for the .exe gets added to the Setup...
4
by: Al Norman | last post by:
We have two separate DLLs that do not interact (directly, at least). One is an MFC extension DLL that was built back in VC++ 6 days (but has been recompiled with VS2005). The other is a DLL that...
2
by: Marco | last post by:
Hi Is there a way to find out if a thread holds a handle to a loaded module? In detail: I have all IDs and handles of all running threads and loaded modules(dlls) of a process. No i want to...
0
by: dogberry | last post by:
Hello, I am releasing a C++ library as a set of DLLs, built under VC++ 7.1. These are built using the /MD linking option, i.e., Multi-threaded DLL. It is my understanding that I then need to...
1
by: Olivier Matrot | last post by:
I have a problem with an ASP.NET 2.0 Application. A client request is processed in parrallel by two threads. After further analysis, it appears that : - There is 2 disctinct session for the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.