Click here to Skip to main content
15,898,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How I can read and write dicom image via c++? Pin
jeron13-Feb-15 8:34
jeron13-Feb-15 8:34 
QuestionKeeping track of fonts, pens, device contexts, etc. Pin
Anthony Appleyard3-Feb-15 2:32
Anthony Appleyard3-Feb-15 2:32 
AnswerRe: Keeping track of fonts, pens, device contexts, etc. Pin
Richard Andrew x643-Feb-15 4:55
professionalRichard Andrew x643-Feb-15 4:55 
GeneralRe: Keeping track of fonts, pens, device contexts, etc. Pin
Anthony Appleyard3-Feb-15 5:12
Anthony Appleyard3-Feb-15 5:12 
GeneralRe: Keeping track of fonts, pens, device contexts, etc. Pin
Richard MacCutchan3-Feb-15 6:59
mveRichard MacCutchan3-Feb-15 6:59 
QuestionHow to create floating toolbar that always active in MFC application Pin
Member 111256243-Feb-15 1:38
Member 111256243-Feb-15 1:38 
QuestionA query about Visual C/C++ 2008 edition's main menu Pin
Anthony Appleyard2-Feb-15 22:09
Anthony Appleyard2-Feb-15 22:09 
AnswerRe: A query about Visual C/C++ 2008 edition's main menu Pin
Richard MacCutchan2-Feb-15 23:18
mveRichard MacCutchan2-Feb-15 23:18 
QuestionHow can I created window console application that read these: Pin
Member 1141745231-Jan-15 12:18
Member 1141745231-Jan-15 12:18 
AnswerRe: How can I created window console application that read these: Pin
Garth J Lancaster31-Jan-15 13:47
professionalGarth J Lancaster31-Jan-15 13:47 
AnswerRe: How can I created window console application that read these: Pin
Richard MacCutchan1-Feb-15 0:47
mveRichard MacCutchan1-Feb-15 0:47 
QuestionError while compiling Pin
Member 1094400430-Jan-15 19:49
Member 1094400430-Jan-15 19:49 
AnswerRe: Error while compiling Pin
pasztorpisti30-Jan-15 23:20
pasztorpisti30-Jan-15 23:20 
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 

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.