'DGModelessInit' : cannot convert parameter 2 in x64 window
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2010-08-09
02:26 PM
- last edited on
‎2023-08-03
11:29 AM
by
Doreena Deng
‎2010-08-09
02:26 PM
I finished compiling and testing a project in 32bit Archicad but when I am compiling the same project with X64 option. I ran into trouble with the dialogue handler.
For eg,
in the example project "DG_Test" supplied with the APIDevKit .
the line:
isOK = (DGModalDialog (Fill_GDLGID, Fill_Handler, (DGUserData) &prefsData) == DG_OK);
where :
fill_Handler is a call back function :
static short DGCALLBACK Fill_Handler (short message, short dialogID, short item, DGUserData userData, DGMessageData msgData){...}
This will compile and run normally in archicad 32 bit however if I changed active solution platform in visual studio 2005 to "X64" , I will get this error on compilation:
: error C2664: 'DGModelessInit' : cannot convert parameter 2 from 'short (__cdecl *)(short,short,short,long,long)' to 'const DGDialCallBack'
How can I get around this? is DGModeless or DGModal supported in x64 development? I am really stuck on this part. Would appreciate any advice. Thanks
Alfred
For eg,
in the example project "DG_Test" supplied with the APIDevKit .
the line:
isOK = (DGModalDialog (Fill_GDLGID, Fill_Handler, (DGUserData) &prefsData) == DG_OK);
where :
fill_Handler is a call back function :
static short DGCALLBACK Fill_Handler (short message, short dialogID, short item, DGUserData userData, DGMessageData msgData){...}
This will compile and run normally in archicad 32 bit however if I changed active solution platform in visual studio 2005 to "X64" , I will get this error on compilation:
: error C2664: 'DGModelessInit' : cannot convert parameter 2 from 'short (__cdecl *)(short,short,short,long,long)' to 'const DGDialCallBack'
How can I get around this? is DGModeless or DGModal supported in x64 development? I am really stuck on this part. Would appreciate any advice. Thanks
Alfred
Labels:
- Labels:
-
Add-On (C++)
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2010-08-09 03:44 PM
‎2010-08-09
03:44 PM
ALFREDMAN wrote:Yes, these calls are supported and work fine in my experience. I can't tell why this isn't working from the information you provided. Could you post some code snippets at the declaration of the callback and the point leading up to and including the call to DGModeless?
How can I get around this? is DGModeless or DGModal supported in x64 development? I am really stuck on this part. Would appreciate any advice.
Ralph Wessel BArch
Central Innovation
Central Innovation
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2010-08-10 10:48 AM
‎2010-08-10
10:48 AM
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.
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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2010-08-10 06:05 PM
‎2010-08-10
06:05 PM
ALFREDMAN wrote:I don't know why this is failing to compile in this case. Perhaps there is a problem in the project configuration? I suggest looking at the example project
This is a very simple code snip that shows how it fails to work in my case:
BTW - I notice you are still using the
Ralph Wessel BArch
Central Innovation
Central Innovation