This is a very simple code snip that shows how it fails to work in my case:
In this example, i am just trying to call the progress bar up :
#include ".\commonprogressdg.h"
CProgressDG::~CProgressDG(void)
{
delete[] m_title;
}
CProgressDG::CProgressDG(short progBarRes, char* title,long minVal, long maxVal)
{
m_progBarRes=progBarRes;
m_title = new char[256];
CHCopyC(title,m_title);
m_minVal=minVal;
m_maxVal=maxVal;
m_curVal=m_minVal;
GSResModule filNum;
short dialID;
filNum = ACAPI_UseOwnResModule (); // Set own resource file the active one
dialID = DGModelessInit (m_progBarRes, CProgressDG::progressBarCallBack,(DGUserData) this,1);
ACAPI_ResetResModule (filNum);
}
static short DGCALLBACK CProgressDG::progressBarCallBack ( short message,
short dialId,
short item,
DGUserData userData,
DGMessageData msgData)
{
msgData=0;
item=0;
// long val=0;
CProgressDG* pThisData=(CProgressDG*) userData;
short result=0;
switch (message) {
case DG_MSG_INIT:
DGSetDialogTitle (dialId,pThisData->m_title);
DGSetItemMinLong (dialId, 1, pThisData->m_minVal);
DGSetItemMaxLong (dialId, 1, pThisData->m_maxVal);
DGSetItemValLong (dialId, 1, 0);// m_maxProgress);
break;
}
return (result);
} // Browser_CB
void CProgressDG::setValue(long val)
{
DGSetItemValLong (m_progBarRes, 1, val);
}
void CProgressDG::closeDG()
{
DGModelessClose (m_progBarRes);
}
************************************************************
This same piece of code will compile and runs if I dont choose the active platform to be x64. But once x64 is used, the error goes here:
dialID = DGModelessInit (m_progBarRes, CProgressDG::progressBarCallBack,(DGUserData) this,1);
1>..\..\..\..\..\..\_Common\OnumaCommon\CommonProgressDG.cpp(18) : error C2664: 'DGModelessInit' : cannot convert parameter 2 from 'short (__cdecl *)(short,short,short,long,long)' to 'const DGDialCallBack'
Please help.