Search code examples
c++visual-studiovisual-c++visual-c++-2005strcmp

String Compare not working in Visual C++ 2005


If get a gring from the registry and it correctly displays when I place it in a message box. ::MessageBoxW(0, (LPCWSTR)achValue, _T("Found"), MB_YESNO);

The value is stored in archValue which is a DWORD. What I want to do is compare it to the following string "2.0.7045.0" but strcmp fails to work for me.

Any ideas on how to do this wiould be greatly appreciated. Pretty rubbish at c++ and I cant debug easily as its in a dll.

Much appreciated

Tony


Solution

  • You need to use the wide char version of strcmp: wcscmp.