Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

How to create typed array member of c++ typedef struct in ASP.NET

$
0
0
Hello,

I am working on an ASP.NET application and have set it up so I can pass a struct from C++ to C#. I would like this struct to have a typed array that gets correctly converted to an array on the C# side when the COM compiler generates the IDL. I can do this on a method signature by using satype("MyType") as one of the method modifiers. However, the only thing I've been able to do with a type member is an untyped array using SAFEARRAY*. For example (sorry if I have a syntax error below, I'm doing this from memory):

[export,
public,
uuid("...")]
typedef struct {
  int foo;
  SAFEARRAY* bar;
} Baz;


I want to instead be able to indicate the bar array contains elements of a certain type (sort of like what I do with satype on method declaration), or even better, declare it as MyType[]. Is this possible so that I don't have to manage an IntPtr in C#? I would think it would be possible, since it is in the other scenario.

Thanks!!!!

Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>