THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/06/2011 at 14:35, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R12
Platform:
Language(s) : C++ ;
---------
I have a very odd problem when loading a resource. Basically, I have a dialog which needs to open another dialog. I've done this before without problems. With this project, everything compiles okay but when trying to open the second dialog, LoadDialogResource() fails. C4D shows three message boxes and one looks like this:
The other two are similar. If you look at the file which C4D says it can't load, everything is correct until you get to the "...\dialogs\idc_rlog_buttonclear.str" part. It should be "...\dialogs\dialogtest.str". 'idc_rlog_buttonclear' is actually the ID of an element in the main dialog! Where C4D got this from, I just don't know. All the resources are created with ResEdit.
Here's the code I use to open the new dialog:
dlgtest.Open(DLG_TYPE_ASYNC, NULL);
And here's the CreateLayout() function in the dialog to be opened:
Bool DialogTest::CreateLayout(void)
{
// call the base class function first
GeDialog::CreateLayout();
// create resource object and load the resource
GeResource dlg_res;
dlg_res.Init(GeGetPluginPath());
if(!LoadDialogResource(IDD_DIALOGTEST, &dlg;_res, 0))
{
GePrint("DialogTest: could not load resource file.");
return FALSE;
}
return TRUE;
}
Identical code works fine in several other plugins. I've tried with another dialog and different resource file, same problem except the erroneous string is different (but uses the ID of another element in the main dialog resource).
I must be doing something wrong but I just can't see what.
Anyone have any ideas?
Steve