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

Showing ZIP code divisions for territories programmatically

This is a discussion on Showing ZIP code divisions for territories programmatically within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello all, I have been having some trouble handling territories using VB.Net (or VB6). My main issue is that I ...

  1. #1
    Fer
    Fer is offline Junior Member White Belt
    Join Date
    Jun 2003
    Posts
    11

    Showing ZIP code divisions for territories programmatically

    Hello all,

    I have been having some trouble handling territories using VB.Net (or VB6). My main issue is that I need to have the ability to show the Zip code divisions that appear when defining territories using ZIP Codes but I don't need to have the Territories Manager also appearing at the same time. I've noticed that the only way to make these divisions appear is if I also have the Territory Manager on the map, and I wish to avoid that.

    I haven't actually been able to find out much about handling territories programmatically, so if anyone has done something like this then any suggestions are welcome.

    I've also been hitting my head repeatedly trying to find out how to do in code the same simple stuff that one can do with the application like for example adding to a territory or deleting a territory. So far I can only end up with a dataset collection after using the ImportTerritories method but can't do a whole lot with it.
    Anyone has done some territory programming that could give me a few pointers about it? All will be much appreciated.

    Thanls again,

    Fernando

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    I found a way to do it, but it ain't clean! It basically has to do with using Sergiy Pavlov's article of 'Extending the MapPoint ActiveX Control'. I found out that I only have to use the
    Code:
    ShowWindow(hWnd, SW_NORMAL)
    API call, where hWnd is the handle to the territory manager dialog obtained through Spy++ and SW_NORMAL is a const to indicate that the window is to be shown. this only shows the zip code divisions and doesn't show the territory manager dialog. BUT there's a trick to it: first, you gotta have a way to find out the hWnd of the TM dialog, since it changes from instance to instance, and you also must have previously loaded at least one territory before this works, or else MP won't know the type of division that you want to show.

    It looks kind of complicated but it's the best I've got so far. If anyone comes up with a better idea please share it in the forum. I'm still trying to see how to achieve the other functions I need to carry out. I saw that maybe the LinkTerritories method might help a bit, because I would only be left with the data source to deal with, but at the expense of performance because all the territories will have to be refreshed everytime I make a small change in the data source.

    As always, any ideas are appreciated.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Multiple Territories Assocaited with a zip Code???
    By lane in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 05-15-2006, 10:59 AM
  2. Creating Territories programmatically
    By Atul22 in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 10-05-2004, 11:15 AM
  3. Programmatically creating Territories?
    By jlaretto in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-29-2004, 03:01 AM
  4. Reading Territories name Programmatically using VB
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 05-20-2003, 09:20 AM
  5. Zip Code Counts to Territories
    By RogerMcc in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 10-24-2002, 09:57 PM

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