I cannot find a way to resolve this.
The dll routine is written in C. It accepts one input and returns two values.
In the code block that references the routine, as written I get:
"Cannot pass 'Socket' as a ref or out argument because it is a 'fixed variable' "
But if I change the call to:
if (DB_Get_VecSockAddr(acName, out &soc[0], out &len) != 0)
byte []soc = new byte[52];
Then I get:
"You can only take the address of an unfixed expression inside of a fixed statement initializer"
[DllImport("ENVDBLDll.dll", EntryPoint = "DB_Get_VecSockAddr", CharSet = CharSet.Ansi)] unsafe public static extern int DB_Get_VecSockAddr(char * acVecName, out byte* soc, out int* len); ........... unsafe { int len = 0; fixed ( char *acName = &acVECname[0] ) { fixed (byte* Socket = &soc[0]) { if (DB_Get_VecSockAddr(acName, out Socket, out &len) != 0) { } } } }
I'm confused.
How is this supposed to work?
I am using VS 2010, c#
Boyd
BDM