I'm attempting to use frmGadgetMiscEvent to pass information along to my
gadget, which has worked successfully on both the NR70 emulator and my Zodiac;
however, it is not functioning correctly when I use it with either the NX60
simulator or my NX80 - I never recieve valid information from dataP.
Here's the code I'm using:
To send:
Int32 * input = new Int32;
*input=(Int32)eventP->data.keyDown.chr;
EventType *gadgEvent=new EventType;
gadgEvent->eType=frmGadgetMiscEvent;
gadgEvent->data.gadgetMisc.gadgetID=SmallGadg;
gadgEvent->data.gadgetMisc.gadgetP=GetObjectPtr<FormGadgetType>(SmallGadg);
gadgEvent->data.gadgetMisc.selector=0;
gadgEvent->data.gadgetMisc.dataP=input;
EvtAddEventToQueue(gadgEvent);
To recieve, I look at:
*(Int32 *) ((EventType *)paramP)->data.gadgetMisc.dataP
I have tried several scenarios for setting dataP; however, nothing I do seems
to work on those devices. The above read crashes the simulator because it
tries reading from an odd address. The only workaround I have found is to use
.gadgetMisc.selector to send a character across, but I will need to send entire
strings to/from the gadget soon.
If no one can find a hole in my code, my gadget is class-based, so should I
simply use FrmGetGadgetData() and send my info directly to the object?
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/