- Joined
- Jan 13, 2008
- Messages
- 2,302
- Reaction score
- 6
- Points
- 38
- Location
- Atlanta, GA, USA, North America
Finally moved to the Orbiter10 API and as I've started to update my code to Orbiter10, I've began using clbkGeneric to pass data between vessels rather than the KeyComm method using clbkConsumeBufferedKey. But I'm having a problem so far passing very simple data. I need to pass a double to a vessel.
First is two ways I've tried from the calling vessel:
Regardless of which method I use, I get a CTD when I try to delete the context pointer in the target vessel:
The CTD occurs when I try to delete time. I though I had gotten pretty good and doing strange and unusual things with pointers, but I guess there's still more out there.
Thanks for any help,
Zat
First is two ways I've tried from the calling vessel:
Code:
double *temptime = new double(guidanceStartTime);
ves->clbkGeneric(PAD_FULL_LAUNCH,0,temptime);
//second method
ves->clbkGeneric(PAD_FULL_LAUNCH,0,new double(guidanceStartTime));
Regardless of which method I use, I get a CTD when I try to delete the context pointer in the target vessel:
Code:
clbkGeneric(int msgid, int prm, void *context)
double* time;
...
time = (double*)context;
T0 = *time;
delete time;
Thanks for any help,
Zat