SimonPearse
01-10-2005, 04:45 PM
I'm using MP2004 and VB5
In code I have created a pushpin, and later want to delete it using
If PinIsSet(Index) Then objCPushPin(Index).Delete
Ths sometimes causes error 4014.
I have been unable to find any documentation on this error, can anyone advise?
Wilfried
01-11-2005, 05:49 AM
Hi,
I cannot find the error eather, but probably you try to delete a pushpin that is not assigned ? To be sure it is assigned always do if you delete a pushpin and you have it in an array or whatever assign null to it (I think Nothing in VB). Or find the pushpin by name (if you give a name to it at creation time).
PushPin PP = MP.ActiveMap.FindPushpin("TheName");
if (PP != null)
PP.Delete();
or if it comes out an array:
if (aPP[4] != null) {
aPP[4].Delete();
aPP[4] = null;
}
Winwaed
01-11-2005, 08:03 AM
I would upgrade to VB6 - you never know there might be a problem in VB5's handling of COM objects?
Richard
SimonPearse
01-17-2005, 10:47 AM
thanks for the suggestins, I do keep track of pins that have been created using an array PinIsSet so...
if PinIsSet(index) then ....
I dont want to go to vb6 if I can avoid it, I'm writing commercial software in licenced 5Pro, 6.0 is no longer availabe, and so far I have not seen any need to go to .net.... perhaps this is turning into that need, but I'd like to be certain before spending loads on new VB!