On 29/07/2013 at 15:55, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I'm trying to figure out how use the callbacks in the SDK. And I'm not getting very far.
I'd like to be able to execute the SplineDataCallbackCursorInfo callback to get the cursor's X&Y values when the mouse is inside of my splineGUI.
I'm using the PickSessionData code that Yannick posted as a guide. But I don't even know if the SplineData Callbacks works the same way?
At the top of my tag plugin. Which has a splineGUI in it. This is what I have so far:
#include "c4d.h"
#include "c4d_symbols.h"
#include "tsplinetag.h"
// be sure to use a unique ID obtained from www.plugincafe.com
#define ID_SPLINETAG 1000005
static SplineDataCallbackCursorInfo *splInfo;
Bool AllocSplineInfo()
{
splInfo = gNew SplineDataCallbackCursorInfo;
return splInfo!=NULL;
}
void FreeSplineInfo()
{
gDelete(splInfo);
}
void mySplineCallBack(LONG id, const void *d)
{
//How do I get the mouse's X & Y values in here?
}
Then in my Execute method I try to call to mySplineCallBack() like this:
myspline->SetUserCallback(mySplineCallBack, NULL);
I think I'm not even close. Because I get this error when compiling it:
Error : 'SplineData::SetUserCallback' : cannot convert parameter 1 from 'void (__cdecl )(LONG,const void * )' to 'SplineDataCallback'
Has anyone successfully used the splineData callbacks?
I'm not getting very far with it.
-ScottA