Click here to Skip to main content
15,905,614 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionIs it possible to have callback function as a class member? Pin
Aidman30-Jul-03 23:09
Aidman30-Jul-03 23:09 
AnswerRe: Is it possible to have callback function as a class member? Pin
FlyingDancer30-Jul-03 23:34
FlyingDancer30-Jul-03 23:34 
GeneralRe: Is it possible to have callback function as a class member? Pin
Aidman31-Jul-03 0:37
Aidman31-Jul-03 0:37 
GeneralRe: Is it possible to have callback function as a class member? Pin
Rage31-Jul-03 1:02
professionalRage31-Jul-03 1:02 
GeneralRe: Is it possible to have callback function as a class member? Pin
John R. Shaw31-Jul-03 9:31
John R. Shaw31-Jul-03 9:31 
GeneralRe: Is it possible to have callback function as a class member? Pin
FlyingDancer31-Jul-03 1:55
FlyingDancer31-Jul-03 1:55 
AnswerRe: Is it possible to have callback function as a class member? Pin
Andrew Walker30-Jul-03 23:46
Andrew Walker30-Jul-03 23:46 
AnswerRe: Is it possible to have callback function as a class member? Pin
Neville Franks31-Jul-03 0:19
Neville Franks31-Jul-03 0:19 
This is standard C++ stuff which you should find in any good C++ Reference book.

Here is a code snippet:

class CBookmarks 
{
public:
    void   ScanBookmarks( void (CBookmarks::*Scan_Func)( const BMRK, const ulong, const ulong ), const ulong var1, const ulong var2, const LN_NUM ln_num );
};

// Function definition
void
CBookmarks::ScanBookmarks( void (CBookmarks::*Scan_Func)( const BMRK, const ulong, const ulong ), const ulong var1, const ulong var2, const LN_NUM ln_num )
{
}

// Function using callback.
bits
CBookmarks::ClmChanged( const LN_NUM ln_num, const LN_CLM clm, const int dir )
{
    m_changed_bookmarks = 0x00;
    ScanBookmarks( _ClmChanged, clm, dir, ln_num );
    return m_changed_bookmarks;
}

// Callback function
void
CBookmarks::_ClmChanged( const BMRK mp, const LN_CLM clm, const ulong dir )
{
    if ( mp->m_ln_clm >= clm )
    {
	mp->m_ln_clm += dir;
        MASKON( mp->m_status, MOVED );    // flag that the bookmark has moved
        BITON( m_changed_bookmarks, mp - m_bookmarks );
        mp->m_ln_oclm = MARK_OFF;       // reset as no longer valid
    }
}


Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
QuestionHow to know the current path of my project Pin
FlyingDancer30-Jul-03 22:11
FlyingDancer30-Jul-03 22:11 
AnswerRe: How to know the current path of my project Pin
Arjan Schouten30-Jul-03 22:54
Arjan Schouten30-Jul-03 22:54 
AnswerRe: How to know the current path of my project Pin
Frank K30-Jul-03 22:56
Frank K30-Jul-03 22:56 
GeneralRe: How to know the current path of my project Pin
FlyingDancer30-Jul-03 23:17
FlyingDancer30-Jul-03 23:17 
GeneralRe: How to know the current path of my project Pin
Rage31-Jul-03 0:16
professionalRage31-Jul-03 0:16 
GeneralRe: How to know the current path of my project Pin
FlyingDancer31-Jul-03 2:14
FlyingDancer31-Jul-03 2:14 
GeneralRe: How to know the current path of my project Pin
Ravi Bhavnani31-Jul-03 2:41
professionalRavi Bhavnani31-Jul-03 2:41 
GeneralPins Notification Pin
urid30-Jul-03 21:50
urid30-Jul-03 21:50 
QuestionHow to create an hyperlink on the desktop of my MDI application Pin
dlocarnini30-Jul-03 21:25
dlocarnini30-Jul-03 21:25 
AnswerRe: How to create an hyperlink on the desktop of my MDI application Pin
Rage31-Jul-03 0:18
professionalRage31-Jul-03 0:18 
GeneralRe: How to create an hyperlink on the desktop of my MDI application Pin
Anonymous1-Aug-03 6:39
Anonymous1-Aug-03 6:39 
Generalstarting DirectX Pin
Mazdak30-Jul-03 21:07
Mazdak30-Jul-03 21:07 
GeneralRe: starting DirectX Pin
Roger CS30-Jul-03 21:42
Roger CS30-Jul-03 21:42 
GeneralRe: starting DirectX Pin
Mazdak31-Jul-03 0:16
Mazdak31-Jul-03 0:16 
GeneralA problem about DeviceIoControl Pin
FlyingDancer30-Jul-03 20:58
FlyingDancer30-Jul-03 20:58 
GeneralWebbrowser object problem!!! Pin
xxhimanshu30-Jul-03 20:47
xxhimanshu30-Jul-03 20:47 
Questionhow can I warn to make a choice for numeric edit box? Pin
Emre Zorlu30-Jul-03 20:41
Emre Zorlu30-Jul-03 20:41 

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.