1

I have comm+ object built in vb6 dll, what i am trying to do it read comm+ proxy object built in vb6 to map in c# class object (Getting system._ComObject)

I have added vb6 dll to reference here, vb6 dll is COM registered, i am able to access property with object.property name but i am not able to cast or clone /Map object .

I am getting system._ComObject as value, I have many interface , i am able to map by creating class but for many interface its getting difficult to create class in c# app from vb6 interface for mapping

If there is any alternate way i can get direct access to those it would be better , some how i can see values of objects rather than system._Comobject

Ideally I would like to use deepclone without reflection for comm+ proxy vb6 object ?

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Viken Patel
  • 77
  • 1
  • 5
  • 1
    What have you tried so far? What happens? Can you put more detail? – StayOnTarget Sep 30 '20 at 10:48
  • FYI I edited your comment into the question, which is what you should do in the future. Its encouraged to edit the question to improve it as needed. – StayOnTarget Oct 01 '20 at 11:40
  • Can you show the code where you are creating and then trying to access the properties of the COM (not "comm") object? – tcarvin Oct 05 '20 at 12:27

1 Answers1

0

The only way I know of to do this is to serialize / deserialize the VB6 COM object into a new object.

One way to do this using JSON as the intermediary is here: https://stackoverflow.com/a/52412110/3195477

Now, presumably the JSON serializer is using some reflection calls to inspect the objects & figure out how to serialize them. This implies that you could reconstruct just that portion of the logic for a more "pure" approach. (Or maybe someone has already done this).

Also note that the answer I pointed to mentions that the correct COM 'proxy' object has to be used. So it might be that if you investigate a bit more, using a tool like DeepCloner on the correct object could also work. But I haven't tried that.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81