Reputation: 7620
I have a function which takes pointer value as argument in my C Static Library. Now I am writing C/CLI wrapper on it which in turn will be used in C# code.
long function_C( PULONG pulsize, PULONG pulcount );
Wrapper Function C++/CLI
long function_Managed( System::Uint^ size, System::Uint^ pulcount );
I am calling function_C function from function_Managed.Now I facing problem to convert System::Uint^ PULONG.
My Query is
1. is this correct do this.
2. If this is correct than how to convert System::Uint^ to PULONG
Upvotes: 1
Views: 2093
Reputation: 62985
long function_C(PULONG pulsize, PULONG pulcount);
int function_Managed(unsigned% size, unsigned% count)
{
unsigned long lsize = size, lcount = count;
long const ret = function_C(&lsize, &lcount);
size = lsize, count = lcount;
return ret;
}
To C# code, function_Managed
will have this signature:
int function_Managed(ref uint size, ref uint count)
Upvotes: 1