Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFPCOM.DLL

Status
Not open for further replies.

Neil Toulouse

Programmer
Mar 18, 2002
882
GB
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..."
 
oops typo!

oGPS.GotPosition(@lnLat, @lnLong)

should read

loGPS.GotPosition(@lnLat, @lnLong)
"I like work. It fascinates me. I can sit and look at it for hours..."
 
...The last response to this of mine correcting the type doesn't mean the problem has been resolved (just in case this is why noone is responding!)

It still gives me the unknown name error.

I suppose I really need to know if my understanding of the BindEvents() function is correct.

Does it add the events of loEvents to loGPS, or merely provide a reference and you have to use the loEvents object to utilise the events of the GPSControl?

TIA
Neil

"I like work. It fascinates me. I can sit and look at it for hours..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top