Notifications
Clear all
[Closed] function publishing problem
Oct 31, 2007 6:38 pm
hi folks =)
I tried to publish a simple function from an even simpler utility. Here is what I did:
in the header file:
// interface ID
#define UTIL_INTERFACE Interface_ID(0x7ef853, 0x154272)
#define GetUtilInterface(obj) \
((UtilInterface*)obj->GetInterface(UTIL_INTERFACE))
// function IDs
enum { Util_initialize,};
// mixin interface
class UtilInterface : public FPMixinInterface
{
BEGIN_FUNCTION_MAP
VFN_0(Util_initialize, initialize);
END_FUNCTION_MAP
FPInterfaceDesc* GetDesc();
virtual void initialize()=0;
};
in the cpp file:
static FPInterfaceDesc Util_mixininterface(
UTIL_INTERFACE,
_T("IUtil"),
0,
&UtilDesc,
FP_MIXIN,
Util_initialize,
_T("initialize"),
0,
TYPE_VOID,
0,
0,
end
);
FPInterfaceDesc* UtilInterface::GetDesc() {
return &Util_mixininterface;
}
void Util::initialize(){
MessageBox(NULL,"initialized,"",MB_OK);
}
now in maxlistener
showinterfaces myUtil
Interface: IUtil
Properties:
Methods:
<void>initialize()
Actions:
OK
so far so good, but:
myUtil.initialize()
-- Argument count error: initialize wanted 1, got 0
why is that happening ?