I'm experimenting in VC.NET, as several may have noticed.
I have some strings in VC++ of type ViChar[255]. How can I return these to
VB in a form that VB sees as a string, which I assume is a pointer to a
System::String object created within my C code?
My present solution is highly inelegant, using memcpy to copy the bytes from
the address of the ViChar string to a char array that can then be returned.
VB then sees it as an SByte array and I have to loop through the array to
rebuild the original string.
I have been unable to declare a function parameter as ViChar[] since I get
into the circular loop;
error C2697: 'test' : must explicitly specify __gc or __nogc for an array
declared in a managed type
or
error
C3150: 'test' : '__gc' can only be applied to a class, struct,
interface, array or pointer
depending on whether I put the __gc there or not.
--
Dr. Craig Graham, Software Engineer
Advanced Analysis and Integration Limited, UK. http://www.aail.co.uk/