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

C / C++ / MFC

 
AnswerRe: ToolTip Pin
Hamid_RT17-Oct-06 1:08
Hamid_RT17-Oct-06 1:08 
AnswerRe: ToolTip Pin
toxcct17-Oct-06 1:34
toxcct17-Oct-06 1:34 
QuestionOne Question ?.. Pin
Sakthiu17-Oct-06 0:56
Sakthiu17-Oct-06 0:56 
QuestionRe: One Question ?.. Pin
David Crow17-Oct-06 3:04
David Crow17-Oct-06 3:04 
AnswerRe: One Question ?.. Pin
Sakthiu17-Oct-06 3:50
Sakthiu17-Oct-06 3:50 
QuestionRe: One Question ?.. Pin
David Crow17-Oct-06 4:04
David Crow17-Oct-06 4:04 
QuestionWhy I can't beging thread from myclass constructor? Pin
NoName II17-Oct-06 0:45
NoName II17-Oct-06 0:45 
AnswerRe: Why I can't beging thread from myclass constructor? Pin
Cedric Moonen17-Oct-06 1:05
Cedric Moonen17-Oct-06 1:05 
It has nothing to do with the fact that you start it in your constructor. The problem is that the 3rd argument you pass to beginthreadex is invalid: the function expects to have a pointer to a global function and you pass a pointer to a member function. The difference is that they don't have the same prototype: the member function has an implicit parameter: the this parameter (that allows the function to know to which instance of the class it belongs to).
To solve the problem, you can declare the function as static (in that case, the this parameter is not passed). But of course, you won't be able to access members of the class which are non-static (because the function is global to all instances and thus doesn't belong to a specific instance).
Another solution is to pass the pointer to a global function and pass the pointer to the instance of your class as the parameter (this). In the function, you'll then need to cast it to your class:
unsigned __stdcall MyGlobalFunct(void* param)
{
CMyClass* pClass = (CMyClass*)param;
pClass->MyMemFunction();
return 0;

} 



Cédric Moonen
Software developer

Charting control [Updated - v1.1]

GeneralRe: Why I can't beging thread from myclass constructor? Pin
NoName II17-Oct-06 2:16
NoName II17-Oct-06 2:16 
AnswerRe: Why I can't beging thread from myclass constructor? Pin
Hamid_RT17-Oct-06 1:07
Hamid_RT17-Oct-06 1:07 
QuestionBlob in ADO Pin
RockyJames17-Oct-06 0:33
RockyJames17-Oct-06 0:33 
AnswerRe: Blob in ADO Pin
David Crow17-Oct-06 3:06
David Crow17-Oct-06 3:06 
QuestionPoint of Intersection Pin
RamL17-Oct-06 0:32
RamL17-Oct-06 0:32 
AnswerRe: Point of Intersection Pin
CaesarCZ17-Oct-06 1:15
CaesarCZ17-Oct-06 1:15 
QuestionWhat is a Map file? Why we have to use a Map File? Pin
CodeVarma17-Oct-06 0:32
CodeVarma17-Oct-06 0:32 
AnswerRe: What is a Map file? Why we have to use a Map File? Pin
Nitron17-Oct-06 1:26
Nitron17-Oct-06 1:26 
AnswerRe: What is a Map file? Why we have to use a Map File? Pin
ThatsAlok18-Oct-06 4:56
ThatsAlok18-Oct-06 4:56 
Questionunicode fonts Pin
CaesarCZ16-Oct-06 23:56
CaesarCZ16-Oct-06 23:56 
AnswerRe: unicode fonts Pin
Mark Salsbery17-Oct-06 7:02
Mark Salsbery17-Oct-06 7:02 
QuestionACCESSING CONTROLS OF ONE DIALOG BOX IN OTHER DIALOG BOX Pin
zareee16-Oct-06 23:38
zareee16-Oct-06 23:38 
AnswerRe: ACCESSING CONTROLS OF ONE DIALOG BOX IN OTHER DIALOG BOX Pin
Joan M16-Oct-06 23:56
professionalJoan M16-Oct-06 23:56 
AnswerRe: ACCESSING CONTROLS OF ONE DIALOG BOX IN OTHER DIALOG BOX Pin
Hamid_RT17-Oct-06 0:27
Hamid_RT17-Oct-06 0:27 
AnswerRe: ACCESSING CONTROLS OF ONE DIALOG BOX IN OTHER DIALOG BOX Pin
David Crow17-Oct-06 3:10
David Crow17-Oct-06 3:10 
AnswerRe: ACCESSING CONTROLS OF ONE DIALOG BOX IN OTHER DIALOG BOX Pin
ThatsAlok18-Oct-06 4:55
ThatsAlok18-Oct-06 4:55 
QuestionDestructors not invoked -> Memory leaks Pin
Nyarlatotep16-Oct-06 23:32
Nyarlatotep16-Oct-06 23:32 

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.