Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem passing array to .NET COM
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01523745
Message ID:
01524050
Vues:
56
For starters, many thanks to you and Rick for your ideas in this discussion. They're extremely appreciated.

As for usage, here's a better explanation of what I'm doing: The contact list will be generated within our existing VFP application and then sent to the .NET DLL. It will always be one-way. VFP never needs to receive a contact list back. Another item to note is that this process will run via a service that will likely be scheduled in the middle of the night, so performance is not an issue here.

I initially went the array route when trying to test sending a single contact up, but when I couldn't get VFP to pass it correctly, I switched to an XML approach. When researching this issue, I did take a look at all of the documentation and examples of wwDotNetBridge and in my mind, the ideal solution would have been to work with the object type directly as Rick laid out, especially since it made the most sense to me, but I don't have access to the checkbook. :)

Since performance doesn't really matter for this project, the below .NET class modifications seem like a good way to go.

>>John,
>>
>>Since you are in control of the .NET code I would highly recommend that you simplify this and add methods that create these objects and add them to an internally managed array. This is way easier than trying to hand code up some XML and then serializing/deserializing.
>>
>>Create a private property private Contacts[] contacts in your .NET class then create AddContact() and GetContact() (possibly RemoveContact()). You can pass values via parameters or pass in Contact objects which you can easily create via COM.
>
>That's basically what I suggested to Jon in my first reply before he switched to an XML based approach.
>I'm not sure I'd dismiss the XML approach without knowing more about the expected usage. If, for example, a couple of hundred contacts were being added then pushing them over the wire one at a time rather than as an array may not be so attractive? Ditto in the opposite direction if a complete list is required on the client side......
Jon Rosenbaum
Devcon Drummer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform