void dialogCreate() { acutPrintf("\nAcUi Dialog Sample"); }
The following addCommand() call uses the module resource instance from the AC_IMPLEMENT_EXTENSION_MODULE macro:
static void initApp() { CAcModuleResourceOverride resOverride; acedRegCmds->addCommand( "ASDK_ACUI_SAMPLE", "ASDKACUISAMPLE", "ACUISAMPLE", ACRX_CMD_MODAL, dialogCreate, NULL, -1, theArxDLL.ModuleResourceInstance()); }
The following unloadApp() function is called when the application unloads. At this time it is important to detach the resource instance:
static void unloadApp() { // Do other cleanup tasks here acedRegCmds->removeGroup("ASDK_ACUI_SAMPLE"); theArxDLL.DetachInstance(); } // Entry point // extern "C" AcRx::AppRetCode acrxEntryPoint( AcRx::AppMsgCode msg, void* appId) { switch( msg ) { case AcRx::kInitAppMsg: acrxDynamicLinker->unlockApplication(appId); acrxDynamicLinker->registerAppMDIAware(appId); initApp(); break; case AcRx::kUnloadAppMsg: unloadApp(); break; case AcRx::kInitDialogMsg: break; default: break; } return AcRx::kRetOK; }
Create an AsdkAcUiSample.h header file and add the following lines to the file:
#include "resource.h" // main symbols #define PI 3.14159265359 // Forward declaration for the entry point function of // our application void testCreate();
Add the following include files to AsdkAcUiSample.cpp:
#include "AsdkAcUiSample.h" #include "AcExtensionModule.h"
You also need to add the ObjectARX libraries to the project file, change the .dll extension to .arx, and modify the .def file with the proper exports.
Then you can compile and load the application.