Click here to Skip to main content
15,890,670 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Error while compiling Pin
Mike Nordell2-Feb-15 10:44
Mike Nordell2-Feb-15 10:44 
GeneralRe: Error while compiling Pin
Member 109440042-Feb-15 17:30
Member 109440042-Feb-15 17:30 
GeneralRe: Error while compiling Pin
Mike Nordell7-Feb-15 14:55
Mike Nordell7-Feb-15 14:55 
QuestionSnake Game please help me Pin
Member 1141203429-Jan-15 3:16
Member 1141203429-Jan-15 3:16 
Questionerror C2059: syntax error: '<tag>::*' Pin
jeff629-Jan-15 0:43
jeff629-Jan-15 0:43 
AnswerRe: error C2059: syntax error: '<tag>::*' Pin
Freak3030-Jan-15 3:51
Freak3030-Jan-15 3:51 
GeneralRe: error C2059: syntax error: '<tag>::*' Pin
jeff630-Jan-15 4:16
jeff630-Jan-15 4:16 
AnswerRe: error C2059: syntax error: '<tag>::*' Pin
Stefan_Lang30-Jan-15 4:52
Stefan_Lang30-Jan-15 4:52 
You're trying to cast to (CDetour::*), which isn't a valid type definition. It is only a part of a member function pointer definition and doesn't make sense without the parameter list and return type.

Look at the last line in the MS code example: &CMember::Target is the address of a member function pointer. You can only cast a member function pointer to a member function pointer of a differentsimilar type, in this case (void (CDetour::*)(void)), which is a member function of the class Detour (that is what CDetour::* means) with an empty parameter list (the (void) bit) and a void return type (the preceding void)

The compiler error is based on the fact that the compiler doesn't recognize (CDetour::*) as part of a function pointer definition without the preceding return type, and there is no other valid interpretation.

Your edit version looks better: the compiler does recognize the member function pointer cast correctly, it just doesn't want to accept that cast for some reason. One possible problem could be the calling convention being used: your class definition generated the member function using __thiscall, whereas the QT function was defined as using __cdecl. You may want to check your calling convention settings.

[edit]fixed my statement about function pointer casts in light of what I said in the last paragraph[/edit]
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

QuestionCMFCRibbonBar and recent file list Pin
Leif Simon Goodwin27-Jan-15 4:09
Leif Simon Goodwin27-Jan-15 4:09 
QuestionGet info from video capture card but no SDK Pin
peterkoller12327-Jan-15 2:05
peterkoller12327-Jan-15 2:05 
AnswerRe: Get info from video capture card but no SDK Pin
Mike Nordell2-Feb-15 9:36
Mike Nordell2-Feb-15 9:36 
GeneralRe: Get info from video capture card but no SDK Pin
peterkoller1232-Feb-15 10:40
peterkoller1232-Feb-15 10:40 
Questionexample c++ application Pin
Member 1139333326-Jan-15 21:20
Member 1139333326-Jan-15 21:20 
AnswerRe: example c++ application Pin
Richard MacCutchan26-Jan-15 21:22
mveRichard MacCutchan26-Jan-15 21:22 
GeneralRe: example c++ application Pin
jeron127-Jan-15 3:59
jeron127-Jan-15 3:59 
AnswerRe: example c++ application Pin
Stefan_Lang30-Jan-15 5:00
Stefan_Lang30-Jan-15 5:00 
QuestionHow do I know my dual display in span mode in windows xp? Pin
cedricvictor26-Jan-15 16:49
cedricvictor26-Jan-15 16:49 
QuestionWin8.1 UEFI block WINIO? Pin
ICEric25-Jan-15 22:32
ICEric25-Jan-15 22:32 
SuggestionRe: Win8.1 UEFI block WINIO? Pin
Richard MacCutchan25-Jan-15 23:25
mveRichard MacCutchan25-Jan-15 23:25 
GeneralRe: Win8.1 UEFI block WINIO? Pin
ICEric26-Jan-15 14:47
ICEric26-Jan-15 14:47 
AnswerRe: Win8.1 UEFI block WINIO? Pin
Randor 26-Jan-15 15:24
professional Randor 26-Jan-15 15:24 
GeneralRe: Win8.1 UEFI block WINIO? Pin
ICEric27-Jan-15 5:13
ICEric27-Jan-15 5:13 
QuestionBitBlt() function performance question Pin
econy23-Jan-15 7:55
econy23-Jan-15 7:55 
AnswerRe: BitBlt() function performance question Pin
Chris Losinger23-Jan-15 10:39
professionalChris Losinger23-Jan-15 10:39 
GeneralRe: BitBlt() function performance question Pin
econy23-Jan-15 13:38
econy23-Jan-15 13:38 

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.