Passing complex information via COM to C# from Delphi code
For various reasons, such as protect开发者_开发知识库ing investment, etc. I need to pass a series of complex records (numerous fields and records) back and forth between Delphi and a C# program. I guess I should be using IEnumVariant, but don't seem to able to design this with the typelibrary designer.
Any help would be appreciated.
Thanks
Update
I guess what I am trying to ask needs some explanation of the complexity of the data.
I need to export to C# (or any other language really), via COM a collection of 'records', each made up of a collection of 'fields', each made up of a number of attributes.
So it is a collection of a collection of a collection! Don't ask me how we got here, we just have.
So I'm have Attribute -> Field -> Record sort of structure. I have a grasp of what I need to export (I can't post any details here for company reasons), but don't know how to start to export that data in COM.
Probably I should start by creating a test program from scratch which will mimic the structures I need, and then gradually COMize them and see where I get to.
Encapsulate the info in classes. Works well in any language, works well in COM too.
I'm going to answer my own question!
I created a series of classes that dessended from IEnumVARIANT, representing the different collections of bits of data, the list and the record. Each fields was a simple COM interface definition.
I used examples from this location, as I implement the collections of fields / records / etc as TList.
精彩评论