Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trouble accessing COM object properties
Message
 
 
À
16/04/2003 18:22:35
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00778657
Message ID:
00779386
Vues:
19
>First, every time I try to get or set a property I get COM error 1426.

Which is useless without the text of the message. 1426 just signifies that it didn't work, without any details.

>HRESULT Property([out, retval] BSTR* pstrRetVal)

Which is nothing you have to worry about, VFP takes care of the ins and outs for you (if you'll excuse the pun).

>One thing to note is if I place a period after the property, intellisense displays a list of the valid property values to choose from which are displayed as properties.

Hmm, that should happen only if you press "=", and an enum is defined. Sure it's a property and not an object or member of a collection?

>Second, I don't know how to get successful return codes from the COM functions. When I execute one of the COM object functions, the documentation suggests that in C++, a 0 should be returned to HRESULT when a function call is successful. I don't know how to do the same in FoxPro.

You don't need to get the HRESULT. If it doesn't return S_OK, VFP will throw an error, and you can trap that. But if you absolutely, positively must get the HRESULT for some reason, search the MSFT KB for "howto hresult foxpro stewart" and you should get an article showing you how to do this.
Mike Stewart
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform