Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 4 of 4

Add and Delete pushpins on mappoint

This is a discussion on Add and Delete pushpins on mappoint within the MapPoint Desktop Discussion forums, part of the Map Forums category; Iím using Mappoint in VB. The action that Iím doing is always replacing pushpins. I delete a pushpin on one ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Add and Delete pushpins on mappoint

    Iím using Mappoint in VB.
    The action that Iím doing is always replacing pushpins.
    I delete a pushpin on one place and put the pushpin on an other place.
    On a specific moment my program canít found the pushpins any more.
    I have tried to simulate this with a small program:
    > I delete and replace the pushpins every 5 seconds.
    > After almost tree hours the programs crashes.
    > Error message: ďRun Timer error Ď4000í
    > An unexpected internal error occurred.
    > Program: Ö\Mappoint.exe
    > R 6025 - Pure virtual function callĒ
    >When the error occurred, the program has done more than 2000 actions.
    Any ideas on what is causing this?

  2. #2
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Posts
    478
    My only guess would be a memory leak? Are you destroying your objects after each use? Without seeing the code it would be hard to do more than guess, sorry.

  3. #3
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Quote Originally Posted by John Meyer
    My only guess would be a memory leak? Are you destroying your objects after each use? Without seeing the code it would be hard to do more than guess, sorry.

  4. #4
    Joakim is offline Junior Member White Belt
    Join Date
    Jun 2003
    Posts
    11

    Hopefully a solution to your problem...

    It could be a memory leak/memory fault causing the problem. If you know that your computer doesn't have a bad memory you'll have to change the solution.
    My guess is that you are using the methods AddPushPin and Delete, but this is a slow and memory consuming way to do a move of one or more pushpins. Use Linkdata instead which is much faster.

    Step 1) Create a textfile with your coordinates and other information.
    Step 2) Use Linkdata
    Step 3) Change TextFile
    Step 4) Use Updatelink
    Step 5) Repeat step 3 and 4 every 5 seconds.

    Here is one example (using VB.NET) . You fill an array with your pushpins and loop through them and creates the file with Create_File() (need to make your own array variable.. this is just an example)

    Step 1) ............
    Private Sub Create_File()
    Dim Snurra As Integer
    Dim MyRow As String
    Dim FS As New System.IO.FileStream("C:\MapData.txt", IO.FileMode.Create)
    Dim FSData As New System.IO.StreamWriter(FS)

    ' Column Headers first
    MyRow = "Latitude" & Chr(9)
    MyRow = MyRow & "Longitude" & Chr(9)
    MyRow = MyRow & "Name" & Chr(9)
    MyRow = MyRow & "Whatever 1" & Chr(9)
    MyRow = MyRow & "Whatever 2"
    FSData.WriteLine(MyRow)

    ' then the data rows
    For Snurra = 1 To MyArray.GetUpperBound(0)
    MyRow = MyArray(Snurra).Latitude & Chr(9)
    MyRow = MyArray(Snurra).Longitude & Chr(9)
    MyRow = MyArray(Snurra).Name & Chr(9)
    .
    .
    FSData.WriteLine(MyRow)
    Next Snurra
    FSData.Close()
    FS.Close()

    End Sub

    Step 2)...................

    Private Sub Set_PushPins()
    Dim Snurra As Integer
    Dim MyMap As MapPoint.Map
    Dim MySet As MapPoint.DataSet
    Dim MyFields(4) As Object

    MyMap = Me.AxMappointControl1.ActiveMap

    MySet = MyMap.DataSets.LinkData("C:\MapData.Txt", "Name", , MapPoint.GeoCountry.geoCountryMultiCountry, MapPoint.GeoDelimiter.geoDelimiterTab)
    MySet.Symbol = 133
    MySet.Name = "Vehicles"
    MyFields(0) = MySet.Fields("Whatever 1")
    MyFields(1) = MySet.Fields("Whatever 2")
    'Set which fields will be visible in the Pushpin balloon
    MySet.SetFieldsVisibleInBalloon(MyFields)
    End Sub

    Step 3)... is done almost as step 1) and with a little bit of programming knowledge you'll know what to do.

    Step 4) ....
    Private Sub Update_PushPins()
    Dim MyMap As MapPoint.Map
    Dim MySet As MapPoint.DataSet

    MyMap = Me.AxMappointControl1.ActiveMap

    MySet = MyMap.DataSets("Vehicles")
    MySet.UpdateLink()
    End Sub

    Hope this helps!

    /Joakim
    joakim@spedsoft.se
    http://www.spedsoft.se
    SpedSoft AB has been working with MapPoint since version 2000 and have the longest experience in Sweden on MapPoint.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need to add Pushpins, but be able to delete them easily
    By BobFromBoston in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-18-2006, 02:12 PM
  2. don't delete pushpin
    By sdonta in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-03-2005, 12:57 PM
  3. Don't delete my pushpins!
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 06-15-2004, 11:39 AM
  4. How do you delete an Autoshape after you have added it?
    By Alex Chow in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 12-09-2003, 03:19 PM
  5. delete countries
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-19-2002, 10:59 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83