Click here to Skip to main content
16,014,613 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CPrintDialog Pin
Rick Crone4-Apr-02 11:28
Rick Crone4-Apr-02 11:28 
GeneralRe: CPrintDialog Pin
Shog94-Apr-02 12:26
sitebuilderShog94-Apr-02 12:26 
GeneralRe: CPrintDialog Pin
Rick Crone9-Apr-02 4:13
Rick Crone9-Apr-02 4:13 
GeneralRe: CPrintDialog Pin
Shog99-Apr-02 5:18
sitebuilderShog99-Apr-02 5:18 
GeneralRe: CPrintDialog Pin
Rick Crone9-Apr-02 6:21
Rick Crone9-Apr-02 6:21 
GeneralRe: CPrintDialog Pin
Shog99-Apr-02 7:27
sitebuilderShog99-Apr-02 7:27 
GeneralRe: CPrintDialog Pin
Rick Crone9-Apr-02 7:43
Rick Crone9-Apr-02 7:43 
Generalpointer to a function Pin
moredip4-Apr-02 8:07
moredip4-Apr-02 8:07 
Hello All!

I'm having a little bit of trouble passing a function pointer. I have a nice class called C4DTPGraph, which has a member function DoMatching, declared as follows:
void C4DTPGraph::DoMatching( bool (*FoundMatch)( UINT *aVertices, UINT cVertices ) )


I have another class CTracker, which has a member variable C4DTPGraph *m_pCorrGraph. It also has a function called CheckMatch, declared as follows
bool CheckMatch( UINT *aVindices, UINT cVindices );


Here's the problem: when I try and call C4DTPGraph::DoMatching(), passing a pointer to CheckMatch(), VC++ gets upset, saying
error C2664: 'DoMatching' : cannot convert parameter 1 from 'bool (unsigned int *,unsigned int)' to 'bool (__cdecl *)(unsigned int *,unsigned int)'


here's the function call it doesn't like:
m_pCorrGraph->DoMatching( CheckMatch );


Now I can't see what's wrong with that, but then again, I've not got much experience passing function pointers as arguments.

Can anyone shed some light on what I'm doing wrong?

TIA,

Pete
GeneralRe: pointer to a function Pin
Tim Smith4-Apr-02 8:08
Tim Smith4-Apr-02 8:08 
GeneralRe: pointer to a function Pin
moredip4-Apr-02 8:24
moredip4-Apr-02 8:24 
GeneralRe: pointer to a member function Pin
Paul M Watt4-Apr-02 8:22
mentorPaul M Watt4-Apr-02 8:22 
GeneralRe: pointer to a function Pin
moredip4-Apr-02 8:31
moredip4-Apr-02 8:31 
GeneralXor function Pin
Mazdak4-Apr-02 5:56
Mazdak4-Apr-02 5:56 
GeneralRe: Xor function Pin
Tomasz Sowinski4-Apr-02 6:01
Tomasz Sowinski4-Apr-02 6:01 
GeneralRe: Xor function Pin
Mazdak4-Apr-02 6:37
Mazdak4-Apr-02 6:37 
GeneralCListCtrl GetSelectionMark() probs Pin
dazinith4-Apr-02 4:47
dazinith4-Apr-02 4:47 
GeneralRe: CListCtrl GetSelectionMark() probs Pin
dlhson4-Apr-02 4:54
dlhson4-Apr-02 4:54 
GeneralRe: CListCtrl GetSelectionMark() probs Pin
dazinith4-Apr-02 5:03
dazinith4-Apr-02 5:03 
GeneralRe: CListCtrl GetSelectionMark() probs Pin
dazinith4-Apr-02 5:28
dazinith4-Apr-02 5:28 
GeneralRe: CListCtrl GetSelectionMark() probs Pin
Ravi Bhavnani4-Apr-02 6:05
professionalRavi Bhavnani4-Apr-02 6:05 
GeneralRe: CListCtrl GetSelectionMark() probs Pin
dazinith4-Apr-02 6:25
dazinith4-Apr-02 6:25 
GeneralSplit Edit box that's size can be changed Pin
Aoife4-Apr-02 3:47
Aoife4-Apr-02 3:47 
GeneralRe: Split Edit box that's size can be changed Pin
dlhson4-Apr-02 4:48
dlhson4-Apr-02 4:48 
QuestionCombobox read only??? Pin
TommyKnocker4-Apr-02 3:26
TommyKnocker4-Apr-02 3:26 
AnswerRe: Combobox read only??? Pin
Michael P Butler4-Apr-02 3:50
Michael P Butler4-Apr-02 3:50 

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.