Click here to Skip to main content
15,914,221 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: int to CString Pin
kakan19-Sep-05 18:58
professionalkakan19-Sep-05 18:58 
QuestionDeviceIoControl() returns zero Pin
momer19-Sep-05 15:44
momer19-Sep-05 15:44 
QuestionMultithread Pin
benjnp19-Sep-05 14:02
benjnp19-Sep-05 14:02 
AnswerRe: Multithread Pin
User 58385219-Sep-05 14:23
User 58385219-Sep-05 14:23 
GeneralRe: Multithread Pin
benjnp19-Sep-05 14:34
benjnp19-Sep-05 14:34 
GeneralRe: Multithread Pin
User 58385219-Sep-05 14:38
User 58385219-Sep-05 14:38 
AnswerRe: Multithread Pin
benjnp19-Sep-05 14:41
benjnp19-Sep-05 14:41 
GeneralRe: Multithread Pin
Cedric Moonen19-Sep-05 20:12
Cedric Moonen19-Sep-05 20:12 
benjnp wrote:
works fine as long as I don't call the functions that are built on the same class

That's your problem ! You cannot use member functions of a class for that ? Why ? Simply because they have another calling convention than the "standard" functions: the this parameter is passed implicitely as parameter of the function.

A way to have it working: use a global function as callback (instead of DoTimer) and pass the pointer of the current class as parameter (instead of the 0). So like that in your function you will be able to do something like:

UINT MyGlobalFunc(LPVOID pParam)<br />
{<br />
    CMyClass* pObject = (CMyClass*)pParam;<br />
    pObject->DoTimer();      // Of course DoTimer must be public<br />
}


And to start your thread:

AfxBeginThread(MyGlobalFunc,this);

Hope this helps
AnswerRe: Multithread Pin
RichardS19-Sep-05 14:53
RichardS19-Sep-05 14:53 
GeneralRe: Multithread Pin
benjnp19-Sep-05 15:33
benjnp19-Sep-05 15:33 
GeneralRe: Multithread Pin
RichardS20-Sep-05 4:21
RichardS20-Sep-05 4:21 
AnswerRe: Multithread Pin
Tim Smith19-Sep-05 18:14
Tim Smith19-Sep-05 18:14 
AnswerRe: Multithread Pin
Jose Lamas Rios19-Sep-05 18:27
Jose Lamas Rios19-Sep-05 18:27 
GeneralRe: Multithread Pin
benjnp20-Sep-05 13:44
benjnp20-Sep-05 13:44 
AnswerRe: Multithread Pin
Roger Stoltz19-Sep-05 21:20
Roger Stoltz19-Sep-05 21:20 
AnswerRe: Multithread Pin
Rainer Schuster19-Sep-05 22:03
Rainer Schuster19-Sep-05 22:03 
GeneralRe: Multithread Pin
benjnp20-Sep-05 17:04
benjnp20-Sep-05 17:04 
AnswerRe: Multithread Pin
Eytukan19-Sep-05 22:45
Eytukan19-Sep-05 22:45 
QuestionCustom WM_NOTIFY NMHDR code Pin
ClickHeRe19-Sep-05 12:37
ClickHeRe19-Sep-05 12:37 
AnswerRe: Custom WM_NOTIFY NMHDR code Pin
nm_11419-Sep-05 20:49
nm_11419-Sep-05 20:49 
GeneralRe: Custom WM_NOTIFY NMHDR code Pin
ClickHeRe20-Sep-05 10:06
ClickHeRe20-Sep-05 10:06 
GeneralRe: Custom WM_NOTIFY NMHDR code Pin
nm_11420-Sep-05 16:39
nm_11420-Sep-05 16:39 
GeneralRe: Custom WM_NOTIFY NMHDR code Pin
ClickHeRe21-Sep-05 9:15
ClickHeRe21-Sep-05 9:15 
GeneralRe: Custom WM_NOTIFY NMHDR code Pin
nm_11421-Sep-05 10:58
nm_11421-Sep-05 10:58 
AnswerRe: Custom WM_NOTIFY NMHDR code Pin
FearTheDoubleShift9-Sep-09 7:13
FearTheDoubleShift9-Sep-09 7:13 

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.