Use an instance of this class to switch between resource providers. When the object is constructed, a new resource provider will get switched in. Upon destruction, the original resource provider will be restored. The following code provides an example:
void MyFunc ()
{
CAcModuleResourceOverride myResources;
}
Upon entry to this function the module's resources will be selected. When the function returns, the default resources will be restored. A resource override can be selected in any of the following ways:
Two macros—AC_DECLARE_EXTENSION_MODULE and AC_IMPLEMENT_EXTENSION_MODULE—help define and implement the classes in your application.
The following code illustrates how to make use of the CAcExtensionModule and CAcModuleResourceOverride classes in an ObjectARX application:
AC_IMPLEMENT_EXTENSION_MODULE(theArxDLL);
HINSTANCE _hdllInstance = NULL;
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Remove this if you use lpReserved
UNREFERENCED_PARAMETER(lpReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
theArxDLL.AttachInstance(hInstance);
hdllInstance = hInstance;
}
else if (dwReason == DLL_PROCESS_DETACH)
{
theArxDLL.DetachInstance();
}
return 1; // ok
}