Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Keeping getting Fatal error with automating Mappoint
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01353339
Message ID:
01353934
Vues:
20
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
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform