I am calling a C/C++ DLL from C# and I am marshalling the parameters to the
API call by doing a type conversion for each parameter.
For example, here is my C++ API method :
short int XENO_API XcDatabaseCodes
(
HWND hwnd,
char FAR * pszDatabase,
char FAR * HUGE * FAR * pszItemCategories
)
The char FAR * HUGE * FAR * parameter is the address to return huge array of
null terminated strings i.e. a list
Here is my C# marshalling definition for this API :
[DllImport("Xenoc32.dll")]
public static extern int XcDatabaseCodes(
string hWindowHandle ,
string pszDatabase,
ref string [] pszItemCategories );
and here is my API call from C#
const string pszDatabase = "\\\\NETWORK\\DATABASE";
string [] pszItemCategories = {};
int shReturnCode = XcDatabaseCodes(
null,
pszDatabase,
ref pszItemCategories );
The call returns ok but the trouble is I only get one item back.
How should I declare and pass pszItemCategories to get the list.