Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM and Access/Assign
Message
De
19/10/1998 19:00:46
Eric Barnett
Barnett Solutions Group, Inc
Sonoma, Californie, États-Unis
 
 
À
19/10/1998 17:59:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00146877
Message ID:
00148319
Vues:
27
Fanstastic! I'd all but given up but I didn't even think to sniff out the way the string was being represented over the COM layer. Gotta love those Variants.

I'll try it out. I've noticed some other Access/Assign stuff that doesn't work right over COM either: like when you've got a property of an object whose value is calculated via the Access method, i.e.

DEFINE CLASS Object
Property=0

FUNC Property_Assign
RETURN CalculatedValue (where CalculatedValue is some calculation)
ENDFUNC

ENDDEFINE

Calling from VFP returns CalculatedValue. Calling from COM returns 0.

Any ideas?

Eric Shaneson
Cutting Edge Consulting

>Hi Eric.
>
>>I have created a COM object in VFP6.0 that has several properties with
>Access/Assign methods. When I use them from inside VFP they work fine. However, when I create the class as a COM object they do not seem to work at all.
>
>This concerned me greatly because I've created a collection class with the same mechanism as you describe -- allowing a character "index" into the collection. However, I hadn't tried this class as a COM object, and when I did, I got the same error you did. Fortunately, after tracking this down a bit, I found the cause of the problem: strings passed to a COM object are terminated with CHR(0), so you have to strip that off before checking to see if that string can be found in your collection. Once I made that change, the COM version worked exactly the same as the VFP version.
>
>Doug
Eric Shaneson
Cutting Edge Consulting
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform