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 3 of 3

Addpolyline , Array , Visual Basic and Other languages

This is a discussion on Addpolyline , Array , Visual Basic and Other languages within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, I am trying to use MapPoint Control not with Visual Basic but with another language ( Windev ). Everything ...

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

    Addpolyline , Array , Visual Basic and Other languages

    Hi,

    I am trying to use MapPoint Control not with Visual Basic but with another language ( Windev ).
    Everything works but I can't find the equivalent of array of objects
    like in AddPolyLine( array ( ObjLocParis, ObjLocOrleans, ObjLocNice))

    My Code to Add PolyLine is:


    *******************************************
    Function AddPolyLineToMap()

    objMap est un objet Automation dynamique

    objLoc est un tableau de 3 objet Automation dynamique
    // ie ObjLoc is an array of 3 Automation dynamic Objects


    cStreet1, cCity1 ,cOtherCity1 ,cRegion1 , cPostalCode1 sont des chaînes
    cStreet2, cCity2 ,cOtherCity2 ,cRegion2 , cPostalCode2 sont des chaînes
    cStreet3, cCity3 ,cOtherCity3 ,cRegion3 , cPostalCode3 sont des chaînes


    objMap = MapPointControl1>>ActiveMap


    cStreet = "1 Rue Didot"
    cCity = "Paris"
    cOtherCity = ""
    cRegion = ""
    cPostalCode = "75014"

    objLoc[1] = objMap>>FindAddressResults...(cStreet1,cCity1,cOth erCity1 , cRegion1 , cPostalCode1)>>Item(1)

    cStreet2 = "1 rue du Laos"
    cCity2 = "Paris"
    cOtherCity2 = ""
    cRegion2 = ""
    cPostalCode2 = "75015"

    objLoc[2] = objMap>>FindAddressResults...(cStreet2,cCity2,cOth erCity2 , cRegion2 , cPostalCode2)>>Item(1)


    cStreet3 = "13 Rue des Plantes"
    cCity3 = "Paris"
    cOtherCity3 = ""
    cRegion3 = ""
    cPostalCode3 = "75014"

    objLoc[3] = objMap>>FindAddressResults(cStreet3,cCity3,cOtherC ity3 , cRegion3 , cPostalCode3)>>Item(1)

    objMap>>Location = ObjLoc[1]

    objMap>>Shapes>>AddPolyline(ObjLoc)
    // ( the bug is here , in the last line )


    RETURN 0

    //************************************

    I have an error message at the line

    objMap>>Shapes>>AddPolyline(ObjLoc)

    saying that it's not possible to convert the 1st parameter (ObjLoc) in automation parameter

    "Le paramètre 1 n'est pas convertible en paramètre automation".


    Thanks for your help
    Delphine

  2. #2
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    I don't know "WinDev", but you'll need to use VARIANTs to pass arrays via COM. That might be handled by the language (eg. VB), or you have to do it yourself (eg. C++).

    The following article I wrote for C++, might help:

    http://www.mp2kmag.com/a106--c++.wit....mappoint.html

    and look for "COM" and "VARIANT"s in the WinDev documentation.
    It might also be under ActiveX. This uses COM, and the "automation" in the error suggests that WinDev might thinking of ActiveX.

    Hope this helps?

    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

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

    Windev & Mappoint

    Bonjour Delphine,
    comme vous, j'essaye de piloter Mappoint à l'aide de Windev & je rencontre également des problèmes avec le type des paramétres..

    je suis passé de la 5.5 à la 7.5 pour pouvoir utiliser le type variant, mais ce n'est pas mieux..

    Je trouve trés peu de sujet concernant Windev&Mappoint,je me permet donc de sollicité votre aide (il me semble que vous etes un peu plus en avance que moi )

    Avez-vous progressez & savez vous utiliser les variables de type variant (je n'arrive meme pas à passer un parametre a newmap() )

    Par avance merci
    (si je trouche qch entre temps je vous tiendrai au courant)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Drawing a polyline with Visual Basic Net - Array problem
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-24-2005, 05:16 PM
  2. Visual Basic 6.0
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-06-2004, 07:17 AM
  3. Visual Basic 6.0
    By fantef in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-15-2004, 12:41 PM
  4. mappoint, visual c++ vs visual basic
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 03-30-2004, 10:17 PM
  5. Visual basic or visual c++ in mappoint
    By misterb83 in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 02-14-2003, 09:31 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