c# - Plnvoke Struct Field that is a char** impossible? Have to use unsafe code -


we have unsafe c# code leveraging c dll setups huge struct. think they're insane , want change use pinvoke instead has pointer char pointer messing me up. e.g. native code:

struct{     ...     char** args;     int    argcount;     ... } nativestruct; 

if weren't marshalling struct , passing arguments native method use:

[dllimport("nativelibrary.dll")] nativemethod(ref string args, int argcount); 

but this:

struct{     string args;     int argcount; } 

just marshals in char* not char**. you're not allowed use ref/out on struct field member, no unmanagedtype seems applicable. seems impossible short of using unsafe code, it?


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo