Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Populating an in parameter array
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Populating an in parameter array
Divers
Thread ID:
00877468
Message ID:
00877468
Vues:
57
Hi! I have to create a com object that receives an array as an in parameter and populates it. The syntax of the following function is as follows:

HRESULT GetSessions([in] long lClientID, [in] VARIANT vaSessions)

Precondition:
• vaSessions.vt must be either VT_ARRAY | VT_UNKNOWN or VT_ARRAY |
VT_DISPATCH.
• The SAFEARRAY contained in vaSessions must have exactly the same number of elements as
the client has sessions.

Postcondition:
• The SAFEARRAY in vaSessions will contain the ISession objects corresponding to the client’s sessions.

My function receives the array. However, I cannot populate it. It seems that the array's elements are objects but I cannot access them. When I try to set the array's elements to objects returned by the createObject function, they can be populated but the array returned is empty.

The functional spec contains the following note:
The vaSessions parameter is an [in] parameter. This conflicts with COM rules because data are returned in this parameter. However, due to the fact that the Database component is loaded inproc and not marshaled, this method works correctly.

The Note indicates that what I am trying to do is illegal but should work anyway. Is there something I need to do to make it work anyway? I am really stuck. Any help would be greatly appreciated.

Thanks,
Eylon
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform