Just change the export to your native DLL:
extern "C" __declspec(dllexport) int xSetTestString(wchar_t* pSettingsXML);
This will do the trick.
BTW - char* str1 = (wchar_t*)pSettingsXML;, . wchar_t* char* wcstombs_s. .
: IMO , TCHAR* wchar_t* dll. Character Set - Unicode. TCHAR* wchar_t*.
Mirosoft : ANSI, 1- , FunctionNameA Unicode, 2- , FunctionNameW. UTF-16.
UTF-8 - , 1- 2 . UTF-8 UTF-16 MultiByteToWideChar.