calling C/C++ DLL that takes a pointer to LPTSTR



The C definition is along the lines of:

LONG SetFilenames( LONG nFiles, LPCSTR* lpFileNames);

Where the lpFileNames is an array of LPCSTR's.

The ultimate DLL that needs to be called is a 3rd party's module,
but there is a C/C++ DLL which is a wrapper for the 3rd party
module, this wrapper is called directly by C#. There does not
appear that such a method signature can be called direct from C#.
What tactic should be used to get a collection of strings from C#
to the wrapper class? A fellow developer suggested that I define
a struct in C# that simply contains a string. I know that it
would work, but it is messy and I am looking for a more straight
forward, cleaner approach. Any ideas?

Sam
.


Loading