JonMny
asked on
Is there a macro or an easy way to search an LPCTSTR for a string
I am calling a function that returns a LPCTSTR. I need to search the LPCTSTR for a value. Essentially I need a "Contains" function. Is there a marco that already exists that can do this? If not how can I convert to std::string?
CString is not an option.
CString is not an option.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
size_t l = wcslen(lp);
char * szb = new char(2 * l +1); // some extra buff
wcstombs(szb, lp, 2*l + 1);
s = szb; // assign after converting multi-byte to wide strings
delete [] szb;