I’m using managed c++ to implement a method that returns a string. I declare the method in my header file using the following signature:
String^ GetWindowText()
However, when I’m using this method from C#, the signature is:
string GetWindowTextW();
How do I get rid of the extra ‘W’ at the end of the method’s name?
To get around the preprocessor hackery of the Windows header files, declare it like this:
Note that, if you actually use the Win32 or MFC
GetWindowText()routines in your code, you’ll need to either redefine the macro or call them asGetWindowTextW().