Click here to Skip to main content
15,888,286 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to get the current system name Pin
Michael Dunn3-Feb-05 12:20
sitebuilderMichael Dunn3-Feb-05 12:20 
GeneralMultithread problem with DLL Pin
djavanci3-Feb-05 9:09
djavanci3-Feb-05 9:09 
GeneralRe: Multithread problem with DLL Pin
geo_m3-Feb-05 9:51
geo_m3-Feb-05 9:51 
GeneralRe: Multithread problem with DLL Pin
Rick York3-Feb-05 11:51
mveRick York3-Feb-05 11:51 
GeneralRe: Multithread problem with DLL Pin
geo_m3-Feb-05 19:21
geo_m3-Feb-05 19:21 
GeneralRe: Multithread problem with DLL Pin
djavanci4-Feb-05 0:25
djavanci4-Feb-05 0:25 
GeneralRe: Multithread problem with DLL Pin
geo_m4-Feb-05 4:13
geo_m4-Feb-05 4:13 
GeneralRe: Multithread problem with DLL Pin
Christopher Lloyd3-Feb-05 12:10
Christopher Lloyd3-Feb-05 12:10 
It sounds to me like your problem is with global variables in the DLL - i.e. there's only one variable X but when you run two threads they'll both be able to change it. Same thing applies to any static variables in functions.

If this is the problem then it implies that the DLL's author wasn't expecting the DLL to be run in different threads in which case it assumedly wasn't linked with the Multithreaded runtime libraries which will create a different set of issues.

A solution is not too easy. You could:
1. Use thread local storage (see "Using Thread Local Storage in a Dynamic-Link Library" in the SDK documentation) to sort out the variables (or use __declspec(thread) which might be easier). However, you will need to understand which variables should and which shouldn't be accessable to all threads.
2. Re-build using the mutli-threaded libraries.

However, You might still have issues with any resources the DLL uses (such as intentionally shared variables). To sort this out you'd need to use some type of synchronisation object such as a mutex (or create a critical section) to control multi-threaded access. There's lots of stuff about this in the SDK.

Depending what the DLLs actually does, it might be easier to rewite it yourself or look for an alternative.
GeneralRe: Multithread problem with DLL Pin
djavanci4-Feb-05 1:02
djavanci4-Feb-05 1:02 
GeneralRe: Multithread problem with DLL Pin
Christopher Lloyd4-Feb-05 2:51
Christopher Lloyd4-Feb-05 2:51 
Generalcreating dynamic menus in dialog based apllications Pin
ganapathykumar3-Feb-05 9:07
ganapathykumar3-Feb-05 9:07 
GeneralRe: creating dynamic menus in dialog based apllications Pin
Ravi Bhavnani3-Feb-05 9:16
professionalRavi Bhavnani3-Feb-05 9:16 
GeneralRe: creating dynamic menus in dialog based apllications Pin
ganapathykumar3-Feb-05 9:23
ganapathykumar3-Feb-05 9:23 
GeneralRe: creating dynamic menus in dialog based apllications Pin
Ravi Bhavnani3-Feb-05 9:28
professionalRavi Bhavnani3-Feb-05 9:28 
GeneralRe: creating dynamic menus in dialog based apllications Pin
uday__m3-Feb-05 17:23
uday__m3-Feb-05 17:23 
QuestionHow to access the Methods from a DLL Pin
ganapathykumar3-Feb-05 9:01
ganapathykumar3-Feb-05 9:01 
AnswerRe: How to access the Methods from a DLL Pin
geo_m3-Feb-05 9:53
geo_m3-Feb-05 9:53 
GeneralRe: How to access the Methods from a DLL Pin
ganapathykumar3-Feb-05 9:59
ganapathykumar3-Feb-05 9:59 
GeneralRe: How to access the Methods from a DLL Pin
geo_m3-Feb-05 19:15
geo_m3-Feb-05 19:15 
GeneralRe: How to access the Methods from a DLL Pin
RChin3-Feb-05 23:39
RChin3-Feb-05 23:39 
GeneralGetting text from a Listbox Pin
Anonymous3-Feb-05 8:50
Anonymous3-Feb-05 8:50 
GeneralRe: Getting text from a Listbox Pin
Ravi Bhavnani3-Feb-05 9:14
professionalRavi Bhavnani3-Feb-05 9:14 
GeneralRe: Getting text from a Listbox Pin
Neville Franks3-Feb-05 9:24
Neville Franks3-Feb-05 9:24 
GeneralRe: Getting text from a Listbox Pin
toxcct3-Feb-05 17:18
toxcct3-Feb-05 17:18 
GeneralActiveX on Dialog, and keyboard handling Pin
peterchen3-Feb-05 8:23
peterchen3-Feb-05 8:23 

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.