dipaksmistry Posted May 14, 2007 Share Posted May 14, 2007 Hi,I have written a small programme in VC.Its code is as below.################################################################################################################include "stdafx.h"#include <tchar.h>#include <Shellapi.h>#include <malloc.h>#include <stdlib.h>int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ TCHAR t3[15]; t3[0] = 65279; // equivalent to 0xFEFF, (in my real application this byte is read from a unicode file // in UTF-16 format and its value is 0xFEFF) t3[1] =_T('a'); t3[2] =_T('b'); t3[3] =_T('c'); t3[4] =_T('d'); t3[5] =_T('e'); t3[6] =_T(''); if ((lstrcmpi (t3,_T("abcde"))) == 0) { MessageBox(NULL,_T("two strings are equal"), _T("match result"), MB_OK); } else { MessageBox(NULL,_T("NOT EQUAL"), _T("match result"), MB_OK); } return 1;}################################################################################################################I have build it and made a executable.Not when I run this executable on XP machine(with SP2 installed), it gives messages one.("two strings are equal"). string comparison passes on XP machine.But when I run this application on Vista machine it gives second message.("NOT EQUAL")string comparison fails on Vista machine.Do anybody have any idea, why this is happening....? Link to comment Share on other sites More sharing options...
fizban2 Posted May 15, 2007 Share Posted May 15, 2007 i don't think we have many coders on teh apps forum here, your best bet is the the MSDN forum over at MS, have you checked teh Vista SDK to see if the functionality was changed in vista? Link to comment Share on other sites More sharing options...
wrecklesswun Posted July 30, 2007 Share Posted July 30, 2007 different version of the c runtimes? is this compiled in .net or c++6? Link to comment Share on other sites More sharing options...
Bezalel Posted August 2, 2007 Share Posted August 2, 2007 t3[6] =_T('/0'); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now