BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

Archicad C++ API
About Archicad add-on development using the C++ API.

[SOLVED] AC 18 DGModalDialog() arguments

Anonymous
Not applicable
Does anyone have more information about the changes to the DGModalDialog() call changes in the AC 18 SDK? I'm updating a plugin from 17 to 18 and the modal dialogs are blank. I'm assuming it's because I'm not passing in the correct values for the new resId and dialIconRexModule arguments. The API documentation is out-of-date and still shows the old 3-argument version.

This is prventing us from releasing a version of our plugin for AC 18. We need to get this resolved asap.

Thanks.

-larry
1 REPLY 1
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi Larry,
The API documentation is out-of-date and still shows the old 3-argument version.

We are working on it, and hope we can publish a new one in few months.

You can read the following in the documentation's "New features of the API" topic:
Resource chain is gone (also ACAPI_UseOwnResModule() and ACAPI_ResetResModule() along with it)
OS X internally maintained a stack of open resource files called the resource chain. Whenever you want to load a resource, the system searched downwards in this stack to find the resource in any of the open resource files below the current one. We removed that implicit mechanism; you'll have to specify each and every time the resource module explicitly (usually with ACAPI_GetOwnResModule()).


So when you are updating your Add-On from 17 to 18, first you should delete ACAPI_UseOwnResModule() and ACAPI_ResetResModule() calls, and after that fill the C style DG function calls new resource module parameters with API_GetOwnResModule().
DG_DLL_EXPORT short CCALL		DGModalDialog (GSResModule dialResModule, short resId, GSResModule dialIconResModule, const DGDialCallBack dCallBack, DGUserData userData);  
  
// Example:  
DGModalDialog (ACAPI_GetOwnResModule (), MyDialogResId, ACAPI_GetOwnResModule (), MyDialog_Handler, NULL);  

Regards,
Tibor
Learn and get certified!

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!