Community of VE/MapPoint Users and Developers
This is a discussion on Invalud PostCode issue with MapPoint 2002 with C++ ActiveX in the MFC within the Development forums, part of the MapPoint 2006/2009 Discussion category; Hi there, Wondering if anyone can help me. Im using C++ MFC with MapPoint 2002. Im trying to calculate routes ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Wondering if anyone can help me. Im using C++ MFC with MapPoint 2002. Im trying to calculate routes between lots of different sites and find the shortest drive time between the sites and certian buildings. I have a fairly stable program working at the moment, however i've got to running through some test data and the program is stopping when a post code does not exist in MapPoint. The AFX error message that comes up is: 'The requested member of the collection does not exist. Use a valid name or index number.' I have no problem with there not being a post code match, however i need the program to keep running, and some way to tell the user which post code is not matched. Any ideas with this would be a great help. Cheers PieEater3142 |
| |||
| Re: Invalud PostCode issue with MapPoint 2002 with C++ ActiveX in the MFC
Hi Eric, Cheers for the quick response: The function thats throwing the error is: Quote:
It creates the error message when it gets one of the two following commands (depending which has the bad post code in): //save the locations found to type CLocation for MapPoint to process CLocation p_lc = patient_loc.GetItem(&v2); CLocation s_lc = site_loc.GetItem(&v2); Cheers for your help PieEater |
| ||||
| Re: Invalud PostCode issue with MapPoint 2002 with C++ ActiveX in the MFC
Yes, I think it makes sense. You would be trying to get item 1 from a collection with no objects. Check the FindResults collection object in the Help File. It has five properties Properties Application Count Item* Parent ResultsQuality Before you use the GetItem, I think you want to check the Count property first to see if the collection has any items. hope that helps. Eric
__________________ |
| |||
| Re: Invalud PostCode issue with MapPoint 2002 with C++ ActiveX in the MFC
Hi Eric, Thanks for your help. Works like a charm. Where is this help file of which you speak. Im currently using the object browser in VB6 or looking at the Class view in C++ for the different functions. Thanks again. PieEater |
| ||||
| Re: Invalud PostCode issue with MapPoint 2002 with C++ ActiveX in the MFC
Hello PieEater. Of what pie do you like the most? Under Start | Programs you may see MapPoint listed as a program, then go to Help and the Programming Information is at the bottom of the file. If you don't see MapPoint in the Start menu, then you should be able to find it by going to your \Program Files\ directory and look for Microsoft MapPoint, the help file is a "MAPPOINT.chm" file you should be able to just double-click on to open. As a last resort you could search your hard drive for MapPoint.chm. If you still don't find it let me know and I can send you a copy - I don't think I have the MapPoint 2002 chm file, but the API / object model should be just about identical to the MapPoint 2004 object model. Eric
__________________ |
| |||
| Re: Invalud PostCode issue with MapPoint 2002 with C++ ActiveX in the MFC
Hi Eric, Thanks for help file info. All pies are good - so many to choose from - but cant go wrong with chicken and mushroom or an apple pie Another question for you if you dont mind. I need to determine if a post code is on the isle of wight or not. Now from the help file this would be the map.FindAddressResults function. However the output is of type CFindResults for C++. From the help file: object.FindAddressResults([Street], [City], [OtherCity], [Region], [PostalCode], [Country]) So the value should come back in the OtherCity or Region field. However how do i get the answer out in C++ - is there any way? Cheers again PieEater |
| |||
| Re: Invalud PostCode issue with MapPoint 2002 with C++ ActiveX in the MFC Quote:
Any ideas what function can do what i need and how you can interpret the outputs? Cheers PieEater |
| ||||
| Re: Invalud PostCode issue with MapPoint 2002 with C++ ActiveX in the MFC
Yes, you're right. Honestly I think the easiest thing and the most reliable would be if you know the postcode range - is it consistent? for instance if all postcodes in the Isle of Wight began with K3x xxxx through K8xx xxx or whatever and you could just test through some string functions. Eric
__________________ |
| |||
| Re: Invalud PostCode issue with MapPoint 2002 with C++ ActiveX in the MFC
Damn, ok thanks for that. Thought it might come to that but was looking for a neater way. Oh well. Cheers Yet another question - bit random but here we go: I have to use mappoint 2002 as its the only version that integrates with Visual C++ 6. Unfortunately the post codes are out of date. Is there any way to overwrite the data files on the mappoint 2002 version with the 2006 version for instance. I have tried - all file names are the same - sizes are obviously different but it doesnt work. Is it possible (by giving it some other files) or am i stuck with it. Thanks again for all your help with this, you've been a star. Cheers PieEater |
![]() |
| Tags |
| activex, invalud, issue, mappoint 2002, mfc, postcode |
| ||||
| Posted By | For | Type | Date | |
| Automating MapPoint with Perl - MapPoint Articles - MP2K Magazine | This thread | Refback | 01-13-2008 01:22 AM | |
| Merging Multiple Routes - MapPoint Articles - MP2K Magazine | This thread | Refback | 01-08-2008 04:05 PM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 01-07-2008 04:16 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mappoint Installation issue | jacky3212 | MP2K Magazine Articles | 2 | 07-19-2008 01:08 AM |
| MapPoint 2002 ActiveX control and Visual Studio .NET 2003 | chulaka | MapPoint 2006/2009 Discussion | 1 | 09-30-2003 11:35 AM |
| GetName() problem in 2002 ActiveX in VC++ | jvirtue | MapPoint 2006/2009 Discussion | 0 | 09-26-2003 02:04 PM |
| Map Point 2002 Europe Postcode Sector Updates | Anonymous | MapPoint 2006/2009 Discussion | 1 | 10-08-2002 11:13 AM |
| I am using Mappoint 2002 ActiveX control in a VB a.... | Anonymous | MapPoint 2006/2009 Discussion | 2 | 06-14-2002 08:10 AM |