Click here to Skip to main content
15,896,118 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Disable and grey out menu item Pin
led mike30-Jul-07 12:42
led mike30-Jul-07 12:42 
AnswerRe: Disable and grey out menu item Pin
Mark Salsbery30-Jul-07 13:58
Mark Salsbery30-Jul-07 13:58 
QuestionRe: Disable and grey out menu item Pin
Johpoke30-Jul-07 21:54
Johpoke30-Jul-07 21:54 
Questionunexistent MailSlots doesn't return error. Pin
r3dqu33n30-Jul-07 10:13
r3dqu33n30-Jul-07 10:13 
QuestionMemory read error on Win2K, but not on XP Pin
Joe Smith IX30-Jul-07 7:15
Joe Smith IX30-Jul-07 7:15 
AnswerRe: Memory read error on Win2K, but not on XP Pin
Mark Salsbery30-Jul-07 8:00
Mark Salsbery30-Jul-07 8:00 
GeneralRe: Memory read error on Win2K, but not on XP Pin
Joe Smith IX30-Jul-07 8:38
Joe Smith IX30-Jul-07 8:38 
GeneralRe: Memory read error on Win2K, but not on XP Pin
Mark Salsbery30-Jul-07 8:46
Mark Salsbery30-Jul-07 8:46 
GeneralRe: Memory read error on Win2K, but not on XP Pin
Joe Smith IX30-Jul-07 9:08
Joe Smith IX30-Jul-07 9:08 
GeneralRe: Memory read error on Win2K, but not on XP Pin
Mark Salsbery30-Jul-07 9:58
Mark Salsbery30-Jul-07 9:58 
GeneralRe: Memory read error on Win2K, but not on XP Pin
led mike30-Jul-07 11:31
led mike30-Jul-07 11:31 
GeneralRe: Memory read error on Win2K, but not on XP Pin
Mark Salsbery30-Jul-07 14:45
Mark Salsbery30-Jul-07 14:45 
GeneralRe: Memory read error on Win2K, but not on XP [modified] Pin
Joe Smith IX30-Jul-07 16:55
Joe Smith IX30-Jul-07 16:55 
GeneralRe: Memory read error on Win2K, but not on XP Pin
Rick York30-Jul-07 9:52
mveRick York30-Jul-07 9:52 
GeneralRe: Memory read error on Win2K, but not on XP Pin
Joe Smith IX30-Jul-07 17:22
Joe Smith IX30-Jul-07 17:22 
QuestionParsing C files? Pin
julvr230-Jul-07 5:06
julvr230-Jul-07 5:06 
AnswerRe: Parsing C files? Pin
David Crow30-Jul-07 5:21
David Crow30-Jul-07 5:21 
AnswerRe: Parsing C files? Pin
Iain Clarke, Warrior Programmer30-Jul-07 5:38
Iain Clarke, Warrior Programmer30-Jul-07 5:38 
GeneralRe: Parsing C files? Pin
julvr230-Jul-07 6:00
julvr230-Jul-07 6:00 
GeneralRe: Parsing C files? Pin
Robert Surtees31-Jul-07 6:35
Robert Surtees31-Jul-07 6:35 
Questionneed help with thread functions Pin
alberthyc30-Jul-07 4:17
alberthyc30-Jul-07 4:17 
AnswerRe: need help with thread functions Pin
CPallini30-Jul-07 4:33
mveCPallini30-Jul-07 4:33 
GeneralRe: need help with thread functions Pin
alberthyc30-Jul-07 4:42
alberthyc30-Jul-07 4:42 
QuestionA bit generic... Pin
CPallini30-Jul-07 4:50
mveCPallini30-Jul-07 4:50 
GeneralRe: need help with thread functions Pin
julvr230-Jul-07 4:59
julvr230-Jul-07 4:59 
You're trying to access a class member from within a static function. Static member functions have no concept of an instance of a class, so you can't access a member variable of an instance which doesn't exist... make sense?

So you do need to pass in the 'this' pointer, and you need to use the this pointer to access the variable.

In your case, you call Start (which does not have a class instance), which then calls Outputdata (which is also static, and thus has no class instance). Outputdata, then tries to access m_slider, but, because you have no class instance, you're essentially trying to do NULL->m_slider, which the compiler doesn't like.

So you were on the right track in the above email, but you need to take it a step further:

Try:

CMyDlg* me=(CMYDlg*)pParam
me->Outputdata(me);

Then in outputdata:

...me->m_slider...


John

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.