J
johnsto
I'm really stuck - can someone help me!
I've got a basic setup consisting of two things:
1. A C# web service
2. An unmanaged C++ DLL
The WS is intended to call some functions in the DLL. The DLL has some
legacy code which requires char* in its method parameters.
I also have a new file in the DLL which is basically an intermediary -
the WS can call the exported functions from this file, which then call
the legacy code. The problem is converting from the native C# strings in
the WS to the char*'s in the C++ code.
So, the WS calls method(string) in the DLL, and the DLL then needs to
call method(char*) in its C++ code, where string==char*.
At the moment I have the DLL exporting method(String*)'s, but of course
in C# I can't get the address of a string to pass to the method. If I
change the DLL methods to method(String) (ie. no pointer), the compiler
complains that they HAVE to be pointers. I can't use method(char*)
either because then I'm back to the original problem of C# not wanting
to call a method with a char* in it.
Help!
I've got a basic setup consisting of two things:
1. A C# web service
2. An unmanaged C++ DLL
The WS is intended to call some functions in the DLL. The DLL has some
legacy code which requires char* in its method parameters.
I also have a new file in the DLL which is basically an intermediary -
the WS can call the exported functions from this file, which then call
the legacy code. The problem is converting from the native C# strings in
the WS to the char*'s in the C++ code.
So, the WS calls method(string) in the DLL, and the DLL then needs to
call method(char*) in its C++ code, where string==char*.
At the moment I have the DLL exporting method(String*)'s, but of course
in C# I can't get the address of a string to pass to the method. If I
change the DLL methods to method(String) (ie. no pointer), the compiler
complains that they HAVE to be pointers. I can't use method(char*)
either because then I'm back to the original problem of C# not wanting
to call a method with a char* in it.
Help!