Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keeping getting Fatal error with automating Mappoint
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01353339
Message ID:
01354404
Views:
19
Evan

Going back to my original development machine, I have discovered that it has having code in the afterredraw method that is causing the machine to crash? The code used to work, but now appears to make the machine bomb.

Since the redraw is ran after pinpoints are selected, the code is basically may way of "processing" the pinpoints selected, if the user has selected a depot, that gets removed. If the user has already selected a site thats was prevously selected that gets removed from the active route.

Is there a better method to do my processing that gets fired when the users "Adds pushpins as stops"?




.










>Robin,
>
>Ideas below:
>
>1) Are you *absolutely certain* that the values from your code are the identical values you type in the command window?
>2) Can you put an ASSERT .f. or a SUSPEND in the code right before that line and step line by line to see if it works that way? (if it does, then there may be a timing or compilation issue)
>3) Do you have multiple versions of MapPoint on this box?
>
>Evan
>
>>Hi Evan
>>
>>Yes I agree your two line aproach is much better.
>>
>>However, my new delelopment machine without SP1 or SP2 installed is not giving me any fatal errors, the main point is that the
>>address Mappoint cannot find it should, if I suspend the program and type the line in the command window exactly as it is in the
>>program, it works.
>>
>>If I can now get this to work, I am happy to carry on development on this project on this one machine exclusively, since my deadline is fast approaching. Yikes!
>>
>>Any ideas?
>>
>>
>>
>>
>>
>>>Robin,
>>>
>>>When the FindAddressResults() does not locate an address, the resulting collection has zero members. When your code then attempts to reference Collection.Item(1), there is no object to reference, hence the error.
>>>
>>>I would split this line into two: execute the FindAddressResults() (returning a collection into an object reference) and *then* check that the Count property > 0 for that collection before issuing the location reference to oHomeLoc.
>>>
>>>Something like this (untested, use at own risk):
>>>
>>>LOCAL loAddress
>>>loAddress = thisform.olecontrol1.ActiveMap.FindaddressResults(alltrim(depots.cstreet),alltrim(depots.caddress1),alltrim(depots.caddress3),alltrim(depots.caddress4),depots.cpostcode)
>>>oHomeLoc = IIF( loAddress.Count > 0, loAddress.Item(1).Location, .NULL. )
>>>
>>>
>>>
>>>>Hi Evan
>>>>
>>>>I've set up another development machine just to see what would happen, i've decided to hold back on SP2 for the time being
>>>>
>>>>Now a line
>>>>
>>>> ohomeLoc = thisform.olecontrol1.ActiveMap.FindaddressResults(alltrim(depots.cstreet),alltrim(depots.caddress1),alltrim(depots.caddress3),alltrim(depots.caddress4),depots.cpostcode).Item(1).Location
>>>>
>>>>tells me that MEMBER item does not evaluate into an object, if I suspend and repeat the line from the command line its fine?
>>>>
>>>>What is going on ?
>>>>
>>>>
>>>>>Robin,
>>>>>
>>>>>I work with MapPoint automation quite a bit. Frankly, this sounds like a VFP issue rather than a MapPoint issue -- and I wouldn't start reinstalling just yet.
>>>>>
>>>>>What's changed on your development machine? VFP SP2, perhaps (that's a guess), or some other (new) utility in memory that might be getting in the way.
>>>>>
>>>>>Can you put a TRY/CATCH around the code that automates MP? That might help us diagnose the true cause.
>>>>>
>>>>>Evan
>>>>>
>>>>>
>>>>>>Somthing weird is going on.
>>>>>>
>>>>>>Mappoint Automation Code which I have written months ago & not touched has stopped working on my development machine
>>>>>>
>>>>>>Now sometimes, but not all the time, I am getting
>>>>>>
>>>>>>"Fatal Error: Exeption code =C0000005"
>>>>>>
>>>>>>This is driving me crazy! Everything else appears to be working correctly, i've reinstalled Mappoint 2006, but it's exactly the same
>>>>>>
>>>>>>I am will to reinstall all my stuff onto my development machine, but that will be my last resort!
>>>>>>
>>>>>>Any help extremley appreciated
Rob
Previous
Reply
Map
View

Click here to load this message in the networking platform