[Invalid Pointer] : what's wrong ?

Vincent BENNER
11-18-2002, 03:31 AM
Hello,

I've made a VB6 program which include the CalcPos sub made by Gilles Kohl. It was running well until I made some changes but I can't success to go back ;-(

I've created a VB6 application which opens a new map.
I've inserted a simple button with the following code :

Dim objMAP As MapPointCtl.Map
Dim objPP As MapPointCtl.Location
Dim X As Double
Dim Y As Double

Set objMAP = Me.ctrlMAPPOINT.ActiveMap
Set objPP = objMAP.FindPushpin("21000, DIJON")

Call CalcPos(objMAP, objPP, X, Y)

MsgBox "X = " & X & vbCrLf & "Y = " & Y, , "IT WORKS !"

I obtain a stupid error, Invalid pointer. I've tried with the
Dim objMAP As MapPoint.Map
Dim objPP As MapPoint.Location
instructions but the problem is the same...

objPP returns every time a nothing reference !

The code is made for France, but it should works with any place.
"21000, DIJON" works fine into MapPoint

Regards,

Vincent BENNER

John Meyer
11-18-2002, 11:47 AM
the "FindPushpin method" finds a pushpin that is already on the map, it is not for creating a pushpin. Use FindResults method insted. Also your DIM objPP as MapPointCTL.location would not have worked for the FindPushpin Method.

 
Web mp2kmag.com
mapforums.com