{"id":2201,"date":"2010-12-02T23:37:00","date_gmt":"2010-12-02T14:37:00","guid":{"rendered":"https:\/\/hdmr.org\/d\/?e=958"},"modified":"2010-12-02T23:37:00","modified_gmt":"2010-12-02T14:37:00","slug":"blogn-958","status":"publish","type":"post","link":"https:\/\/hdmr.org\/d\/?e=958","title":{"rendered":"Windows API\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3059\u308b"},"content":{"rendered":"<p>\u671d\u3001\u51fa\u5e2d\u78ba\u8a8d\u306e\u305f\u3081\u306b\u6559\u5ba4\u306b\u884c\u304f\u3068\u3001\u4ed6\u306e\u7814\u7a76\u5ba4\u306e\u5b66\u751f\u306b\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u30b3\u30d4\u30fc\u3092C++\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067\u3057\u305f\u3044\u306e\u3060\u304c\u3001\u3069\u3046\u3059\u308c\u3070\u3088\u3044\u304b\u3068\u805e\u304b\u308c\u305f\u3002<\/p>\n<p>Windows API\u306b\u305d\u3046\u3044\u3046\u95a2\u6570\u304c\u3042\u308b\u306f\u305a\u3060\u304b\u3089\u305d\u308c\u3092\u4f7f\u3046\u3068\u3044\u3044\u3088\u3068\u7b54\u3048\u305f\u3002<\/p>\n<p>\u307e\u3041\u50d5\u306a\u3089\u305d\u3046\u3044\u3046\u3053\u3068\u306fPerl\u3067\u3084\u308b\u3093\u3067\u3059\u3051\u3069\u3001C++\u3067\u30b3\u30d4\u30fc\u4ee5\u5916\u306e\u90e8\u5206\u306f\u4f5c\u3063\u305f\u304b\u3089\u3068\u8a00\u3046\u304b\u3089\u305d\u308c\u306a\u3089\u305d\u3046\u304b\u306a\u3068\u601d\u3063\u305f\u3002<\/p>\n<hr \/>\n<p> \u305d\u306e\u5f8c\u3001\u663c\u904e\u304e\u306b\u3053\u306e\u3053\u3068\u306b\u3064\u3044\u3066\u8cea\u554f\u3092\u3057\u306b\u7814\u7a76\u5ba4\u306b\u3084\u3063\u3066\u304d\u305f\u3002 <\/p>\n<pre>char file1[100],file2[100];\nstd::sprintf(file1,\"C:\\\\hoge\\\\%s.csv\",key);\nstd::sprintf(file2,\"C:\\\\hage\\\\%s.csv\",key);\nCopyFile((LPCTSTR)file1,(LPCTSTR)file2,FALSE);<\/pre>\n<p>\u3053\u3046\u66f8\u3044\u305f\u3089\u30b3\u30d4\u30fc\u3067\u304d\u306a\u3044\u3068\u3044\u3046\u3002<\/p>\n<p>sprintf\u3060\u3089\u3051\u3060\u306a\u3001\u3053\u308c\u306f\u306a\u3044\u308f\u3068\u601d\u3063\u305f\u304c\u3001\u3088\u304f\u8003\u3048\u305f\u3089C++\u3063\u3066\u6a19\u6e96\u3067\u306f\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u6307\u5b9a\u3057\u3066\u6587\u5b57\u5217\u3092\u51fa\u3059\u306e\u3063\u3066\u96e3\u3057\u3044\u306e\u3088\u306d\u3002<\/p>\n<p>\u3044\u3044\u65b9\u6cd5\u304c\u306a\u3044\u3082\u3093\u3060\u304b\u3089\u3001boost::format\u3092\u4f7f\u3063\u3066\u3044\u305f\u3082\u306e\u3060\u3002(\u53c2\u8003 : <a href=\"http:\/\/www.kmonos.net\/alang\/boost\/classes\/format.html\">letsboost::format<\/a>)<\/p>\n<p>\u3082\u3063\u3068\u3082\u3053\u306e\u90e8\u5206\u306f\u6587\u5b57\u5217\u306e\u8db3\u3057\u7b97\u3067\u3082\u66f8\u3051\u307e\u3059\u3051\u3069\u306d\u3002\u305f\u3060\u3081\u3093\u3069\u304f\u3055\u3044\u304b\u3089\u5168\u90e8sprintf\u3067\u3084\u3063\u3066\u305f\u3089\u3057\u3044\u3002<\/p>\n<p>\u30e1\u30e2\u30ea\u7834\u58ca\u306e\u53ef\u80fd\u6027\u304c\u3042\u308b\u304b\u3089\u3044\u3044\u65b9\u6cd5\u3067\u306f\u306a\u3044\u306e\u3060\u304c\u3001\u307e\u3041\u3068\u308a\u3042\u3048\u305a\u3053\u308c\u3067\u3082\u3044\u3044\u304b\u3002<\/p>\n<hr \/>\n<p>\u306a\u3093\u3067\u52d5\u304b\u306a\u3044\u306e\u304b\u3001\u307d\u3061\u307d\u3061\u8abf\u3079\u3066\u7406\u7531\u304c\u308f\u304b\u3063\u305f\u3002<\/p>\n<p>Windows API\u306b\u304a\u3051\u308b\u3001LPCTSTR\u3068\u3044\u3046\u306e\u306fconst wchar_t *\u306e\u610f\u5473\u3089\u3057\u3044\u3002<\/p>\n<p>\u30ef\u30a4\u30c9\u6587\u5b57\u5217\u306a\u306e\u306d\u3002\u305d\u3046\u3044\u3048\u3070Windows API\u3063\u3066\u305d\u3046\u3067\u3057\u305f\u306d\u3002<\/p>\n<p>\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u3066\u30ef\u30a4\u30c9\u6587\u5b57\u5217\u3092\u4f7f\u308f\u306a\u3044\u3068\u3044\u3046\u306e\u3082\u624b\u3067\u306f\u3042\u308b\u304c\u3001\u3053\u3053\u3067\u306f\u30ef\u30a4\u30c9\u6587\u5b57\u5217\u3092\u4f7f\u3046\u3053\u3068\u3068\u3057\u305f\u3002<\/p>\n<p>char\u3092wchar_t\u306b\u3001\u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\u306f\u30ef\u30a4\u30c9\u6587\u5b57\u5217\u3068\u3044\u3046\u3053\u3068\u3067 L&#8221;hoge&#8221; \u306e\u3088\u3046\u306bL\u3092\u3064\u3051\u3066\u66f8\u304f\u3002<\/p>\n<p>\u3053\u308c\u3060\u3051\u6c17\u3092\u3064\u3051\u308c\u3070\u3055\u3057\u305f\u308b\u554f\u984c\u306f\u7121\u3044\u3002<\/p>\n<hr \/>\n<p>\u305d\u3046\u3044\u3046\u3053\u3068\u3092\u8e0f\u307e\u3048\u3066\u50d5\u304c\u66f8\u304f\u3068\u3059\u308c\u3070\u3053\u3046\u304b\u306a\u3002<\/p>\n<pre>std::wstring file1=(boost::format(L\"C:\\\\hoge\\\\%1%.csv\") % key).str();\nstd::wstring file2=(boost::format(L\"C:\\\\hage\\\\%1%.csv\") % key).str();\nCopyFile((LPCTSTR)file1.c_str(),(LPCTSTR)file2.c_str(),FLASE);<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u304b\u306d\u3002<\/p>\n<p>wchar_t\u7248\u306estd::string\u306fstd::wstring\u306b\u306a\u308a\u307e\u3059\u3002\u305d\u308c\u3050\u3089\u3044\u3057\u304b\u5909\u3048\u308b\u3068\u3053\u308d\u306a\u3044\u3051\u3069\u306d\u3002<\/p>\n<hr \/>\n<p>OS\u306b\u4f9d\u5b58\u3059\u308b\u3051\u308c\u3069\u3082\u3001\u3053\u3046\u8a00\u3046\u98a8\u306bC\u3084C++\u3067\u3082\u554f\u984c\u306a\u304f\u66f8\u3051\u308b\u308f\u3051\u3060\u3002<\/p>\n<p>\u305f\u3060\u3001Windows\u3067\u306f\u3053\u3046\u3060\u3051\u3069UNIX\u7cfb\u3067\u306f\u307e\u305f\u9055\u3046\u308f\u3051\u3067\u305d\u306e\u305f\u3073\u306b\u8003\u3048\u306a\u3044\u3068\u306a\u3089\u3093\u306e\u306f\u4e0d\u4fbf\u3060\u308d\u3046\u306d\u3002<\/p>\n<p>Perl\u3084Ruby\u3067\u306f\u3053\u306e\u3042\u305f\u308a\u6a19\u6e96\u3067\u3042\u308b\u306e\u3092\u4f7f\u3048\u3070\u3044\u3044\u304b\u3089\u4fbf\u5229\u3060\u306d\u3068\u3002<\/p>\n<p>\u3053\u3046\u3044\u3046\u51e6\u7406\u306e\u5834\u5408\u3001\u901f\u5ea6\u306f\u8981\u6c42\u3055\u308c\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3089\u3001\u305d\u306e\u3088\u3046\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u8a00\u8a9e\u306e\u65b9\u304c\u9069\u3057\u3066\u3044\u308b\u3067\u3057\u3087\u3046\u306d\u3002<\/p>\n<p>\u3042\u3068\u3001\u3082\u30461\u3064\u6848\u3068\u3057\u3066\u306f\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3084\u30d0\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u3067\u66f8\u304f\u3068\u3044\u3046\u306e\u304c\u3042\u308b\u304b\u3002<\/p>\n<p>\u30b7\u30a7\u30eb\u306b\u4f9d\u5b58\u3059\u308b\u3051\u3069\u3001\u305d\u308c\u3082\u305d\u308c\u3067\u3044\u3044\u65b9\u6cd5\u3060\u3068\u601d\u3046\u3093\u3067\u3059\u3051\u3069\u306d\u3002<\/p>\n<hr \/>\n<p>\u305f\u3060\u3001\u5f7c\u306f\u7814\u7a76\u3067\u76f4\u63a5\u306b\u4f7f\u3046\u304b\u3089C++\u306f\u4f7f\u3048\u308b\u3051\u3069\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u8a00\u8a9e\u306e\u985e\u306f\u4f7f\u3048\u306a\u3044\u306e\u3060\u308d\u3046\u3002<\/p>\n<p>\u305f\u3060\u624b\u52d5\u3067\u3084\u308b\u306e\u306f\u3068\u3093\u3067\u3082\u306a\u3044\u3068C++\u3067\u66f8\u3044\u305f\u306e\u3060\u308d\u3046\u3002<\/p>\n<p>\u305d\u3046\u3044\u3046\u4eba\u306f\u591a\u3044\u3068\u601d\u3046\u304c\u3001C\u30fbC++\u306f\u914d\u5217\u3084\u3089\u6587\u5b57\u5217\u3084\u3089\u306e\u9762\u3067\u4f7f\u3044\u52dd\u624b\u304c\u60aa\u3044\u3002\u901f\u3044\u306e\u306f\u3044\u3044\u3093\u3067\u3059\u3051\u3069\u306d\u3002<\/p>\n<p>\u3053\u3046\u3044\u3046\u3068\u304d\u697d\u3067\u304d\u308b\u3088\u3046\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u8a00\u8a9e\u306e\u985e\u3092\u77e5\u3063\u3066\u304a\u304f\u3053\u3068\u306f\u5927\u5207\u3060\u3088\u306a\u3001\u3068\u6539\u3081\u3066\u601d\u3063\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u671d\u3001\u51fa\u5e2d\u78ba\u8a8d\u306e\u305f\u3081\u306b\u6559\u5ba4\u306b\u884c\u304f\u3068\u3001\u4ed6\u306e\u7814\u7a76\u5ba4\u306e\u5b66\u751f\u306b\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u30b3\u30d4\u30fc\u3092C++\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067\u3057\u305f\u3044\u306e\u3060\u304c\u3001\u3069\u3046\u3059\u308c\u3070\u3088\u3044\u304b\u3068\u805e\u304b\u308c\u305f\u3002 Windows API\u306b\u305d\u3046\u3044\u3046\u95a2\u6570\u304c\u3042\u308b\u306f\u305a\u3060\u304b\u3089\u305d\u308c\u3092\u4f7f\u3046\u3068\u3044\u3044\u3088\u3068\u7b54\u3048\u305f\u3002  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2201","post","type-post","status-publish","format-standard","hentry","category-computer"],"_links":{"self":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts\/2201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2201"}],"version-history":[{"count":0,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts\/2201\/revisions"}],"wp:attachment":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}