Click here to Skip to main content
15,885,309 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CADODatabase class: Currency parameters in SQL Pin
Don Stauffer19-Mar-19 10:54
Don Stauffer19-Mar-19 10:54 
GeneralRe: CADODatabase class: Currency parameters in SQL Pin
Don Stauffer19-Mar-19 12:00
Don Stauffer19-Mar-19 12:00 
QuestionClass member function as call back Pin
NoviceEx14-Mar-19 2:41
NoviceEx14-Mar-19 2:41 
AnswerRe: Class member function as call back Pin
Richard MacCutchan14-Mar-19 3:27
mveRichard MacCutchan14-Mar-19 3:27 
GeneralRe: Class member function as call back Pin
NoviceEx14-Mar-19 4:01
NoviceEx14-Mar-19 4:01 
GeneralRe: Class member function as call back Pin
Richard MacCutchan14-Mar-19 4:05
mveRichard 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
mveRichard MacCutchan14-Mar-19 5:00 
Try this, noting that Class (with capital C) is incorrect, it should be class. Also that B::proc needs to be static.
C++
#include <stdlib.h>
#include <stdio.h>

typedef int (*callback_fnc)(int);
void my_init_control(callback_fnc cb, int flags)
{
    cb(flags);
}

class B
{
public:
    void init()
    {
        my_init_control(&B::proc, 0);
    }

    static int proc(int msg) // it uses var1 and var2
    {
        printf("This is message number %d\n", msg);
        return 0;
    }
};

int main(
	)
{
    B bobj;
    bobj.init();

    return 0;
}

GeneralRe: Class member function as call back Pin
NoviceEx14-Mar-19 21:29
NoviceEx14-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
mveRichard 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
mveRichard MacCutchan15-Mar-19 2:57 
AnswerRe: Class member function as call back Pin
Stefan_Lang19-Mar-19 4:07
Stefan_Lang19-Mar-19 4:07 
QuestionWin32++ Dialog Pin
Member 1372187514-Mar-19 1:32
Member 1372187514-Mar-19 1:32 
AnswerRe: Win32++ Dialog Pin
Richard MacCutchan14-Mar-19 1:58
mveRichard 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
mveRichard MacCutchan14-Mar-19 2:35 
AnswerRe: Win32++ Dialog Pin
leon de boer14-Mar-19 14:34
leon de boer14-Mar-19 14:34 
QuestionGet file size Pin
_Flaviu14-Mar-19 0:31
_Flaviu14-Mar-19 0:31 
AnswerRe: Get file size Pin
CPallini14-Mar-19 1:09
mveCPallini14-Mar-19 1:09 
GeneralRe: Get file size Pin
_Flaviu14-Mar-19 1:20
_Flaviu14-Mar-19 1:20 
GeneralRe: Get file size Pin
CPallini14-Mar-19 1:24
mveCPallini14-Mar-19 1:24 
QuestionGet system image list not working in some cases Pin
_Flaviu13-Mar-19 7:07
_Flaviu13-Mar-19 7:07 
SuggestionRe: Get system image list not working in some cases Pin
Richard MacCutchan13-Mar-19 22:18
mveRichard MacCutchan13-Mar-19 22:18 

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.