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

C / C++ / MFC

 
AnswerRe: How to distribute MFC VC++ programs? Pin
ddmcr29-Nov-05 22:15
ddmcr29-Nov-05 22:15 
AnswerRe: How to distribute MFC VC++ programs? [edited] Pin
toxcct29-Nov-05 22:55
toxcct29-Nov-05 22:55 
QuestionThreads? Pin
Lord Kixdemp29-Nov-05 13:35
Lord Kixdemp29-Nov-05 13:35 
AnswerRe: Threads? Pin
Alex_Y29-Nov-05 13:58
Alex_Y29-Nov-05 13:58 
GeneralRe: Threads? Pin
Lord Kixdemp29-Nov-05 14:47
Lord Kixdemp29-Nov-05 14:47 
GeneralRe: Threads? Pin
zghelp29-Nov-05 16:45
zghelp29-Nov-05 16:45 
GeneralRe: Threads? Pin
Lord Kixdemp29-Nov-05 17:21
Lord Kixdemp29-Nov-05 17:21 
GeneralRe: Threads? Pin
Cedric Moonen29-Nov-05 21:01
Cedric Moonen29-Nov-05 21:01 
Kixdemp wrote:
Oh... does it have to be static? It's part of my class...


If it is part of your class, then it has to be static. A short explanation why it is necessary:

Suppose you have a function from a class, this function takes several arguments and take an extra one, which is the 'this' parameter (this last parameter is in fact implicit and you don't pass it yourself and you don't even know that this parameter is passed). This is necessary because the function needs to know to which instance of the class it belongs to. Now, if you compare to a function that isn't part of a class, this parameter doesn't exist of course.
Now, what happens if you declare a member function of a class static ? It means that this particular function will be shared among ALL instances of the class thus, it doesn't require the 'this' parameter to be passed as implicit argument. But this means also that it cannot access member variables that are not static (because it is not really part of a particular instance of the class, so it doesn't know nothing about a particular instance). The same goes for static member variables: they are shared among all instances of the class, thus, if you modify this variable in a particular instance, the changes will be visible in all other instances.

So the compiler gave you this error because the member function has not the same prototype as the function required to be passed in the CreateThread function (implicit this parameter) and this can be solved as declaring it static.
GeneralRe: Threads? Pin
Lord Kixdemp2-Dec-05 20:25
Lord Kixdemp2-Dec-05 20:25 
AnswerRe: Threads? Pin
David Crow30-Nov-05 3:08
David Crow30-Nov-05 3:08 
GeneralRe: Threads? Pin
Lord Kixdemp2-Dec-05 20:23
Lord Kixdemp2-Dec-05 20:23 
QuestionHow to change the interval between two icons in a List control in MFC Pin
zhonglin.liang29-Nov-05 13:03
zhonglin.liang29-Nov-05 13:03 
AnswerRe: How to change the interval between two icons in a List control in MFC Pin
Gavin Taylor29-Nov-05 19:08
professionalGavin Taylor29-Nov-05 19:08 
QuestionWMP 10 SDK Plugin Wizard in VS 2005 Pin
myst4ever29-Nov-05 13:00
myst4ever29-Nov-05 13:00 
QuestionNeed help Pin
stevey82029-Nov-05 12:51
stevey82029-Nov-05 12:51 
AnswerRe: Need help Pin
Curtis Schlak.29-Nov-05 13:24
Curtis Schlak.29-Nov-05 13:24 
QuestionUsing tlhelp32.h functions in MFC app Pin
ADent4229-Nov-05 12:34
ADent4229-Nov-05 12:34 
AnswerRe: Using tlhelp32.h functions in MFC app Pin
Sheng Jiang 蒋晟29-Nov-05 12:49
Sheng Jiang 蒋晟29-Nov-05 12:49 
QuestionRe: Using tlhelp32.h functions in MFC app Pin
ADent4229-Nov-05 17:42
ADent4229-Nov-05 17:42 
AnswerRe: Using tlhelp32.h functions in MFC app Pin
Sheng Jiang 蒋晟29-Nov-05 17:49
Sheng Jiang 蒋晟29-Nov-05 17:49 
GeneralRe: Using tlhelp32.h functions in MFC app Pin
ADent4229-Nov-05 17:55
ADent4229-Nov-05 17:55 
QuestionCombobox with DataSource with static value Pin
GoodQuestion29-Nov-05 12:29
GoodQuestion29-Nov-05 12:29 
QuestionProblem implementing radio buttons in VS.NET 2003 Pin
ralawrence29-Nov-05 10:34
ralawrence29-Nov-05 10:34 
AnswerRe: Problem implementing radio buttons in VS.NET 2003 Pin
David Crow29-Nov-05 10:48
David Crow29-Nov-05 10:48 
GeneralRe: Problem implementing radio buttons in VS.NET 2003 Pin
ralawrence29-Nov-05 11:02
ralawrence29-Nov-05 11:02 

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.