Issue
I have an ObjectARX User Interface (.ARX) module that is dependent on an ObjectDBX Object Enabler (.DBX) module. I link the .ARX module with the import library (.LIB) for the .DBX, but even though the .DBX demand-loads correctly on proxy detection, the .ARX will not demand-load on command invocation and the following error occurs:
"MyApplication.arx cannot find a DLL or other file that it needs."
This works correctly if I add the location of the .DBX to the Windows system path or install it into C:\Program Files\Common Files\Autodesk Shared, but I don't want to do this.
Solution
There is a mechanism available in Visual C++ called "delay loading". This mechanism allows you to link to a library via the standard DLL linking mechanism, but delays its initialization until required.
To specify that your .ARX delay-loads your .DBX, edit your .ARX project's linker settings as follows:
1. Add the delayimp.lib library file to the "Object/library modules" list.
2. Manually specify the setting, /delayload:"MyDbxModule.dbx, in the Project Options text box.
You can demand-load both the .ARX module and the .DBX without being constrained by the Windows system path. You will need to programmatically loadthe DBX application from the ARX application for this technique to work, therefore, use either acrxLoadMoudle() or acexDynamicLinker->loadModule()..
For more information, please refer to MSDN such as :