<?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: CreateDialog() fails (Win32 dialog creation function) in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/CreateDialog-fails-Win32-dialog-creation-function/m-p/80079#M7428</link>
    <description>&lt;BLOCKQUOTE&gt;csh wrote:&lt;BR /&gt;//&lt;BR /&gt;
// Win32 modeless dialog creation code starts here...&lt;BR /&gt;
	DWORD error;&lt;BR /&gt;
&lt;BR /&gt;
	if (hwnd == NULL) {&lt;BR /&gt;
		hwnd = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_FORMVIEW), NULL, (DLGPROC)DlgProc);&lt;BR /&gt;
  		if (hwnd == NULL) {&lt;BR /&gt;
			error = GetLastError();&lt;BR /&gt;
		} else {&lt;BR /&gt;
			ShowWindow(hwnd, SW_SHOW); &lt;BR /&gt;
		}&lt;BR /&gt;
	}&lt;BR /&gt;
// Win32 modeless dialog creation code ends here...&lt;BR /&gt;
//&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
hwnd == NULL and error == 1814 ("The specified resource name cannot be found in the image file").  Any ideas on why I can't create the dialog via the resource mechanism?&lt;BR /&gt;
&lt;BR /&gt;
thanks in advance, Chuck&lt;/BLOCKQUOTE&gt;

I think even if you used the Windows native dialogs, you'd still have to set the resource module to the add-on using ACAPI_UseOwnResModule. But first check if the resource is really there by opening the compiled add-on in resource view.&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
&lt;BR /&gt;
Akos</description>
    <pubDate>Fri, 22 Jun 2007 07:58:58 GMT</pubDate>
    <dc:creator>Akos Somorjai</dc:creator>
    <dc:date>2007-06-22T07:58:58Z</dc:date>
    <item>
      <title>CreateDialog() fails (Win32 dialog creation function)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/CreateDialog-fails-Win32-dialog-creation-function/m-p/80078#M7427</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Instead of creating a User Control, for various reasons, I want to launch a modeless dialog box using CreateDialog(). I've created a dialog (IDD_FORMVIEW) in the resource file (note that there is an *.rc2 file, but when you create a dialog, an *.rc file is created along with resource.h), added the resource.h file to my cpp file, and modified the entry point in my cpp file as follows:&lt;BR /&gt;&lt;BR /&gt;static void Do_APIMyAddOn (void)&lt;BR /&gt;{&lt;BR /&gt;/*&lt;BR /&gt;// ArchiCAD API modeless dialog code starts here...&lt;BR /&gt;GSResModule actResModule = ACAPI_UseOwnResModule ();&lt;BR /&gt;&lt;BR /&gt;myAddOnDialID = DGModelessInit (MYADDON_ID, APIMyAddOn_Handler, NULL, 1);&lt;BR /&gt;ACAPI_ResetResModule (actResModule);&lt;BR /&gt;// ArchiCAD API modeless dialog code ends here...&lt;BR /&gt;*/&lt;BR /&gt;&lt;BR /&gt;//&lt;BR /&gt;// Win32 modeless dialog creation code starts here...&lt;BR /&gt;DWORD error;&lt;BR /&gt;&lt;BR /&gt;if (hwnd == NULL) {&lt;BR /&gt;hwnd = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_FORMVIEW), NULL, (DLGPROC)DlgProc);&lt;BR /&gt;if (hwnd == NULL) {&lt;BR /&gt;error = GetLastError();&lt;BR /&gt;} else {&lt;BR /&gt;ShowWindow(hwnd, SW_SHOW); &lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;// Win32 modeless dialog creation code ends here...&lt;BR /&gt;//&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;hwnd == NULL and error == 1814 ("The specified resource name cannot be found in the image file"). Any ideas on why I can't create the dialog via the resource mechanism?&lt;BR /&gt;&lt;BR /&gt;thanks in advance, Chuck&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Aug 2023 08:34:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/CreateDialog-fails-Win32-dialog-creation-function/m-p/80078#M7427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-07T08:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: CreateDialog() fails (Win32 dialog creation function)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/CreateDialog-fails-Win32-dialog-creation-function/m-p/80079#M7428</link>
      <description>&lt;BLOCKQUOTE&gt;csh wrote:&lt;BR /&gt;//&lt;BR /&gt;
// Win32 modeless dialog creation code starts here...&lt;BR /&gt;
	DWORD error;&lt;BR /&gt;
&lt;BR /&gt;
	if (hwnd == NULL) {&lt;BR /&gt;
		hwnd = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_FORMVIEW), NULL, (DLGPROC)DlgProc);&lt;BR /&gt;
  		if (hwnd == NULL) {&lt;BR /&gt;
			error = GetLastError();&lt;BR /&gt;
		} else {&lt;BR /&gt;
			ShowWindow(hwnd, SW_SHOW); &lt;BR /&gt;
		}&lt;BR /&gt;
	}&lt;BR /&gt;
// Win32 modeless dialog creation code ends here...&lt;BR /&gt;
//&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
hwnd == NULL and error == 1814 ("The specified resource name cannot be found in the image file").  Any ideas on why I can't create the dialog via the resource mechanism?&lt;BR /&gt;
&lt;BR /&gt;
thanks in advance, Chuck&lt;/BLOCKQUOTE&gt;

I think even if you used the Windows native dialogs, you'd still have to set the resource module to the add-on using ACAPI_UseOwnResModule. But first check if the resource is really there by opening the compiled add-on in resource view.&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
&lt;BR /&gt;
Akos</description>
      <pubDate>Fri, 22 Jun 2007 07:58:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/CreateDialog-fails-Win32-dialog-creation-function/m-p/80079#M7428</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2007-06-22T07:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: CreateDialog() fails (Win32 dialog creation function)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/CreateDialog-fails-Win32-dialog-creation-function/m-p/80080#M7429</link>
      <description>Here's are the parameters that make it work:&lt;BR /&gt;
&lt;BR /&gt;
		hwnd = CreateDialog(ACAPI_GetExtensionInstance (), MAKEINTRESOURCE(IDD_DIALOG1), ACAPI_GetMainWindow (), (DLGPROC)DlgProc);&lt;BR /&gt;
&lt;BR /&gt;
(Substitute your own IDD and procedure for my IDD_DIALOG1 and DlgProc respectively).&lt;BR /&gt;
&lt;BR /&gt;
thanks, Chuck</description>
      <pubDate>Sat, 07 Jul 2007 13:57:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/CreateDialog-fails-Win32-dialog-creation-function/m-p/80080#M7429</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-07-07T13:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: CreateDialog() fails (Win32 dialog creation function)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/CreateDialog-fails-Win32-dialog-creation-function/m-p/80081#M7430</link>
      <description>Hello,  &lt;BR /&gt;
  &lt;BR /&gt;
I've took working example plugin from ArchiCAD SDK, and add code which should open dialog box (as shown below). But each time I use any of &amp;lt;windows.h&amp;gt; functions ArchiCAD crashes with out any understable and visible error for me. Bug reporting tool opens, and that's all of my dialog box. Application exits after it shows a border of my dialog box. Buttons inside dialog are invisible. What could be wrong? I use ArchiCAD 10 and sdk 10. Changed plugin name: Automate_Functions (added one position to menu):  
&lt;PRE&gt;HWND _win;  
  
BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)  
{  
	return FALSE;  
}  
  
static void Do_Window()  
{  
	_win = CreateDialog(ACAPI_GetExtensionInstance (), MAKEINTRESOURCE(IDD_DIALOG1), ACAPI_GetMainWindow(), (DLGPROC)DialogProc);   
	//ACAPI_GetExtensionInstance();  
	//ACAPI_GetMainWindow();  
	if(_win != NULL)  
		ShowWindow(_win, SW_SHOW);  
}&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
best regards</description>
      <pubDate>Sat, 18 Aug 2007 12:32:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/CreateDialog-fails-Win32-dialog-creation-function/m-p/80081#M7430</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-18T12:32:31Z</dc:date>
    </item>
  </channel>
</rss>

