Error reading resource
-
On 16/06/2015 at 05:25, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R16
Platform: Mac OSX ;
Language(s) : C++ ;---------
Hi,I'm currently working on an commandData plugin. Since I'm new to that type of plugins I've copied an example and I'll edit it to my needs.
The only problem is, I can't get a resource file loading. This is the error I get:Error reading resource
file 'Applications/MAXON/CINEMA 4D R16/plugins/examples/CopyManager/res/dialogs/_dummy_element_.res' Line 1As far as I know, I shouldn't even have that file or search for that file.
The resource file I need is called idd_objecteditor.res, but I don't know where I can define that (access it), or something like that.
I've been searching for a solution for hours now, and it's getting a bit frustrating.Also, when I look at the SDK examples, it seems to be set up the same way as my plugin.
Does somebody know how to fix this? Change the resource it has to search?
Thanks in advance for your help and time!
Greetings,
Casimir Smets -
On 16/06/2015 at 05:57, xxxxxxxx wrote:
Hi,
If I change the name of idd_objecteditor to _dummy_element_ the resources get loaded, and I get the error it is corrupted (filename does not match dialog id), but my plugin loads.
But this is totally not what I want.Does anybody know the answer to this?
Thanks for your help and time!With kind regards,
Casimir Smets -
On 16/06/2015 at 06:03, xxxxxxxx wrote:
Hi,
If I then change DIALOG IDD_OBJECTEDITOR to DIALOG _DUMMY_ELEMENT_ and DIALOGSTRINGS IDD_OBJECTEDITOR to DIALOGSTRINGS _DUMMY_ELEMENT_ everything works fine without even one error.
How could I change this back to the names I want??
Thanks in advance for your help and time!
Greetings,
Casimir Smets -
On 16/06/2015 at 07:13, xxxxxxxx wrote:
Hello,
CommandData plugins don't use resource files (since they don't have a GUI, see the corresponding register function). So the problem with the resource file must come from another plugin or dialog of yours. So what exactly are you doing? If possible please provide some code.
Best wishes,
Sebastian -
On 16/06/2015 at 07:26, xxxxxxxx wrote:
Hi,
It's the resource file for my dialog inside my commandData plugin.
I should have said that, sorry!This is the code where I get the resource file, but I can't specify the name of what to search (I think).:
GeResource dlg_res; dlg_res.Init(); result = LoadDialogResource(IDD_OBJECTEDITOR, nullptr, 0); // I have IDD_OBJECTEDITOR assigned inside my c4d_symbols.h, inside an enumeration. // I had to change IDD_OBJECTEDITOR in both the .res and .str file in order to let the plugin work without errors. (After DIALOG and DIALOGSTRINGS)
The only name, or rather, id, I specify for which file to choose is IDD_OBJECTEDITOR, but this doesn't tell me (or C4D) in which file it should be.
I don't know where to go from here :sThanks in advance for your help and time!
Greetings,
Casimir Smets -
On 30/06/2015 at 07:02, xxxxxxxx wrote:
Hi,
Here is the full code that I use:
https://developers.maxon.net/forum/topic/8834/11671_dialog-resource-file-not-loadingThanks in advance for your help and time!
Greetings,
Casimir Smets -
On 30/06/2015 at 10:01, xxxxxxxx wrote:
Hello,
the resource and string file of your dialog must have the same name as your dialog identifier. Also you must add this identifier to c4d_symbols.h. See Dialog Resource.
Best wishes,
Sebastian -
On 30/06/2015 at 11:42, xxxxxxxx wrote:
Hi Sebastian,
Okay, I guess that makes sense.
But, why does it work when I change the filename to _dummy_element_?
Then it still has PositionDialog:: instead of _dummy_element_:: but it works.Originally posted by xxxxxxxx
If I change the name of idd_objecteditor to _dummy_element_ the resources get loaded, and I get the error it is corrupted (filename does not match dialog id), but my plugin loads.
Thanks for your help and advice!
Greetings,
Casimir Smets