I'm attempting to call a 3rd-party DLL from C#, and I'm having trouble marshalling some string data. The DLL was written with Clarion, and I'm not very familiar with the data types being used. Specifically, the spec has this signature for a function that I can't get to work:
Bool QuerySoftwareVersion( cstring* version) // edited documentation typo
//Returns Software version (20 character cstring).
I was assuming that the cstring was just a null-terminated string, but I wasn't able to get it to work with out char[] version
in my definition. Anyone know the right way to handle this?
EDIT: Actually, what I've found thus far suggests that a cstring in Clarion is indeed just a null-terminated string.
UPDATE: I've updated the title of the question and the details because it turns out that there was a typo in the DLL documentation. The version
parameter in question is declared as type cstring*
not cstringt*. And in Clarion,
cstring` is apparently just a c-style, null-terminated string. So the marshalling shouldn't be that complicated, since they claim it was written with C calling conventions. Has anyone successfully p/invoked a Clarion DLL that passes strings via a reference param?