Click here to Skip to main content
15,912,400 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Printing bitmaps from a frame grabber Pin
Hamid_RT12-Oct-06 19:54
Hamid_RT12-Oct-06 19:54 
AnswerRe: Printing bitmaps from a frame grabber Pin
Steve S12-Oct-06 21:40
Steve S12-Oct-06 21:40 
QuestionRe: Printing bitmaps from a frame grabber Pin
Bob Hickey14-Oct-06 16:00
Bob Hickey14-Oct-06 16:00 
QuestionDialog 'hang' after C procedure called. Pin
searcher0812-Oct-06 15:56
searcher0812-Oct-06 15:56 
AnswerRe: Dialog 'hang' after C procedure called. Pin
Christian Graus12-Oct-06 15:58
protectorChristian Graus12-Oct-06 15:58 
GeneralRe: Dialog 'hang' after C procedure called. Pin
XuShanghua12-Oct-06 17:07
XuShanghua12-Oct-06 17:07 
GeneralRe: Dialog 'hang' after C procedure called. Pin
Hamid_RT12-Oct-06 19:51
Hamid_RT12-Oct-06 19:51 
GeneralRe: Dialog 'hang' after C procedure called. Pin
searcher0813-Oct-06 7:43
searcher0813-Oct-06 7:43 
I have not done multi-threading before but looking at the reference books and online tutorial, they are all related to classes or objects. I am only calling a C procedure with a parameter in it.

The function needs to be in this form. Do I have to convert my C-procedure to this format? Mine is of the format void decode(char *).

UINT MyThreadProc( LPVOID pParam ) // taken from MSDN
{
CMyObject* pObject = (CMyObject*)pParam;

if (pObject == NULL ||
!pObject->IsKindOf(RUNTIME_CLASS(CMyObject)))
return 1; // if pObject is not valid

// do something with 'pObject'

return 0; // thread completed successfully
}


Next will be to begin the thread:
pNewObject = new CMyObject;
AfxBeginThread(MyThreadProc, pNewObject);

Where do I put my C-procedure in the above code?
How do I know that the thread has ended?

Thank you.

searcher08
GeneralRe: Dialog 'hang' after C procedure called. Pin
Christian Graus13-Oct-06 8:03
protectorChristian Graus13-Oct-06 8:03 
AnswerRe: Dialog 'hang' after C procedure called. Pin
Don Fletcher12-Oct-06 21:22
Don Fletcher12-Oct-06 21:22 
GeneralRe: Dialog 'hang' after C procedure called. Pin
searcher0813-Oct-06 10:04
searcher0813-Oct-06 10:04 
Questionapi hooking Pin
DannSmith12-Oct-06 13:05
DannSmith12-Oct-06 13:05 
AnswerRe: api hooking Pin
Hamid_RT12-Oct-06 20:02
Hamid_RT12-Oct-06 20:02 
QuestionAppend data in middle of binary file Pin
samkook12-Oct-06 11:02
samkook12-Oct-06 11:02 
AnswerRe: Append data in middle of binary file Pin
PJ Arends12-Oct-06 11:32
professionalPJ Arends12-Oct-06 11:32 
GeneralRe: Append data in middle of binary file Pin
samkook12-Oct-06 11:51
samkook12-Oct-06 11:51 
GeneralRe: Append data in middle of binary file Pin
Christian Graus12-Oct-06 13:03
protectorChristian Graus12-Oct-06 13:03 
GeneralRe: Append data in middle of binary file Pin
samkook12-Oct-06 13:31
samkook12-Oct-06 13:31 
GeneralRe: Append data in middle of binary file Pin
Christian Graus12-Oct-06 14:10
protectorChristian Graus12-Oct-06 14:10 
GeneralRe: Append data in middle of binary file Pin
samkook12-Oct-06 15:00
samkook12-Oct-06 15:00 
GeneralRe: Append data in middle of binary file Pin
Christian Graus12-Oct-06 15:16
protectorChristian Graus12-Oct-06 15:16 
GeneralRe: Append data in middle of binary file Pin
samkook12-Oct-06 16:06
samkook12-Oct-06 16:06 
GeneralRe: Append data in middle of binary file Pin
Christian Graus12-Oct-06 16:13
protectorChristian Graus12-Oct-06 16:13 
GeneralRe: Append data in middle of binary file Pin
samkook12-Oct-06 16:19
samkook12-Oct-06 16:19 
GeneralRe: Append data in middle of binary file Pin
Christian Graus13-Oct-06 0:59
protectorChristian Graus13-Oct-06 0:59 

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.