<?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 Re: Modal to Modeless in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175391#M6313</link>
    <description>&lt;BLOCKQUOTE&gt;What about the stack trace? This will tell you where the crash occurred and - more importantly - the call sequence leading up to it.&lt;/BLOCKQUOTE&gt;

Call stack:&lt;BR /&gt;
&lt;BR /&gt;
0x0000000180004870!ArchiCAD.exe + -2147465104&lt;BR /&gt;
0x000000005FCA6ADB!DG.dll + 748251 (DGGetDialogResourceModule + 923 bytes)&lt;BR /&gt;
0x000000005FC8DBF9!DG.dll + 646137 (DGEndProcessEvents + 3113 bytes)&lt;BR /&gt;
0x000000005FC8FECD!DG.dll + 655053 (DGEnableMessage + 2345 bytes)&lt;BR /&gt;
0x000000005FC90FEB!DG.dll + 659435 (DGBeginProcessEvents + 4347 bytes)&lt;BR /&gt;
0x000000005FCC7016!DG.dll + 880662 (DGSetModelessDialogState + 554 bytes)&lt;BR /&gt;
0x0000000077368971!USER32.dll + 100721 (GetWindowDC + 129 bytes)&lt;BR /&gt;
0x00000000773672CB!USER32.dll + 94923 (SetWindowTextW + 631 bytes)&lt;BR /&gt;
0x0000000077366829!USER32.dll + 92201 (IsDialogMessageW + 361 bytes)&lt;BR /&gt;
0x00000000776B1225!ntdll.dll + 332325 (KiUserCallbackDispatcher + 31 bytes)&lt;BR /&gt;
0x000000007736685A!USER32.dll + 92250 (IsDialogMessageW + 410 bytes)&lt;BR /&gt;
0x0000000077363838!USER32.dll + 79928 (GetWindowLongPtrA + 120 bytes)&lt;BR /&gt;
0x0000000077366BAD!USER32.dll + 93101 (SendMessageW + 93 bytes)&lt;BR /&gt;
0x000007FEFC31645C!UxTheme.dll + 25692 (DrawThemeParentBackgroundEx + 340 bytes)&lt;BR /&gt;
0x000007FEFC762D80!COMCTL32.dll + 667008&lt;BR /&gt;
0x00000000127D5740!UNKNOWN_MODULE&lt;BR /&gt;
0xFFFFFFFFF7011F90!UNKNOWN_MODULE&lt;BR /&gt;
0x0000000000000001!ArchiCAD.exe + 1&lt;BR /&gt;
0x000000000012EED8!UNKNOWN_MODULE&lt;BR /&gt;
0x000000000012EEF8!UNKNOWN_MODULE&lt;BR /&gt;
0x00000000026FE270!UNKNOWN_MODULE&lt;BR /&gt;
0x000000000012EE01!UNKNOWN_MODULE&lt;BR /&gt;
0x0000000100000001!ArchiCAD.exe + 1&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;Just to confirm - have you changed the dialog resources in these tests to identify it as a palette rather than a modeless dialog?&lt;/BLOCKQUOTE&gt;

'GDLG'  32540    &lt;FONT color="red"&gt;Modeless&lt;/FONT&gt;        0    0  320  250  "Prueba"  {&lt;BR /&gt;
&lt;BR /&gt;
/*1*/		Button		  190 255 80   20  LargePlain   "Aceptar"&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
'DLGH'  32540  DLG_32540_Modeless {	&lt;BR /&gt;
&lt;BR /&gt;
1	""	Button_0&lt;BR /&gt;
&lt;BR /&gt;
}</description>
    <pubDate>Thu, 15 Sep 2011 12:40:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-09-15T12:40:03Z</dc:date>
    <item>
      <title>Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175382#M6304</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi developers,&lt;BR /&gt;&lt;BR /&gt;I have alredy made an aplicattion who works properly with a Modal Dialog. Now, i would like to change this modal dialog into a Modeless one. But i have found some problems, due to when i run the API i can not interact with the Dialog and in few seconds, the application closes and error report starts. I have read the Developer's Manual and i can not see the problem. This is my function:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;filNum = ACAPI_UseOwnResModule (); // Set own resource file the active one&lt;BR /&gt;//isOK = (DGModalDialog(CalcEnerMin_GDLGID, CalcEnerMinDlgCallBack,0) == DG_OK);&lt;BR /&gt;&lt;FONT color="red"&gt;DGModelessInit(CalcEnerMin_GDLGID, CalcEnerMinDlgCallBack,0,1);&lt;/FONT&gt;&lt;BR /&gt;ACAPI_ResetResModule (filNum);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And here the GRC code:&lt;BR /&gt;&lt;BR /&gt;'GDLG' 32530 Modeless 0 0 570 620 "Modeless"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have also read something about the function "DGModelessHandler" but i am not sure if i should use it or not and how it works.&lt;BR /&gt;&lt;BR /&gt;I will be really grateful if somebody could help me.&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Aug 2023 07:36:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175382#M6304</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-03T07:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175383#M6305</link>
      <description>&lt;BLOCKQUOTE&gt;frankito5 wrote:&lt;BR /&gt;I have alredy made an aplicattion who works properly with a Modal Dialog. Now, i would like to change this modal dialog into a Modeless one. But i have found some problems, due  to when i run the API i can not interact with the Dialog and in few seconds, the application closes and error report starts.&lt;/BLOCKQUOTE&gt;
Try making the dialog a palette rather than a modeless dialog - I believe there may still be underlying problems registering a modeless dialog correctly from the API.&lt;BR /&gt;
&lt;BR /&gt;
Did you find the documentation for &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;? That explains pretty much everything you need to know. Also, take a look at &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;DGShowModelessDialog&lt;E&gt;&lt;/E&gt;</description>
      <pubDate>Tue, 13 Sep 2011 10:35:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175383#M6305</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2011-09-13T10:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175384#M6306</link>
      <description>The first i did was read the manual. But i have tried in some ways but without success, that's why i'm asking to expert developers! I have tested it with two different options:&lt;BR /&gt;
&lt;BR /&gt;
static void		Prueba_Modeless (void){	&lt;BR /&gt;
	&lt;BR /&gt;
	GSResModule	filNum;&lt;BR /&gt;
	short modelessID;&lt;BR /&gt;
	&lt;BR /&gt;
	filNum = ACAPI_UseOwnResModule ();		// Set own resource file the active one&lt;BR /&gt;
	&lt;FONT color="green"&gt;//modelessID = DGModelessInit(Modeless_GDLGID, ModelessDlgCallBack, 0, 0);&lt;/FONT&gt;&lt;BR /&gt;
	modelessID = &lt;FONT color="red"&gt;DGCreateBlankModelessDialog(320,250,DG_DLG_NOGROW,DG_DLG_CLOSE,DG_DLG_MINIMIZE,DG_DLG_MAXIMIZE,DG_DLG_NOCAPTION,DG_DLG_THICKFRAME,ModelessDlgCallBack,0);&lt;/FONT&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	if(modelessID != 0){&lt;BR /&gt;
		DGBeginProcessEvents(modelessID);&lt;BR /&gt;
		DGShowModelessDialog(modelessID, DG_DF_FIRST);&lt;BR /&gt;
	}&lt;BR /&gt;
&lt;BR /&gt;
	ACAPI_ResetResModule (filNum);&lt;BR /&gt;
&lt;BR /&gt;
	return;&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
With the red one i have compiling problems(i can not understand it). The same if i try with the Palette instead of Modeless as u suggested me:&lt;BR /&gt;
&lt;BR /&gt;
DG_Test.obj : error LNK2019: símbolo externo __imp_DGCreateBlankModelessDialog sin resolver al que se hace referencia en la función "void __cdecl Prueba_Modeless(void)" (?Prueba_Modeless@@YAXXZ)&lt;BR /&gt;
&lt;BR /&gt;
With the green one, the Dialog appears but i cant operate or move it and in few seconds, bug problems dialog appear and archiCAD closes. &lt;BR /&gt;
&lt;BR /&gt;
Am i forgetting something &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_sad.gif" style="display : inline;" /&gt; ??</description>
      <pubDate>Wed, 14 Sep 2011 11:46:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175384#M6306</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-14T11:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175385#M6307</link>
      <description>&lt;BLOCKQUOTE&gt;frankito5 wrote:&lt;BR /&gt;With the green one, the Dialog appears but i cant operate or move it and in few seconds, bug problems dialog appear and archiCAD closes.&lt;/BLOCKQUOTE&gt;
Have you determined where the crash is occurring (e.g. with the debugger)?</description>
      <pubDate>Wed, 14 Sep 2011 14:00:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175385#M6307</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2011-09-14T14:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175386#M6308</link>
      <description>Yes, but i don't know where exaclty is the problem. Anyway, i have tried in an API developement Kit example(DG_Test) just changing the Modeless rather than the Modal dialog and the same problem happen.&lt;BR /&gt;
&lt;BR /&gt;
I have printed some values to know where the program crashes but everything seems good. I show it:&lt;BR /&gt;
&lt;BR /&gt;
static void		Prueba_Modeless (void){	&lt;BR /&gt;
	&lt;BR /&gt;
	GSResModule	filNum;&lt;BR /&gt;
	short modelessID;&lt;BR /&gt;
	&lt;BR /&gt;
	ofstream mod("modeless.txt");&lt;BR /&gt;
&lt;BR /&gt;
	filNum = ACAPI_UseOwnResModule ();		// Set own resource file the active one&lt;BR /&gt;
	&lt;BR /&gt;
	modelessID = DGModelessInit(Modeless_GDLGID, ModelessDlgCallBack, 0, 0);&lt;BR /&gt;
	&lt;FONT color="red"&gt;mod &amp;lt;&amp;lt; "Create Dialog " &amp;lt;&amp;lt; modelessID &amp;lt;&amp;lt; endl;&lt;/FONT&gt;&lt;BR /&gt;
&lt;BR /&gt;
	//modelessID = DGCreateBlankModelessDialog(320,250,DG_DLG_NOGROW,DG_DLG_CLOSE,DG_DLG_MINIMIZE,DG_DLG_MAXIMIZE,DG_DLG_NOCAPTION,DG_DLG_THICKFRAME,ModelessDlgCallBack,0);&lt;BR /&gt;
	&lt;BR /&gt;
	if(modelessID != 0){&lt;BR /&gt;
		DGBeginProcessEvents(modelessID);&lt;BR /&gt;
		&lt;FONT color="red"&gt;mod &amp;lt;&amp;lt; "Begin process" &amp;lt;&amp;lt; endl;&lt;/FONT&gt;&lt;BR /&gt;
		DGShowModelessDialog(modelessID, DG_DF_FIRST);&lt;BR /&gt;
		&lt;FONT color="red"&gt;mod &amp;lt;&amp;lt; "Show Dialog" &amp;lt;&amp;lt; endl;&lt;/FONT&gt;&lt;BR /&gt;
	}&lt;BR /&gt;
&lt;BR /&gt;
	ACAPI_ResetResModule (filNum);&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;FONT color="red"&gt;mod &amp;lt;&amp;lt; "Reset Module" &amp;lt;&amp;lt; endl;&lt;/FONT&gt;&lt;BR /&gt;
&lt;BR /&gt;
	return;&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
Here, all the sentences are written in the .TXT file and also the value of the Dialog(32540 in this case). It means, the Dialog is created without any problem.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
static short DGCALLBACK		ModelessDlgCallBack (short message, short dialId, short itemId,&lt;BR /&gt;
												 DGUserData /*userData*/, DGMessageData /*msgData*/){&lt;BR /&gt;
	&lt;BR /&gt;
	short alto=0, ancho=0;&lt;BR /&gt;
	itemId=itemId;&lt;BR /&gt;
	ofstream mod2("modelessCall.txt");&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;FONT color="red"&gt;mod2 &amp;lt;&amp;lt; "START" &amp;lt;&amp;lt; endl;&lt;/FONT&gt;&lt;BR /&gt;
&lt;BR /&gt;
	switch (message) {&lt;BR /&gt;
			case DG_MSG_INIT:&lt;BR /&gt;
				&lt;FONT color="red"&gt;mod2 &amp;lt;&amp;lt; "INIT" &amp;lt;&amp;lt; endl;&lt;/FONT&gt;&lt;BR /&gt;
				DGGetDialogSize (dialId, DG_ORIGFRAME, &amp;amp;ancho, &amp;amp;alto);&lt;BR /&gt;
				//void DGSetDialogSize (short dialId,short rectType,short hSize,short vSize,short fixPoint,bool keepOld);&lt;BR /&gt;
				//DGSetDialogSize (dialId, DG_CLIENT, ancho, alto, DG_TOPLEFT, true);&lt;BR /&gt;
				break;&lt;BR /&gt;
			case DG_MSG_CLOSE:&lt;BR /&gt;
				mod2 &amp;lt;&amp;lt; "CLOSE" &amp;lt;&amp;lt; endl;&lt;BR /&gt;
				break;&lt;BR /&gt;
			case DG_MSG_CHANGE:&lt;BR /&gt;
				mod2 &amp;lt;&amp;lt; "CHANGE" &amp;lt;&amp;lt; endl;&lt;BR /&gt;
				break;&lt;BR /&gt;
			case DG_MSG_CLICK:&lt;BR /&gt;
				mod2 &amp;lt;&amp;lt; "CLICK" &amp;lt;&amp;lt; endl;&lt;BR /&gt;
				break;&lt;BR /&gt;
		}	&lt;BR /&gt;
		&lt;BR /&gt;
	&lt;FONT color="red"&gt;mod2 &amp;lt;&amp;lt; "EXIT" &amp;lt;&amp;lt; endl;&lt;/FONT&gt;&lt;BR /&gt;
&lt;BR /&gt;
	return(0);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Here, START and EXIT are written. It's supossed INIT has to appear also, but i think it does not because of the callback behaviour. But i have tried to comment 'DGSetDialogSize ' and the Dialog really dont change the size so it get into INIT case.&lt;BR /&gt;
&lt;BR /&gt;
I think i am forgetting something in the Callback, but i am not sure. Could be something related with the 'DGModelessHandler'? It converts the system messages in DG messages but i don't know it is necessary. Some suggestions? I am blocked and i do not know how to continue &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_sad.gif" style="display : inline;" /&gt;&lt;BR /&gt;
&lt;BR /&gt;
THANKS</description>
      <pubDate>Thu, 15 Sep 2011 08:06:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175386#M6308</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-15T08:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175387#M6309</link>
      <description>&lt;BLOCKQUOTE&gt;frankito5 wrote:&lt;BR /&gt;I think i am forgetting something in the Callback, but i am not sure. Could be something related with the 'DGModelessHandler'? It converts the system messages in DG messages but i don't know it is necessary. Some suggestions? I am blocked and i do not know how to continue &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_sad.gif" style="display : inline;" /&gt;&lt;/BLOCKQUOTE&gt;
Sorry, I can't pinpoint what's going wrong here. There are some redundancies in your code, but they wouldn't cause a crash, e.g. the following does nothing:&lt;PRE&gt;itemId=itemId;&lt;/PRE&gt;
...and it is unnecessary to call &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;DGBeginProcessEvents&lt;E&gt;&lt;/E&gt; because &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; does this for you.&lt;BR /&gt;
&lt;BR /&gt;
I think it is very important to determine the point where the add-on crashes - it may have nothing to do with the dialog. The stack trace could provide important clues to the reason for the failure. I'm surprised the debugger isn't trapping the crash - are you sure you're running the debug version and have at least one breakpoint set? If you're debugging with Visual Studio, it might also be useful to turn on all the runtime checks too.</description>
      <pubDate>Thu, 15 Sep 2011 09:07:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175387#M6309</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2011-09-15T09:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175388#M6310</link>
      <description>&lt;BLOCKQUOTE&gt;Ralph wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;frankito5 wrote:&lt;BR /&gt;
&lt;BR /&gt;
I think it is very important to determine the point where the add-on crashes - it may have nothing to do with the dialog. The stack trace could provide important clues to the reason for the failure. I'm surprised the debugger isn't trapping the crash - are you sure you're running the debug version and have at least one breakpoint set? If you're debugging with Visual Studio, it might also be useful to turn on all the runtime checks too.&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;

&lt;BR /&gt;
I will try to find it, but i'm sure is something about dialog modes, because the same add-on works properly with Modal Dialog. If you have time, check it in the API Development Kit 14 in the DG_TEST example. Try to change one Modal Dialog to a Modeless and you will see the same problem(I have alredy checked it). That's why i can't understand the problem...</description>
      <pubDate>Thu, 15 Sep 2011 10:21:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175388#M6310</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-15T10:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175389#M6311</link>
      <description>When im debugging, the report gives the following information:&lt;BR /&gt;
&lt;BR /&gt;
Exception code: C0000005 ACCESS_VIOLATION writing location: 0000000180004860&lt;BR /&gt;
Primera excepción en 0x76fccb23 en ArchiCAD.exe: 0xC0000005: Infracción de acceso al leer la ubicación 0x0000000180004860.&lt;BR /&gt;
Fault address:  0000000180004860 (ILLEGAL)&lt;BR /&gt;
&lt;BR /&gt;
I can't see info with the breakpoints because when y press f5, arhiCAD runs and when i open de addON from the Menu, the dialog appears and in few seconds archiCAD is closed and also de debugger mode. &lt;BR /&gt;
&lt;BR /&gt;
Now, could you give me more information about possible solutions??</description>
      <pubDate>Thu, 15 Sep 2011 11:23:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175389#M6311</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-15T11:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175390#M6312</link>
      <description>&lt;BLOCKQUOTE&gt;frankito5 wrote:&lt;BR /&gt;When im debugging, the report gives the following information:[]&lt;BR /&gt;
Now, could you give me more information about possible solutions??&lt;/BLOCKQUOTE&gt;
What about the stack trace? This will tell you where the crash occurred and - more importantly - the call sequence leading up to it.&lt;BR /&gt;
&lt;BR /&gt;
Just to confirm - have you changed the dialog resources in these tests to identify it as a palette rather than a modeless dialog?</description>
      <pubDate>Thu, 15 Sep 2011 12:07:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175390#M6312</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2011-09-15T12:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175391#M6313</link>
      <description>&lt;BLOCKQUOTE&gt;What about the stack trace? This will tell you where the crash occurred and - more importantly - the call sequence leading up to it.&lt;/BLOCKQUOTE&gt;

Call stack:&lt;BR /&gt;
&lt;BR /&gt;
0x0000000180004870!ArchiCAD.exe + -2147465104&lt;BR /&gt;
0x000000005FCA6ADB!DG.dll + 748251 (DGGetDialogResourceModule + 923 bytes)&lt;BR /&gt;
0x000000005FC8DBF9!DG.dll + 646137 (DGEndProcessEvents + 3113 bytes)&lt;BR /&gt;
0x000000005FC8FECD!DG.dll + 655053 (DGEnableMessage + 2345 bytes)&lt;BR /&gt;
0x000000005FC90FEB!DG.dll + 659435 (DGBeginProcessEvents + 4347 bytes)&lt;BR /&gt;
0x000000005FCC7016!DG.dll + 880662 (DGSetModelessDialogState + 554 bytes)&lt;BR /&gt;
0x0000000077368971!USER32.dll + 100721 (GetWindowDC + 129 bytes)&lt;BR /&gt;
0x00000000773672CB!USER32.dll + 94923 (SetWindowTextW + 631 bytes)&lt;BR /&gt;
0x0000000077366829!USER32.dll + 92201 (IsDialogMessageW + 361 bytes)&lt;BR /&gt;
0x00000000776B1225!ntdll.dll + 332325 (KiUserCallbackDispatcher + 31 bytes)&lt;BR /&gt;
0x000000007736685A!USER32.dll + 92250 (IsDialogMessageW + 410 bytes)&lt;BR /&gt;
0x0000000077363838!USER32.dll + 79928 (GetWindowLongPtrA + 120 bytes)&lt;BR /&gt;
0x0000000077366BAD!USER32.dll + 93101 (SendMessageW + 93 bytes)&lt;BR /&gt;
0x000007FEFC31645C!UxTheme.dll + 25692 (DrawThemeParentBackgroundEx + 340 bytes)&lt;BR /&gt;
0x000007FEFC762D80!COMCTL32.dll + 667008&lt;BR /&gt;
0x00000000127D5740!UNKNOWN_MODULE&lt;BR /&gt;
0xFFFFFFFFF7011F90!UNKNOWN_MODULE&lt;BR /&gt;
0x0000000000000001!ArchiCAD.exe + 1&lt;BR /&gt;
0x000000000012EED8!UNKNOWN_MODULE&lt;BR /&gt;
0x000000000012EEF8!UNKNOWN_MODULE&lt;BR /&gt;
0x00000000026FE270!UNKNOWN_MODULE&lt;BR /&gt;
0x000000000012EE01!UNKNOWN_MODULE&lt;BR /&gt;
0x0000000100000001!ArchiCAD.exe + 1&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;Just to confirm - have you changed the dialog resources in these tests to identify it as a palette rather than a modeless dialog?&lt;/BLOCKQUOTE&gt;

'GDLG'  32540    &lt;FONT color="red"&gt;Modeless&lt;/FONT&gt;        0    0  320  250  "Prueba"  {&lt;BR /&gt;
&lt;BR /&gt;
/*1*/		Button		  190 255 80   20  LargePlain   "Aceptar"&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
'DLGH'  32540  DLG_32540_Modeless {	&lt;BR /&gt;
&lt;BR /&gt;
1	""	Button_0&lt;BR /&gt;
&lt;BR /&gt;
}</description>
      <pubDate>Thu, 15 Sep 2011 12:40:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175391#M6313</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-15T12:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175392#M6314</link>
      <description>&lt;BLOCKQUOTE&gt;frankito5 wrote:&lt;BR /&gt;'GDLG'  32540    &lt;FONT color="red"&gt;Modeless&lt;/FONT&gt;        0    0  320  250  "Prueba"&lt;/BLOCKQUOTE&gt;
Have you tried making it a Palette? In the past, Modeless could crash because it wasn't correctly registered in ArchiCAD. I don't know if this has been corrected, but I would certainly try Palette instead.</description>
      <pubDate>Thu, 15 Sep 2011 13:23:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175392#M6314</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2011-09-15T13:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175393#M6315</link>
      <description>&lt;BLOCKQUOTE&gt;Ralph wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;frankito5 wrote:&lt;BR /&gt;'GDLG'  32540    &lt;FONT color="red"&gt;Modeless&lt;/FONT&gt;        0    0  320  250  "Prueba"&lt;/BLOCKQUOTE&gt;
Have you tried making it a Palette? In the past, Modeless could crash because it wasn't correctly registered in ArchiCAD. I don't know if this has been corrected, but I would certainly try Palette instead.&lt;/BLOCKQUOTE&gt;

Yes, i've tried and i just can see one difference. The outline of the Dialog seems diferent(exactly like modal dialog) but in few seconds the crash comes. &lt;BR /&gt;
&lt;BR /&gt;
To be honest, i'm starting to think is a problem with Modeless and Palettes in archiCAD. I have tried with all the possibilites, and is not normal it works with Modal mode and, if i'm not forgetting anything, it does not work with modeless or palettes. Have you tried to create a Modeless dialog instead a Modal one? &lt;BR /&gt;
&lt;BR /&gt;
Moreover, when i try to use different comands like 'DGCreatePalette' i have library problems(no idea):&lt;BR /&gt;
&lt;BR /&gt;
&lt;FONT color="red"&gt;1&amp;gt;DG_Test.obj : error LNK2019: símbolo externo __imp_DGCreatePalette sin resolver al que se hace referencia en la función "void __cdecl Prueba_Modeless(void)" (?Prueba_Modeless@@YAXXZ)&lt;BR /&gt;
1&amp;gt;x64\Release\DG_Test.apx : fatal error LNK1120: 1 externos sin resolver&lt;/FONT&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Anyway, maybe we can solve it by other way. Imagine i make a calculation in the Add-on about how many lines i have to draw. The problem is, when i'm working with a Modal dialogue i can't get this value and draw them. I have to close the dialog to draw this lines but if i close it i lose this value. Do you have an alternative?</description>
      <pubDate>Fri, 16 Sep 2011 08:21:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175393#M6315</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-16T08:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175394#M6316</link>
      <description>I dont know the reason. &lt;BR /&gt;
Personally I use the Class implementation of DG module.&lt;BR /&gt;
Just an idea.&lt;BR /&gt;
&lt;BR /&gt;
Your AddOn should be "keep in memory" if you use a modeless or palette. &lt;BR /&gt;
Else it will unloaded and dialog handler will invalid.&lt;BR /&gt;
I think, you need to use ACAPI_RegisterModelessWindow, so I think, API will keep your AddOn in memory automatically.&lt;BR /&gt;
Or try for test ACAPI_KeepInMemory.&lt;BR /&gt;
&lt;BR /&gt;
PS: Sorry my poor English</description>
      <pubDate>Fri, 16 Sep 2011 08:53:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175394#M6316</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2011-09-16T08:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175395#M6317</link>
      <description>&lt;BLOCKQUOTE&gt;Oleg wrote:&lt;BR /&gt;Your AddOn should be "keep in memory" if you use a modeless or palette. &lt;BR /&gt;
Else it will unloaded and dialog handler will invalid.&lt;/BLOCKQUOTE&gt;
Yes - that is probably the cause.</description>
      <pubDate>Fri, 16 Sep 2011 20:04:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175395#M6317</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2011-09-16T20:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175396#M6318</link>
      <description>&lt;BLOCKQUOTE&gt;I think, you need to use ACAPI_RegisterModelessWindow, so I think, API will keep your AddOn in memory automatically.
&lt;/BLOCKQUOTE&gt;

Where i should call this function?&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;Or try for test ACAPI_KeepInMemory.&lt;/BLOCKQUOTE&gt;

I have used this function and i got my goal even i still can't manage it from a modeless dialog but now i can link objects with the dialog(THANK YOU &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;). Last thing, i would like to know something new.  I have drawn my own objects from my API and i would like to modify some attributes from my API. Which is the structure i have to modify? I've tried&lt;FONT color="red"&gt; element.objetct.x&lt;/FONT&gt; where 'x' is the attribute to modify. But the attributes which i would like to modify are recently created by myself and i don't know which and where is the structure i have to handle.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
There is some information in about in the Manual?</description>
      <pubDate>Mon, 19 Sep 2011 06:42:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175396#M6318</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-19T06:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175397#M6319</link>
      <description>&lt;BLOCKQUOTE&gt;frankito5 wrote:&lt;BR /&gt;Where i should call ACAPI_RegisterModelessWindow?&lt;/BLOCKQUOTE&gt;
From the documentation: &lt;BLOCKQUOTE&gt;call it from the DG_MSG_INIT section of your palette's callback&lt;/BLOCKQUOTE&gt;

&lt;BLOCKQUOTE&gt;frankito5 wrote:&lt;BR /&gt;I have drawn my own objects from my API and i would like to modify some attributes from my API. Which is the structure i have to modify? I've tried&lt;FONT color="red"&gt; element.objetct.x&lt;/FONT&gt; where 'x' is the attribute to modify. But the attributes which i would like to modify are recently created by myself and i don't know which and where is the structure i have to handle.&lt;/BLOCKQUOTE&gt;
Could you start this question on a new topic? Someone else might have the same question in future, and it will be much easier to find with under a specific title.&lt;BR /&gt;
&lt;BR /&gt;
Can you expand on the question a bit too? When you say &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;attributes&lt;E&gt;&lt;/E&gt;, do you mean layers, pens, etc? Do you want to know how to save the object after the changes have been made?</description>
      <pubDate>Mon, 19 Sep 2011 11:56:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175397#M6319</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2011-09-19T11:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Modal to Modeless</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175398#M6320</link>
      <description>Alredy postted in the Developer forum. I hope it can help also to other beginner developers.</description>
      <pubDate>Tue, 20 Sep 2011 12:02:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modal-to-Modeless/m-p/175398#M6320</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-20T12:02:09Z</dc:date>
    </item>
  </channel>
</rss>

