Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM & Data Types
Message
De
19/07/2000 14:26:12
 
 
À
19/07/2000 10:55:13
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00393575
Message ID:
00394454
Vues:
9
>We have a COM object with a method that accepts a parameter passed by reference. It populates that parameter with a certain string, dependant upon other factors. It returns the length of the string, or 0 if an error occurs(somewhat similar to that of the GetShortPathName API function).

It's bad design because as you found, COM isn't conducive to passing variables by reference. API functions are different because they usually require that the memory is allocated externally, and the API function just fills the buffer. COM is a completely different beast.

Your COM method should be rewritten to just return the string. If you want to know the length, check it on the client, and if you absolutely must have the value and the length in one return value, return it as a structure-like string that you can parse when you get it back.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform