{"id":192,"date":"2006-11-01T06:42:54","date_gmt":"2006-10-31T21:42:54","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=192"},"modified":"2017-01-31T19:50:22","modified_gmt":"2017-01-31T10:50:22","slug":"c-lpcstr-type%ec%9d%84-lpolestr-type%ec%9c%bc%eb%a1%9c-%eb%b3%80%ed%99%98","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=192","title":{"rendered":"[C++] LPCSTR Type\uc744 LPOLESTR Type\uc73c\ub85c \ubcc0\ud658"},"content":{"rendered":"<pre>HRESULT __fastcall AnsiToUnicode(LPCSTR pszA, LPOLESTR* ppszW) { \r\n    ULONG cCharacters;\r\n    DWORD dwError;\r\n\r\n    \/\/ If input is null then just return the same.\r\n    if (NULL == pszA)\r\n    {\r\n        *ppszW = NULL;\r\n        return NOERROR;\r\n    }\r\n\r\n    \/\/ Determine number of wide characters to be allocated for the\r\n    \/\/ Unicode string.\r\n    cCharacters =  strlen(pszA)+1;\r\n\r\n    \/\/ Use of the OLE allocator is required if the resultant Unicode\r\n    \/\/ string will be passed to another COM component and if that\r\n    \/\/ component will free it. Otherwise you can use your own allocator.\r\n    *ppszW = (LPOLESTR) CoTaskMemAlloc(cCharacters*2);\r\n    if (NULL == *ppszW)\r\n        return E_OUTOFMEMORY;\r\n\r\n    \/\/ Covert to Unicode.\r\n    if (0 == MultiByteToWideChar(CP_ACP, 0, pszA, cCharacters,\r\n                  *ppszW, cCharacters))\r\n    {\r\n        dwError = GetLastError();\r\n        CoTaskMemFree(*ppszW);\r\n        *ppszW = NULL;\r\n        return HRESULT_FROM_WIN32(dwError);\r\n    }\r\n\r\n    return NOERROR;\r\n}<\/pre>\n<p>SOAP, SOAP, SOAP, SOAP.. \uc9c0\uae08 \ub0b4 \uba38\ub9ac\uc18d\uc5d4 \ube44\ub204\ubc29\uc6b8\uc774 \uc544\ub978 \uc544\ub978~ \uc544\uce68 \ucd9c\uadfc\ud560\ub54c \uac10\uae30 \ubc14\uc774\ub7ec\uc2a4\uac00 \ubab8\uc5d0 \uce68\ud22c\ub97c \ud588\ub098\ubd80\ub2e4. \ubab8\uc5d0 \uc5f4&#8230; \uc810\uc2ec\ub54c \ud6c4\uc2dd\uc73c\ub85c \uba39\uc740 \ube75\uc774 \ubd88\ub7c9\uc2dd\ud488\uc774\uc600\ub098\ubd80\ub2e4. \uc18d\uc774 \ubd80\uae00\ubd80\uae00.. \ubf08\ub97c \uc2f9\uc778\ub2e4\ub294 Coco Cola\ub85c \uc77c\ub2e8 \uc18d\uc744 \ub2ec\ub798\ub294 \uc911&#8230;.<\/p>\n<p>\uc73c.. \uc544\uae4c \ucf5c\ub77c \uc0ac\ub7ec 1\uce35 \ud3b8\uc758\uc810\uc5d0 \uac00\ub824\uace0 \uc5d8\ub9ac\ubca0\uc774\ud130\ud0c0\ub824\uace0 \uae30\ub2e4\ub9ac\ub294\ub370 (\uc0ac\ubb34\uc2e4\uc740 11\uce35).. \uc774 \ub188\uc758 \uac74\ubb3c\uc758 \uc5d8\ub9ac\ubca0\uc774\ud130\uc758 \uc6c0\uc9c1\uc774\ub294 \uc18d\ub3c4\uac00 \uc815\ub9d0 \uc7a5\ub09c\uc774 \uc544\ub2c8\ub2e4.. \uac00\ub054 \uc5d8\ub9ac\ubca0\uc774\ud130\ub97c \uae30\ub2e4\ub9ac\ub294 \uac74\uc9c0&#8230; \ud55c\uc5c6\uc774 \uac10\uac10 \ubb34\uc18c\uc2dd\uc73c\ub85c \uc624\uc9c0 \uc54a\ub294 \uc9c0\ud558\ucca0\uc744 \uae30\ub2e4\ub9ac\ub294\uac74\uc9c0&#8230;.. \uc131\uc9c8 \uae09\ud55c \uc0ac\ub78c\uc740 \uac00\ub054 \ud654\uac00 \ub0a0 \ubc95\ub3c4 \ud558\ub2e4.. \ub098\uac19\uc774 \uc624\ub298\ucc98\ub7fc \ub9d0\uc774\ub2e4..<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HRESULT __fastcall AnsiToUnicode(LPCSTR pszA, LPOLESTR* ppszW) { ULONG cCharacters; DWORD dwError; \/\/ If input is null then just return the same. if (NULL == pszA) { *ppszW = NULL; return NOERROR; } \/\/ Determine number of wide characters to be allocated for the \/\/ Unicode string. cCharacters = strlen(pszA)+1; \/\/ Use of the OLE allocator &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=192\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;[C++] LPCSTR Type\uc744 LPOLESTR Type\uc73c\ub85c \ubcc0\ud658&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117,8],"tags":[],"class_list":["post-192","post","type-post","status-publish","format-standard","hentry","category-cpp","category-programming"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=192"}],"version-history":[{"count":1,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/192\/revisions"}],"predecessor-version":[{"id":3711,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/192\/revisions\/3711"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=192"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}