Comparing a TCHAR to "whatever" not working

Im trying to have a while loop go through until a TCHAR variable is = "name" but after the loop completes it reports back that it was never = to *name* but after going back through the list it clearly was. My loop is-

1
2
3
4
5
6
7
8
9
10
11
12
13
        while(me32.szModule != "client.dll"){
            cout << me32.szModule << endl;
            Module32Next(snapshot,&me32);
            if(me32.szModule == "client.dll"){
                cout << "Found: " << me32.modBaseAddr << endl;
                system("PAUSE");
            }
            else if(GetLastError() == ERROR_NO_MORE_FILES){
                cout << "client.dll Not Found" << endl;
                system("PAUSE");
                exit(1);
            }
        }

Taken from a file i wrote out the results too, its clearly listed but its saying its not.
client.dll
me32.szModule != "client.dll"

This code is comparing some pointers, not the C-strings they are pointing to. Either convert them to an std::string or just use strcmp.
Thanks.
Topic archived. No new replies allowed.