OpenInventor: SoTimerSensor callback problem

hi!

i’m trying to get to work the SoTimerSensor callback function in MFC dll, but it does’t work well, i.e. when i set up all the stuff for the SoTimerObject, it then doesn’t call that function I specified in the setFunction method.

the code looks as follows:

SoTimerSensor* timerSens = new SoTimerSensor;

static void sensCallback(void *data, SoSensor *);

void SomeClass::someMember()
{
UpdateData(TRUE);
timerSens->setFunction(sensCallback);
timerSens->unschedule();
timerSens->setBaseTime(SbTime(0.0));
timerSens->setInterval(SbTime(0.01));
timerSens->schedule();
double basetime = timerSens->getBaseTime().getValue();
double interval = timerSens->getInterval().getValue();
SoSensorCB *c_func = timerSens->getFunction();
BOOL isSched = timerSens->isScheduled();
}

static void sensCallback(void *data, SoSensor *)
{
//some code to execute
}

What’s the problem?

Thanx!

OK, i’ve done that thing with SetTimer. Works better – rather than duzznt

But the Q still remains.