Click here to Skip to main content
15,909,051 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Creating Stochastic models (Probability density functions) in Visual C++6.0 Pin
Christian Graus25-Oct-04 12:51
protectorChristian Graus25-Oct-04 12:51 
GeneralAccessing ActiveX in VC++ 1.52 Pin
Anonymous25-Oct-04 10:50
Anonymous25-Oct-04 10:50 
GeneralRe: Accessing ActiveX in VC++ 1.52 Pin
Ryan Binns25-Oct-04 18:01
Ryan Binns25-Oct-04 18:01 
QuestionInordinate Delaying in Form Display? Pin
NietzscheDisciple25-Oct-04 10:06
NietzscheDisciple25-Oct-04 10:06 
GeneralAnother threading question Pin
Tom Wright25-Oct-04 9:52
Tom Wright25-Oct-04 9:52 
GeneralRe: Another threading question Pin
David Crow25-Oct-04 10:36
David Crow25-Oct-04 10:36 
GeneralRe: Another threading question Pin
Blake Miller25-Oct-04 12:16
Blake Miller25-Oct-04 12:16 
GeneralRe: Another threading question Pin
dharani26-Oct-04 21:37
dharani26-Oct-04 21:37 
If you want to pass the variable during startup of the thread itself - you can do as below..Assume var is the varible ( it can be a structure also ) you have to pass to the thread function ..

ULONG __stdcall ThreadFunc(LPVOID pParam); //declare thread function
CreateThread(NULL, 0, ThreadFunc,(LPVOID)var, 0, NULL);

Now "var" is passed to the ThreadFunc . Inside the ThreadFunc you can retrive the void param back to the original type as below

ULONG __stdcall ClientThread(LPVOID pParam)
{
int param=(int)pParam; (or) int param=(int*)pParam ; or replace int with your variable's type...


return 1;
}

and If you want to pass the param when the thread is running you can always use PostThreadMessage() with the same way of LOVOID(pParam) ...


Dharani Babu S
GeneralCharNext Pin
Timothy Grabrian25-Oct-04 9:39
professionalTimothy Grabrian25-Oct-04 9:39 
GeneralRe: CharNext Pin
David Crow25-Oct-04 10:47
David Crow25-Oct-04 10:47 
GeneralRe: CharNext Pin
Timothy Grabrian25-Oct-04 10:54
professionalTimothy Grabrian25-Oct-04 10:54 
GeneralRe: CharNext Pin
David Crow26-Oct-04 2:34
David Crow26-Oct-04 2:34 
GeneralFinding COM Memory Leak in ISAPI Extension Pin
Turtle Hand25-Oct-04 9:36
Turtle Hand25-Oct-04 9:36 
GeneralRe: Finding COM Memory Leak in ISAPI Extension Pin
Chris Richardson25-Oct-04 11:21
Chris Richardson25-Oct-04 11:21 
GeneralDisplaying error message Pin
SXP25-Oct-04 8:39
SXP25-Oct-04 8:39 
GeneralRe: Displaying error message Pin
BlackDice25-Oct-04 8:51
BlackDice25-Oct-04 8:51 
GeneralRe: Displaying error message Pin
SXP25-Oct-04 8:57
SXP25-Oct-04 8:57 
GeneralRe: Displaying error message Pin
SXP25-Oct-04 9:10
SXP25-Oct-04 9:10 
GeneralRe: Displaying error message Pin
Blake Miller25-Oct-04 9:00
Blake Miller25-Oct-04 9:00 
GeneralRe: AfxMessageBox Pin
Budric B.25-Oct-04 9:01
Budric B.25-Oct-04 9:01 
GeneralLeft Button Drag-and-Drop Pin
Erick 'El Matador' Demers25-Oct-04 7:18
Erick 'El Matador' Demers25-Oct-04 7:18 
Generaltime critical Pin
LeeeNN25-Oct-04 6:55
LeeeNN25-Oct-04 6:55 
GeneralRe: time critical Pin
David Crow25-Oct-04 7:12
David Crow25-Oct-04 7:12 
GeneralRe: time critical Pin
Nemanja Trifunovic25-Oct-04 7:24
Nemanja Trifunovic25-Oct-04 7:24 
GeneralRe: time critical Pin
LeeeNN25-Oct-04 10:42
LeeeNN25-Oct-04 10:42 

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.