THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 15/08/2011 at 11:32, xxxxxxxx wrote:
Cinema 4D Version: R12
Platform: Windows ;
Language(s) : C++ ;
I'm afraid I'm missing something very obvious.
I'm trying to write my own command plugin and started using some of the SDK examples. But somehow, I can't get GeLoadString() to work. Using FileMon, it looks as if C4D is looking into the res subfolders of other plugins, but not into the res folder of mine. The icon loads fine, though.
My folder structure:
I have broken down the code to basically one GePrint(GeLoadString(PROWIZ_PLUGIN_NAME)), but it returns an empty string. I'd attach a zipped project directory, but it doesn't seem to be possible here. Still I can mail it to anybody willing to help.
Here are the contents of c4d_strings.str and c4d_symbols.h:
PROWIZ_PLUGIN_NAME = 10000,
// Plugin IDs
ID_PROWIZ = 1027470,
// Enum Terminator
Too be honest, I'm feeling a bit dumb. Must be very obvious, what I'm missing... any help would be very much appreciated...
On 15/08/2011 at 14:31, xxxxxxxx wrote:
If the icon loads correctly, Cinema is finding your resource folder okay.
I'm sure it's a mistake in your post here rather than in your project, but in your post what you show as c4d_symbols.h should be the strings in c4d_strings.str, and vice versa.
Can you show us your plugin registration function - the one you probably call RegisterProWiz() or something like that?
On 15/08/2011 at 21:41, xxxxxxxx wrote:
Thanks for looking into it...
You are right (double checked it twice, as I was suspecting something like this), I mixed up c4d_strings and c4d_symbols in the post. Corrected in first post.
Here's my RegisterProWiz(void) :
GePrint("Registering ProWiz (ID: " + LongToString(ID_PROWIZ) + ")...");
GePrint("Name: " + GeLoadString(PROWIZ_PLUGIN_NAME));
return RegisterCommandPlugin(ID_PROWIZ, "ProWiz", 0, AutoBitmap("prowiz.tif"), "Description ProWiz", gNew ProWiz);
The plugin registers fine. The output in console of "GePrint("Name: " + GeLoadString(PROWIZ_PLUGIN_NAME));" is a sole "Name: ".
On 16/08/2011 at 06:09, xxxxxxxx wrote:
Hm, not sure what's happening here. Just one question: you are definitely calling resource.Init() in the PluginMessage function?
On 16/08/2011 at 13:36, xxxxxxxx wrote:
Oh my god... you are so right!!! I feel pretty stupid, now. The plugin I took as an example didn't have any ressource files. I totally overlooked the comment in main.cpp...
Thanks a lot for the quick and competent help,
On 16/08/2011 at 23:33, xxxxxxxx wrote:
Heh, not that competent - I should have spotted that one earlier. It's an easy mistake to make when starting out. There's no need to feel stupid