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

Embedded MP2K6 app does not work with MP2K4

This is a discussion on Embedded MP2K6 app does not work with MP2K4 within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am writing a C# app that embeds MapPoint 2006. CFMapPoint - Centrafuse MapPoint Plugin The program works fine w/ ...

  1. #1
    paulpv is offline Junior Member White Belt
    Join Date
    Jan 2004
    Posts
    4

    Embedded MP2K6 app does not work with MP2K4

    I am writing a C# app that embeds MapPoint 2006.
    CFMapPoint - Centrafuse MapPoint Plugin

    The program works fine w/ MapPoint 2006.

    I have a test machine with only MapPoint 2004 installed.
    I install my app (that has MP2K6 interop dlls) on my MP2K4 machine.
    I run the app, and it malfunctions in that it behaves as if it cannot properly access all of the MP API.
    The MapPoint map is visible, but few of the API calls in my app appear to work.
    Surprisingly, I can use the API to toggle through map modes (political, topo, etc).

    I guess MP is throwing some sort of exception, but my app has exception handlers all over the place that pop up dialogs and I never get any pop ups.

    I can't truely debug this right now because my copy of MP2K4 is hidden in a box somewhere in storage (I am selling and moving house to a new house soon).

    Has anyone successfully compiled a MP2K6 embedded app and run it on a machine w/ only MP2K4?
    Would someone with two machines and both MP2K4 and MP2K6 be able to give this a try w/ a small "hello world" app and let me know if it works?

    This is a major problem for me because I have a lot of users that only have MapPoint 2004, not MapPoint 2006.
    I can resort to having two seperate installers (one for MP2K4, one for MP2K6), but:
    1) That complicates the build and release cycle
    2) I thought this should be taken care of automatically

    Thanks!

    Pv
    Last edited by paulpv; 08-11-2006 at 12:44 PM.

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    Soon I will be in the same problem as you So if you get futher with or without help from others in this forum, please feedback.. Thanks

  3. #3
    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 think you've got the answer.

    MapPoint is backwards compatible but not forwards. So MP2006 will run with DLLs written using the MP2002 and MP2004 APIs but not vice versa.

    And the reason is obvious if you think about it, MP2006 added new methods / properties, therefore updating the interface. MP2004 has NO WAY of knowing what will be added 2-4 years in the future!

    First you must restrict yourself to MP2004-only API features (properties, values, methods, etc). Then link it in using the MP2004 COM definitions.
    This should not be too difficult - MP2006 only added 2-3 new methods/properties...

    Incidentally this is what I do with MileCharter - it still links in MP2002's API - so I can support MP2002,4,6 all out of the box!

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

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Thanks Richard.
    Of course this is very logic but did not think on that

  5. #5
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    There is a point where we have to draw the line though. MP2002 and 2004 were so a like that it makes sense for recent products to be written with 2002.
    (pre-2002 is too limiting).

    I'm seriously considering making my next product "2006 only". As it will use C#, I might be limiting my customers too much, but those who have upgraded to one will probably have upgraded to the other.


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

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi Richard,

    You right. But the problem is maintenance. At the moment I have some Delphi applications using the object model. I keep them on a separate machine. On another machine I use C# with mappoint 2004 and soon 2006.

    The object model is no problem as you can easely set some exception blocks for non existing code in newer mappoint versions.

    But using the ActiveX component you have to do with the installed version I think.

    Unless drop the ActiveX and use the object model in C# ?
    What do you think ?

  7. #7
    paulpv is offline Junior Member White Belt
    Join Date
    Jan 2004
    Posts
    4
    I wrote a hello world app that wraps MapPoint 2006 and then ran it on a machine running MapPoint 2004.
    The exception I get is:
    QueryInterface for interface MapPoint.Location failed.

    Your explinations make sense, but I would really like to write an app that can take advantage of the 2-3 new MP2K6 features and be backwards compatible with MP2K4.
    FYI, the 3 new features are:
    1. New data
    2. Night skin
    3. Lat and Long from Location

    I can understand that I may need exception handlers to wrap these new MP2K6 features, but would have hoped that a machine w/ MP2K4 installed could use the MP2K6 object model for common objects such as "MapPoint.Location", etc.

    Is there any way this is possible?
    If not, I guess I will have to distribute two seperate versions of the app, one that works w/ MP2K4 and one that works w/ MP2K6.

    Thanks!

    Pv

  8. #8
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    Richard may have more light on this, but I think you have to go for the object model. Then you have to go with some exception handlers if the 2004 model is installed.

    What do you think Richard ? I may overseen some issues maybe...

  9. #9
    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 think I assumed Paul's "hope", but have indeed had troubles when I've installed a new MapPoint and a project's default references (this was VB6 I'm thinking of!) all changed.

    I haven't tried detecting MP2006 by catching an exception. It might work if you could separate the two sets of references - perhaps with namespaces?

    At the end of the day, it is probably simpler to write your own versions of the new MP2006 stuff. Eg. if you want longitude,latitude, then use Gilles Kohl's CalcPos routine and accept that it is probably a bit slower.


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

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. delphi mp2k4 findaddress
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 03-24-2005, 02:01 PM
  2. Network installation & use of MP2K4
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 02-19-2005, 03:02 AM
  3. updating an embedded map in Excel
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 08-26-2004, 01:44 PM
  4. Considering Moving To MP2k4
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-04-2004, 03:46 PM
  5. Using MP2K4 to launch an other application
    By arkus in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-28-2004, 12:23 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