Click here to Skip to main content
15,887,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Error while compiling Pin
Member 109440042-Feb-15 20:05
Member 109440042-Feb-15 20:05 
GeneralRe: Error while compiling Pin
pasztorpisti3-Feb-15 12:25
pasztorpisti3-Feb-15 12:25 
GeneralRe: Error while compiling Pin
Member 109440045-Feb-15 0:23
Member 109440045-Feb-15 0:23 
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 
Hello,

I'm trying to adapt some Microsoft code (member.cpp in Detours) for my case
( I just want to replace
void CMember::Target(void)
by
QString QString::fromAscii(const char *str, int size):

MS Code :
C++
class CMember
{
  public:
    void Target(void);
};

void CMember::Target(void)
{
    printf("  CMember::Target!   (this:%p)\n", this);
}

//////////////////////////////////////////////////////////////// Detour Class.
//
class CDetour /* add ": public CMember" to enable access to member variables... */
{
  public:
    void Mine_Target(void);
    static void (CDetour::* Real_Target)(void);

    // Class shouldn't have any member variables or virtual functions.
};

void CDetour::Mine_Target(void)
{
    printf("  CDetour::Mine_Target! (this:%p)\n", this);
    (this->*Real_Target)();
}

void (CDetour::* CDetour::Real_Target)(void) = (void (CDetour::*)(void))&CMember::Target;


My code :

C++
class CDetour /* add ": public CMember" to enable access to member variables... */
{
  public:
    QString Mine_Target(const char *str, int size);
    static QString (CDetour::* Real_Target)(const char *str, int size);

    // Class shouldn't have any member variables or virtual functions.
};

QString CDetour::Mine_Target(const char *str, int size)
{
    printf("  CDetour::Mine_Target! (this:%p)\n", this);
    (this->*Real_Target)(str, size);
}

QString (CDetour::* CDetour::Real_Target)(const char *str, int size) = (CDetour::*)(const char *str, int size)&QString::fromAscii;


But I get :

error C2059: syntax error: '< tag >::*'

for the last line

Why ?!

Thanks.

Edit :
If I do :
C++
QString (CDetour::* CDetour::Real_Target)(const char *str, int size) = (QString(CDetour::*)(const char *str, int size))&QString::fromAscii;


I get :

error C2440: 'type cast' : impossible to convert from 'QString (__cdecl *)(const char *,int)' into 'QString (__thiscall CDetour::* )(const char *,int)'


modified 29-Jan-15 7:21am.

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 
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 

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.