Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not evaluating to an object
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00108385
Message ID:
00108401
Vues:
31
>Hi all,
>
>We have someone writing MapBasic programs for us. He also wrote the VFP interface. Here's what the code is in one program:
>
>mapinfo = GetObject(,"MapInfo.Application")
>mapinfo.Visible = .T.
>mbapp = mapinfo.mbApplications[1]
>
>mapinfo.MBApplications[1].MBGlobals["gDataPath"].value = "C:\tripsoft\data\mapping\"
>
>I have no idea if that means anything to anyone. I don't know how to use OLE, myself.
>
>The error I'm getting is: "member MBGlobals does not evaluate to an object"
>
>This is working fine on his system, and he has no idea why it's not working on mine. Anyone have any ideas?
>
>Thanks,

I'm just guessing here, 'cause I don't know the MapInfo object model, and haven't used OLE much anyway. Do you and he have the same versions of MapInfo? If so, next, I would try to figure out if the line "mbapp = mapinfo.mbApplications[1]" was actually doing the same thing on both machines. It seems like the line that doesn't work could have been re-written using the "mbapp" reference:

mbapp.MBGlobals["gDataPath"].value = "C:\tripsoft\data\mapping\"

but that probably isn't the problem. The error is saying that the object "mapinfo.mbApplications(1)" (whatever that is) doesn't have an object in it called MBGlobals(whatever). You could get a similar error by creating a form from a formclass with CREATEOBJECT() and trying to set a property of a textbox that you had forgotten to include in the form class. I would put in test lines to see if it recognizes any other properties or member objects of that object, which you have given the reference "mbapp". I would start with the simplest thing I could find in the mapinfo documentation. If mapinfo.mbApplications(1) is supposed to have, say, a Name property, I might just put in a line like:

cNameDisplay = mbapp.Name
WAIT WINDOW "mbapp name is "+cNameDisplay NOWAIT

and see if it is what I expect.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform