i am trying to pass an array of struct exported from a c# library to c++ code. the objective is to pass SAFEARRAY of struct from c++ to c#.
I have followed instructions from
but getting this error with the call GetRecordInfoFromTypeInfo
0x80028019 Old format or invalid type library.
If you don’t need to have a dispinterface, following should work:
If you need to use SAFEARRAY, I would expect following to work (but I am not 100% sure, as I don’t have Windows machine available at the moment):
If you can afford to change your
structtoclassthen this will also work, and save you from UDT hassle: