Hi,
Seeing your AddProp utility led me to try my hand at some C++ code with the VFP API.
My goal is to have asynchronous processing of an event stack(holding developer defined events). I looked at timers but I don't like the fact that timer events get queued when VFP doesn't have the focus. I am trying to write code in the VFP Idle loop which will kick off my event processing code.
I have found that changing the Value property of a textbox via _SetObjectProperty causes ProgrammaticChange to fire. So I tried to tie into the VFP idle loop, via _ActivateIdle(), check a flag, and set the Value property of a textbox to trigger a ProgrammaticChange event if the flag is set. Unfortunately, I can't seem to hold or obtain an object reference (a Value structure?). If I pass an object reference in, everything works. If I attempt to store it in a static Value, it becomes invalid. If I get the nti, and do a _FindVar and a _Load, I don't seem to get a valid object reference.
Example: I create a variable 'goHook' in VFP
The C++ code calls:
nti = _NameTableIndex("goHook\0")
_FindVar(nti, -1, &loc) to check if nti points to a valid VFP var
Clear a Value struct (ObjRef)
and _Load(&loc, &ObjRef)
ObjRef does not seem to contain a valid object ref (Can't do _Set/GetObjectProperty)
Since you have worked with _SetObjectProperty, I thought you might be able to offer some insight.
Thanks in advance,
Ned Ames
Ned
Reality is.