Neil Toulouse
Programmer
I never knew that this little gem existed but I hope it is what I can use to get this flaming GPS Control to do something 
I am still haveing a few problems but hopefully someone will spot where I am going wrong.
This first bit of code extracts the EVENTS from the GPS control and store them to a file (this bit works!!):
loVFPCOM = CREATEOBJECT( "VFPCOM.COMUTIL" )
loGPS = CREATEOBJECT( "GPSControl.GPSActiveXControl" )
loVFPCOM.ExportEvents( loGPS, 'C:\GPSEvents.prg' )
RELEASE loGPS
RELEASE loVFPCOM
The contents of the file are (I have removed all but one of the procedures for clarity):
DEFINE CLASS GPSEvents AS custom
PROCEDURE GotPosition(Latitude,Longitude)
* Add user code here
ENDPROC
ENDDEFINE
So far so good!
Now the next part of the process is to bind the events to my object. So program number 2:
loComUtil = CREATEOBJECT( "vfpcom.comutil" )
loGPS = CREATEOBJECT( "GPSControl.GPSActiveXControl" )
loEvents = CREATEOBJECT( "GPSEvents" )
loComUtil.BindEvents( loGPS,loEvents )
STORE 00000.00000 to lnLat
STORE 00000.00000 to lnLong
oGPS.GotPosition(@lnLat, @lnLong)
DEFINE CLASS GPSEvents AS custom
PROCEDURE GotPosition(Latitude,Longitude)
* Add user code here
ENDPROC
ENDDEFINE
...But I am getting the 'Unknown Name' error when it gets to the GotPosition line.
I have stepped through the code and checked the objects with the debugger and it doesn't look like any events are being added to my object.
Am I going about this the wrong way?
TIA
Neil "I like work. It fascinates me. I can sit and look at it for hours..."
I am still haveing a few problems but hopefully someone will spot where I am going wrong.
This first bit of code extracts the EVENTS from the GPS control and store them to a file (this bit works!!):
loVFPCOM = CREATEOBJECT( "VFPCOM.COMUTIL" )
loGPS = CREATEOBJECT( "GPSControl.GPSActiveXControl" )
loVFPCOM.ExportEvents( loGPS, 'C:\GPSEvents.prg' )
RELEASE loGPS
RELEASE loVFPCOM
The contents of the file are (I have removed all but one of the procedures for clarity):
DEFINE CLASS GPSEvents AS custom
PROCEDURE GotPosition(Latitude,Longitude)
* Add user code here
ENDPROC
ENDDEFINE
So far so good!
Now the next part of the process is to bind the events to my object. So program number 2:
loComUtil = CREATEOBJECT( "vfpcom.comutil" )
loGPS = CREATEOBJECT( "GPSControl.GPSActiveXControl" )
loEvents = CREATEOBJECT( "GPSEvents" )
loComUtil.BindEvents( loGPS,loEvents )
STORE 00000.00000 to lnLat
STORE 00000.00000 to lnLong
oGPS.GotPosition(@lnLat, @lnLong)
DEFINE CLASS GPSEvents AS custom
PROCEDURE GotPosition(Latitude,Longitude)
* Add user code here
ENDPROC
ENDDEFINE
...But I am getting the 'Unknown Name' error when it gets to the GotPosition line.
I have stepped through the code and checked the objects with the debugger and it doesn't look like any events are being added to my object.
Am I going about this the wrong way?
TIA
Neil "I like work. It fascinates me. I can sit and look at it for hours..."