Any idea how to port this code from C# to C++?
[DllImport("shlwapi.dll", CharSet = CharSet.Unicode)]
private static extern int StrCmpLogicalW(string psz1, string psz2);
If I tried this line in my header file in C++, the compiler generated a bunch of error.
#include <Shlwapi.h>
I finally got it figured out. Here is the function. It is critical that you put the shlwapi.h and vcclr.h header files before any of your own header files if you have any. That was the issue I have been struggled with. Don’t fully understand why it is. If anyone have an good explanation, welcome to make comment. Also, if anyone know how to combine the last three line of code to a single return statement, welcome to add comment.