title is self explanatory how do i convert it to a std::string?
all this LP stuff makes my brain hurt...
twek 0 Newbie Poster
Recommended Answers
Jump to PostIf your program is being compiled for UNICODE and the string is non-English, then more than likely it can not be converted. If English, then there are conversion functions.
Jump to Postbool cvtLPW2stdstring(std::string& s, const LPWSTR pw, UINT codepage = CP_ACP) { bool res = false; char* p = 0; int bsz; bsz = WideCharToMultiByte(codepage, 0, pw,-1, 0,0, 0,0); if (bsz > 0) { p = new char[bsz]; int rc = WideCharToMultiByte(codepage, 0, pw,-1, p,bsz, 0,0); if (rc …
Jump to Postwow ArkM that function is like sent from god himself lol it worked fantastic, is there anywhere i can learn about all these long pointer string and stuff cuz they just dont make any sense to me and there used alot in windows programing
Well, God talks with us via …
All 11 Replies
minas1 1 Junior Poster in Training
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
ArkM 1,090 Postaholic
twek 0 Newbie Poster
ArkM 1,090 Postaholic
twek 0 Newbie Poster
ArkM 1,090 Postaholic
twek 0 Newbie Poster
stiwari 0 Newbie Poster
Narue 5,707 Bad Cop Team Colleague
easysir 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.