블로그 이미지
훅크선장

카테고리

분류 전체보기 (363)
사진이야기 (23)
펭귄컴퓨팅 (122)
컴퓨터보안 (84)
절름발이 프로그래머 (59)
하드웨어개조 (23)
멀알려줄까 (35)
잡다한것들 (15)
홈베이킹&홈쿠킹 (2)
Total
Today
Yesterday

달력

« » 2025.7
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

공지사항

태그목록

최근에 올라온 글

C++ 표준 문자열 string 객체를 wchar_t* 타입의 문자열로 바꾸는 함수

wchar_t* string2LPWSTR(const std::string input)
{
// null-call to get the size
size_t needed = ::mbstowcs(NULL,&input[0],input.length());

// allocate
std::wstring output;
output.resize(needed);

// real call
::mbstowcs(&output[0],&input[0],input.length());

// You asked for a pointer
wchar_t *pout = output.c_str();

return pout;
}
Posted by 훅크선장
, |