<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic 'DGModelessInit' : cannot convert parameter 2 in x64 window in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/DGModelessInit-cannot-convert-parameter-2-in-x64-window/m-p/187707#M6066</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;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.&lt;BR /&gt;&lt;BR /&gt;For eg, &lt;BR /&gt;in the example project "DG_Test" supplied with the APIDevKit . &lt;BR /&gt;&lt;BR /&gt;the line: &lt;BR /&gt;isOK = (DGModalDialog (Fill_GDLGID, Fill_Handler, (DGUserData) &amp;amp;prefsData) == DG_OK);&lt;BR /&gt;&lt;BR /&gt;where :&lt;BR /&gt;&lt;BR /&gt;fill_Handler is a call back function : &lt;BR /&gt;static short DGCALLBACK Fill_Handler (short message, short dialogID, short item, DGUserData userData, DGMessageData msgData){...}&lt;BR /&gt;&lt;BR /&gt;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: &lt;BR /&gt;&lt;BR /&gt;: error C2664: 'DGModelessInit' : cannot convert parameter 2 from 'short (__cdecl *)(short,short,short,long,long)' to 'const DGDialCallBack'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;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&lt;BR /&gt;&lt;BR /&gt;Alfred&lt;/DIV&gt;</description>
    <pubDate>Thu, 03 Aug 2023 09:29:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-08-03T09:29:38Z</dc:date>
    <item>
      <title>'DGModelessInit' : cannot convert parameter 2 in x64 window</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/DGModelessInit-cannot-convert-parameter-2-in-x64-window/m-p/187707#M6066</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;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.&lt;BR /&gt;&lt;BR /&gt;For eg, &lt;BR /&gt;in the example project "DG_Test" supplied with the APIDevKit . &lt;BR /&gt;&lt;BR /&gt;the line: &lt;BR /&gt;isOK = (DGModalDialog (Fill_GDLGID, Fill_Handler, (DGUserData) &amp;amp;prefsData) == DG_OK);&lt;BR /&gt;&lt;BR /&gt;where :&lt;BR /&gt;&lt;BR /&gt;fill_Handler is a call back function : &lt;BR /&gt;static short DGCALLBACK Fill_Handler (short message, short dialogID, short item, DGUserData userData, DGMessageData msgData){...}&lt;BR /&gt;&lt;BR /&gt;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: &lt;BR /&gt;&lt;BR /&gt;: error C2664: 'DGModelessInit' : cannot convert parameter 2 from 'short (__cdecl *)(short,short,short,long,long)' to 'const DGDialCallBack'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;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&lt;BR /&gt;&lt;BR /&gt;Alfred&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Aug 2023 09:29:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/DGModelessInit-cannot-convert-parameter-2-in-x64-window/m-p/187707#M6066</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-03T09:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: 'DGModelessInit' : cannot convert parameter 2 in x64 win</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/DGModelessInit-cannot-convert-parameter-2-in-x64-window/m-p/187708#M6067</link>
      <description>&lt;BLOCKQUOTE&gt;ALFREDMAN wrote:&lt;BR /&gt;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.&lt;/BLOCKQUOTE&gt;
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?</description>
      <pubDate>Mon, 09 Aug 2010 13:44:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/DGModelessInit-cannot-convert-parameter-2-in-x64-window/m-p/187708#M6067</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2010-08-09T13:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: 'DGModelessInit' : cannot convert parameter 2 in x64 win</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/DGModelessInit-cannot-convert-parameter-2-in-x64-window/m-p/187709#M6068</link>
      <description>This is a very simple code snip that shows how it fails to work in my case:&lt;BR /&gt;
&lt;BR /&gt;
In this example, i am just trying to call the progress bar up :&lt;BR /&gt;
&lt;BR /&gt;
#include ".\commonprogressdg.h"&lt;BR /&gt;
&lt;BR /&gt;
CProgressDG::~CProgressDG(void)&lt;BR /&gt;
{&lt;BR /&gt;
	delete[] m_title;&lt;BR /&gt;
}&lt;BR /&gt;
CProgressDG::CProgressDG(short progBarRes, char* title,long minVal, long maxVal)&lt;BR /&gt;
{&lt;BR /&gt;
	m_progBarRes=progBarRes;&lt;BR /&gt;
	m_title = new char[256];&lt;BR /&gt;
	CHCopyC(title,m_title);&lt;BR /&gt;
	m_minVal=minVal;&lt;BR /&gt;
	m_maxVal=maxVal;&lt;BR /&gt;
	m_curVal=m_minVal;&lt;BR /&gt;
	GSResModule	filNum;&lt;BR /&gt;
	short dialID;&lt;BR /&gt;
	filNum = ACAPI_UseOwnResModule ();		// Set own resource file the active one&lt;BR /&gt;
	dialID = DGModelessInit (m_progBarRes, CProgressDG::progressBarCallBack,(DGUserData) this,1);&lt;BR /&gt;
	ACAPI_ResetResModule (filNum);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
static short DGCALLBACK CProgressDG::progressBarCallBack (	short 	message,&lt;BR /&gt;
												short 	dialId,&lt;BR /&gt;
				 			 					short	item,&lt;BR /&gt;
				  								DGUserData	userData,&lt;BR /&gt;
												DGMessageData	msgData)&lt;BR /&gt;
{&lt;BR /&gt;
	msgData=0;&lt;BR /&gt;
	item=0;&lt;BR /&gt;
//	long val=0;&lt;BR /&gt;
	CProgressDG* pThisData=(CProgressDG*) userData;&lt;BR /&gt;
&lt;BR /&gt;
	short				result=0;&lt;BR /&gt;
	switch (message) {&lt;BR /&gt;
		case DG_MSG_INIT:&lt;BR /&gt;
			DGSetDialogTitle (dialId,pThisData-&amp;gt;m_title);&lt;BR /&gt;
			DGSetItemMinLong (dialId, 1,  pThisData-&amp;gt;m_minVal);&lt;BR /&gt;
			DGSetItemMaxLong (dialId, 1,  pThisData-&amp;gt;m_maxVal);&lt;BR /&gt;
			DGSetItemValLong (dialId, 1,  0);// m_maxProgress);&lt;BR /&gt;
			break;&lt;BR /&gt;
	}&lt;BR /&gt;
	return (result);&lt;BR /&gt;
}		// Browser_CB&lt;BR /&gt;
&lt;BR /&gt;
void CProgressDG::setValue(long val)&lt;BR /&gt;
{&lt;BR /&gt;
	DGSetItemValLong (m_progBarRes, 1, val);&lt;BR /&gt;
}&lt;BR /&gt;
void CProgressDG::closeDG()&lt;BR /&gt;
{&lt;BR /&gt;
	DGModelessClose (m_progBarRes);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
************************************************************&lt;BR /&gt;
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:&lt;BR /&gt;
&lt;BR /&gt;
	dialID = DGModelessInit (m_progBarRes, CProgressDG::progressBarCallBack,(DGUserData) this,1);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
1&amp;gt;..\..\..\..\..\..\_Common\OnumaCommon\CommonProgressDG.cpp(18) : error C2664: 'DGModelessInit' : cannot convert parameter 2 from 'short (__cdecl *)(short,short,short,long,long)' to 'const DGDialCallBack' &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Please help.</description>
      <pubDate>Tue, 10 Aug 2010 08:48:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/DGModelessInit-cannot-convert-parameter-2-in-x64-window/m-p/187709#M6068</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-08-10T08:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: 'DGModelessInit' : cannot convert parameter 2 in x64 win</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/DGModelessInit-cannot-convert-parameter-2-in-x64-window/m-p/187710#M6069</link>
      <description>&lt;BLOCKQUOTE&gt;ALFREDMAN wrote:&lt;BR /&gt;This is a very simple code snip that shows how it fails to work in my case:&lt;/BLOCKQUOTE&gt;
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 &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;Navigator_test&lt;E&gt;&lt;/E&gt; - it includes a call to &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;DGModelessInit&lt;E&gt;&lt;/E&gt; and compiles for a x64 target without problems.&lt;BR /&gt;
&lt;BR /&gt;
BTW - I notice you are still using the &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;long&lt;E&gt;&lt;/E&gt; data type in your code. As part of the migration to 64-bit, I would be more explicit about the required integer width (Int32, Int64, etc).</description>
      <pubDate>Tue, 10 Aug 2010 16:05:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/DGModelessInit-cannot-convert-parameter-2-in-x64-window/m-p/187710#M6069</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2010-08-10T16:05:03Z</dc:date>
    </item>
  </channel>
</rss>

