Problems using SDK
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/03/2004 at 04:13, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 7/8
Platform:
Language(s) : C++ ;---------
Hey.
In the past I programmed a tiny plugin in C.O.F.F.E.E, which displays several TextDialogs. Necessary sourcecode looks like this:
var name;
var obj = doc->GetFirstObject();
while (obj != NULL) {
name = obj->GetName();
TextDialog("Object: " + name);
obj = obj->GetNext();
} // while
This script actually did what it was told to! Now I'm trying to implement the same damn procedure (only this procedure!!!) in SDK (C++), but it doesn't work!!!! There I used a MenuPlugin. This sourcecode looks like this:
#include "c4d_plugin.h"
#include "c4d_memory.h"
#include "c4d_menuplugin.h"
#include "c4d_general.h"
#include "c4d_gui.h"
#include "c4d_basedocument.h"
#include "c4d_symbols.h"
#include "c4d_resource.h"
#include "c4d_baseobject.h"
static String *help=NULL;
static LONG GetState(BaseDocument *doc)
{
return CMD_ENABLED;
}
static void Execute(BaseDocument *doc)
{
BaseObject *bo;
LONG n=0;
for (doc=GetFirstDocument(); doc; doc=doc->next())
n++;
bo = doc->GetFirstObject();
String name1 = bo->GetName();
MessageDialog(name1 + " |HelloThere are currently "+LongToString(n)+" documents open");
}
Bool RegisterMenuTest(void)
{
// String name=GeLoadString(IDS_DIALOG); if (!name.Content()) return TRUE;
/*MENUPLUGIN mp;
ClearMem(&mp,sizeof(mp));
mp.GetState=GetState;
mp.Execute=Execute;
return GeRegisterPlugin(C4DPL_MENU,1000956,name,&mp,sizeof(mp));*/
}
void FreeMenuTest(void)
{
}
Now, there are two big problems: as a C4D-Plugin programmer newbe, I can not compile this code (compiler settings are correct!), as furthermore I don't even see the plugin in the plugin menu in C4D.
I need help!!!!! Maybe there is someout there (and I'm sure there is someone! :-)) who can help solving that problem! -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 11/03/2004 at 15:39, xxxxxxxx wrote:
If you couldn't compile the plugin it's not very surprising that it didn't show up in the menu...
Your compiler would know best why it doesn't like your code. In fact, most of the time it's even nice enough to give you a line number. If you don't understand what it says, just post the first compiler error here.
You might also want to revert to an untouched SDK folder to see if it compiles fine. Otherwise, there might be something wrong with your compiler environment.