Click here to Skip to main content
15,901,284 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Converting "C++" language code code to "C" language code. Pin
tyftyftyf22-Nov-09 17:44
tyftyftyf22-Nov-09 17:44 
QuestionHow to initialize a modal dialog's controls? Pin
timbk21-Nov-09 11:38
timbk21-Nov-09 11:38 
AnswerRe: How to initialize a modal dialog's controls? Pin
timbk21-Nov-09 13:07
timbk21-Nov-09 13:07 
QuestionNumber Matching Pin
Humayun Kabir Hemoo21-Nov-09 0:19
Humayun Kabir Hemoo21-Nov-09 0:19 
AnswerRe: Number Matching Pin
Rozis21-Nov-09 1:49
Rozis21-Nov-09 1:49 
AnswerRe: Number Matching Pin
T210221-Nov-09 2:37
T210221-Nov-09 2:37 
AnswerRe: Number Matching Pin
Humayun Kabir Hemoo21-Nov-09 3:37
Humayun Kabir Hemoo21-Nov-09 3:37 
Questionmap saves class object and function pointer gives error [modified] Pin
Chanchalgaud20-Nov-09 22:42
Chanchalgaud20-Nov-09 22:42 
when i am executing following code:

#include "stdafx.h"
#include "stdio.h"
#include

using namespace std ;
class Derived;
typedef void (Derived::*callbackf)() ;

class Base;
typedef map<base*, callbackf*=""> MYLIST;

class Base
{
public:
Base(void){};
MYLIST mylist;
void Attach(Base* p, callbackf* voidpt){mylist[p] = voidpt;};
~Base(void){};
};

class Derived : public Base
{
public:
void onMoving(){};
Derived(void)
{
callbackf ponMoving = &Derived::onMoving;
Attach(this, &ponMoving);
};
~Derived(void){};
};
int _tmain(int argc, _TCHAR* argv[])
{

Base *b;
b= new Derived();

MYLIST::iterator itr;
itr = b->mylist.begin();

for (itr = b->mylist.begin(); itr != b->mylist.end(); itr++)
{
Base* clsOb = (*itr).first;
callbackf fn = b->mylist[(*itr).first];
(*clsOb.*fn)();
}
return 0;
}

I am getting two errors:
'initializing' : cannot convert from 'void *' to 'callbackf'
'newline' : cannot convert from 'Base *__w64 ' to 'Derived *__w64 '
'.*' : cannot dereference a 'callbackf' on a 'Base'

Can anybody pls help?

modified on Sunday, November 22, 2009 11:38 PM

AnswerRe: map saves class object and function pointer gives error Pin
Cedric Moonen20-Nov-09 23:35
Cedric Moonen20-Nov-09 23:35 
AnswerRe: map saves class object and function pointer gives error Pin
Richard MacCutchan20-Nov-09 23:42
mveRichard MacCutchan20-Nov-09 23:42 
QuestionSHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path Pin
Chesnokov Yuriy20-Nov-09 22:11
professionalChesnokov Yuriy20-Nov-09 22:11 
AnswerRe: SHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path Pin
Rozis21-Nov-09 2:00
Rozis21-Nov-09 2:00 
QuestionRe: SHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path Pin
Chesnokov Yuriy21-Nov-09 8:23
professionalChesnokov Yuriy21-Nov-09 8:23 
QuestionRe: SHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path Pin
22491721-Nov-09 20:15
22491721-Nov-09 20:15 
AnswerRe: SHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path Pin
Chesnokov Yuriy21-Nov-09 21:26
professionalChesnokov Yuriy21-Nov-09 21:26 
GeneralRe: SHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path Pin
22491721-Nov-09 21:38
22491721-Nov-09 21:38 
GeneralRe: SHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path Pin
Chesnokov Yuriy21-Nov-09 23:22
professionalChesnokov Yuriy21-Nov-09 23:22 
GeneralRe: SHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path Pin
22491722-Nov-09 7:39
22491722-Nov-09 7:39 
Questionconvert - char c[90000000] to CString. Pin
Paulraj G20-Nov-09 18:50
Paulraj G20-Nov-09 18:50 
AnswerRe: convert - char c[90000000] to CString. Pin
22491720-Nov-09 18:59
22491720-Nov-09 18:59 
GeneralRe: convert - char c[90000000] to CString. Pin
Paulraj G20-Nov-09 19:08
Paulraj G20-Nov-09 19:08 
AnswerRe: convert - char c[90000000] to CString. Pin
22491720-Nov-09 19:21
22491720-Nov-09 19:21 
AnswerRe: convert - char c[90000000] to CString. Pin
Rajesh R Subramanian20-Nov-09 20:02
professionalRajesh R Subramanian20-Nov-09 20:02 
AnswerRe: convert - char c[90000000] to CString. Pin
CPallini20-Nov-09 20:30
mveCPallini20-Nov-09 20:30 
AnswerRe: convert - char c[90000000] to CString. Pin
Cedric Moonen20-Nov-09 21:42
Cedric Moonen20-Nov-09 21:42 

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.