How to marshal a COM-Parameter as VT_ARRAY of VT_RECORD
- by Oliver Japes
I've already done some extensive search, but I can't seem to find anything matching my problem.
The task I'm currently working on is to create a WCF-Wrapper for some DCOM-Objects. This already works great for the most parts, but now I'm stuck with one invocation that expects a VT_ARRAY containing VT_RECORD-Objects.
Marshalling as VT_ARRAY is not a problem, but how can I tell COM that the elements in this array are VT_RECORDs?
This is the invocation as I current use it.
InitTestCase(testCaseName, parameterFileName, testCase, cellInfos.ToArray());
The parameter I'm talking about is the last one. It's defined as List<CellInfo>, CellInfo itself is already attributed with Guid("7D422961-331E-47E2-BC71-7839E9E77D39") and ComVisible(true). It's not a struct but a class.
This is the condition failing on the native side: if (VT_RECORD == varCellConfig.vt)...
Because of old software using these interfaces, changing the native side is not an option
Any idea?