Click here to Skip to main content
14,334,896 members

C / C++ / MFC

 
AnswerRe: Dot Net Version Pin
Richard Deeming26-Mar-19 2:18
mveRichard Deeming26-Mar-19 2:18 
QuestionCADODatabase class: Currency parameters in SQL Pin
Don Stauffer18-Mar-19 12:31
memberDon Stauffer18-Mar-19 12:31 
AnswerRe: CADODatabase class: Currency parameters in SQL Pin
Richard MacCutchan18-Mar-19 22:41
protectorRichard MacCutchan18-Mar-19 22:41 
GeneralRe: CADODatabase class: Currency parameters in SQL Pin
Don Stauffer19-Mar-19 7:26
memberDon Stauffer19-Mar-19 7:26 
GeneralRe: CADODatabase class: Currency parameters in SQL Pin
Richard MacCutchan19-Mar-19 7:45
protectorRichard MacCutchan19-Mar-19 7:45 
GeneralRe: CADODatabase class: Currency parameters in SQL Pin
Don Stauffer19-Mar-19 10:54
memberDon Stauffer19-Mar-19 10:54 
GeneralRe: CADODatabase class: Currency parameters in SQL Pin
Don Stauffer19-Mar-19 12:00
memberDon Stauffer19-Mar-19 12:00 
QuestionClass member function as call back Pin
NoviceEx14-Mar-19 2:41
memberNoviceEx14-Mar-19 2:41 
Maybe someone will be able to help me with this quite complex problem.
First of all I have control initialization function which requires callback

typedef int (*callback_fnc)(HWND, int, ...);
my_init_control(HWND hwnd, callback_fnc cb, int flags);


I have few classes:

Class A
{
public:
 ...
private:
 int var1;
}

Class B: public A
{
public:
 ...
 void init();
 int proc(HWND hwnd, int msg, ...); // it uses var1 and var2
 ...
private:
 int var2;
}


I need to init control and I need to use class B function proc as callback function. Tried to use it that way but it does not work that way.

void B::init()
{
  my_init_control(itemHwnd, B::proc, 0);
}


Also I have tried that way

my_init_control(itemHwnd, boost::bind(&B::proc, this), 0);


but it does not work either. Tried to google but cannot find samples close to my case.

So question is what should I need to do in order to use function
B::proc()
as callback in
B::init()
.

modified 14-Mar-19 10:37am.

AnswerRe: Class member function as call back Pin
Richard MacCutchan14-Mar-19 3:27
protectorRichard MacCutchan14-Mar-19 3:27 
GeneralRe: Class member function as call back Pin
NoviceEx14-Mar-19 4:01
memberNoviceEx14-Mar-19 4:01 
GeneralRe: Class member function as call back Pin
Richard MacCutchan14-Mar-19 4:05
protectorRichard MacCutchan14-Mar-19 4:05 
AnswerRe: Class member function as call back Pin
CPallini14-Mar-19 4:16
mveCPallini14-Mar-19 4:16 
AnswerRe: Class member function as call back Pin
Richard MacCutchan14-Mar-19 5:00
protectorRichard MacCutchan14-Mar-19 5:00 
GeneralRe: Class member function as call back Pin
NoviceEx14-Mar-19 21:29
memberNoviceEx14-Mar-19 21:29 
GeneralRe: Class member function as call back Pin
CPallini14-Mar-19 22:44
mveCPallini14-Mar-19 22:44 
GeneralRe: Class member function as call back Pin
Richard MacCutchan14-Mar-19 23:02
protectorRichard MacCutchan14-Mar-19 23:02 
GeneralRe: Class member function as call back Pin
CPallini15-Mar-19 1:49
mveCPallini15-Mar-19 1:49 
GeneralRe: Class member function as call back Pin
Richard MacCutchan15-Mar-19 2:57
protectorRichard MacCutchan15-Mar-19 2:57 
AnswerRe: Class member function as call back Pin
Stefan_Lang19-Mar-19 4:07
memberStefan_Lang19-Mar-19 4:07 
QuestionWin32++ Dialog Pin
Member 1372187514-Mar-19 1:32
memberMember 1372187514-Mar-19 1:32 
AnswerRe: Win32++ Dialog Pin
Richard MacCutchan14-Mar-19 1:58
protectorRichard MacCutchan14-Mar-19 1:58 
GeneralRe: Win32++ Dialog Pin
CPallini14-Mar-19 2:30
mveCPallini14-Mar-19 2:30 
GeneralRe: Win32++ Dialog Pin
Richard MacCutchan14-Mar-19 2:35
protectorRichard MacCutchan14-Mar-19 2:35 
AnswerRe: Win32++ Dialog Pin
leon de boer14-Mar-19 14:34
memberleon de boer14-Mar-19 14:34 
QuestionGet file size Pin
_Flaviu14-Mar-19 0:31
member_Flaviu14-Mar-19 0:31 

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.