{"id":666,"date":"2012-10-26T15:20:23","date_gmt":"2012-10-26T06:20:23","guid":{"rendered":"http:\/\/soundengine.jp\/wordpress\/tips\/?p=666"},"modified":"2014-02-06T23:42:25","modified_gmt":"2014-02-06T14:42:25","slug":"atl%e3%81%aecstring%e3%81%a8wtl%e3%81%aecstring%e3%81%ae%e3%83%91%e3%83%95%e3%82%a9%e3%83%bc%e3%83%9e%e3%83%b3%e3%82%b9%e6%af%94%e8%bc%83","status":"publish","type":"post","link":"https:\/\/soundengine.jp\/wordpress\/tips\/try\/666\/","title":{"rendered":"ATL\u306eCString\u3068WTL\u306eCString\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6bd4\u8f03"},"content":{"rendered":"<p>ATL\u3084MFC\u3067\u4f7f\u308f\u308c\u308bCString\u3068WTL\u3067\u4f7f\u308f\u308c\u308bCString\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u6bd4\u8f03\u3057\u3066\u307f\u3088\u3046\u304b\u3068(ATL\u306fVisual Studio 2008\u306e\u3082\u306e\u3001WTL\u306fWTL 8.0\u306e\u3082\u306e)\u3002<\/p>\n<p>\u6bd4\u8f03\u306f\u3001Release\u30d3\u30eb\u30c9(\u30b9\u30bf\u30c6\u30a3\u30c3\u30af \u30e9\u30a4\u30d6\u30e9\u30ea\u3067 MFC \u3092\u4f7f\u7528\u3059\u308b\u3001ATL \u3092\u4f7f\u7528\u3057\u306a\u3044\u3001\u30c7\u30d0\u30c3\u30b0\u7121\u52b9\u3001\u6700\u5927\u9650\u306e\u6700\u9069\u5316\u3001\u5b9f\u884c\u901f\u5ea6\u3092\u512a\u5148\u3001C++\u306e\u4f8b\u5916\u306a\u3057\u3001\u30e9\u30f3\u30bf\u30a4\u30e0\u578b\u60c5\u5831\u306a\u3057\u306a\u3069)\u3067\u3001pgomgr\u3068<a href=\"http:\/\/soundengine.jp\/wordpress\/tips\/2012\/07\/17\/rdtscread-time-stamp-counter%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e5%8c%96\/\">RdTsc<\/a>\u3092\u7528\u3044\u3066\u8abf\u3079\u305f\u547d\u4ee4\u6570\u3092\u307f\u3066\u307f\u305f\u3002<\/p>\n<p><!--more--><\/p>\n<h2 id=\"content_1_0\">\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u30fb\u30c7\u30b9\u30c8\u30e9\u30af\u30bf  <a class=\"anchor_super\" id=\"n9eb5740\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2008-03-14#n9eb5740\" title=\"n9eb5740\"> <\/a><\/h2>\n<p>\u5358\u306b\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3068\u30c7\u30b9\u30c8\u30e9\u30af\u30bf\u306e\u547d\u4ee4\u6570\u3092\u6bd4\u8f03\u3059\u308b\u305f\u3081\u306b\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3067\u307f\u3066\u307f\u305f\u3002<\/p>\n<pre>ATL::CString strATL;\r\nWTL::CString strWTL;<\/pre>\n<p>pgomgr\u3067ATL::CString\u306e\u5834\u5408\u3001CSimpleStringT::CSimpleStringT\u30fbCStringT::CStringT\u30fbCSimpleStringT::~CSimpleStringT\u30fbCStringData::Release\u30fbCStringT::~CStringT\u3092\u4f7f\u7528\u3057\u547d\u4ee4\u6570\u306f\u8db3\u3057\u306631\u3001WTL::CString\u306e\u5834\u5408\u3001CString::~CString\u3092\u4f7f\u7528\u3057\u547d\u4ee4\u6570\u306f4\u3067\u3042\u3063\u305f\u3002<\/p>\n<p>RdTsc\u3092\u4f7f\u3063\u30661024*1024\u56de\u3067\u306e\u5e73\u5747\u3092\u3068\u308b\u3068ATL::CString\u306f43\u3001WTL::CString\u306f4\u306b\u306a\u3063\u305f\u3002\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3068\u30c7\u30b9\u30c8\u30e9\u30af\u30bf\u3060\u3051\u3067\u306fWTL\u306e\u65b9\u304c\u306f\u308b\u304b\u306b\u8efd\u3044\u3088\u3046\u3060\u3002<\/p>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_1\">\u4ee3\u5165  <a class=\"anchor_super\" id=\"l0fe68b6\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2008-03-14#l0fe68b6\" title=\"l0fe68b6\"> <\/a><\/h2>\n<p>\u77ed\u3044\u6587\u7ae0(13\u6587\u5b57)\u3092\u4ee3\u5165\u3057\u3066\u307f\u305f\u3002<\/p>\n<pre>ATL::CString strATL;\r\nstrATL = _T( \"Hello, world!\" );\r\n\r\nWTL::CString strWTL;\r\nstrWTL = _T( \"Hello, world!\" );<\/pre>\n<p>pgomgr\u3067ATL::CString\u306e\u5834\u5408(\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3001\u30c7\u30b9\u30c8\u30e9\u30af\u30bf\u542b\u3081\u3066)\u547d\u4ee4\u6570\u306f195\u3001WTL::CString\u306e\u5834\u5408\u547d\u4ee4\u6570\u306f121\u3067\u3042\u3063\u305f\u3002RdTsc\u3092\u4f7f\u3063\u30661024*1024\u56de\u3067\u306e\u5e73\u5747\u3092\u3068\u308b\u3068ATL::CString\u306f530\u3001WTL::CString\u306f482\u306b\u306a\u3063\u305f\u3002\u3053\u3053\u3067\u3082WTL\u306e\u65b9\u304c\u8efd\u3044\u3088\u3046\u3060\u3002<\/p>\n<p>\u6b21\u306b\u9577\u3081\u306e\u6587\u7ae0(1300\u6587\u5b57)\u3092\u4ee3\u5165\u3057\u3066\u307f\u305f\u3002<\/p>\n<pre>ATL::CString str;\r\nstr = _T( \"Hello, world!Hello, world!.....<\/pre>\n<p>pgomgr\u3067ATL::CString\u306e\u5834\u5408\u547d\u4ee4\u6570\u306f195\u3001WTL::CString\u306e\u5834\u5408\u547d\u4ee4\u6570\u306f87\u3002RdTsc\u3092\u4f7f\u3063\u30661024*1024\u56de\u3067\u306e\u5e73\u5747\u3092\u3068\u308b\u3068ATL::CString\u306f1500\u3001WTL::CString\u306f4128\u306b\u306a\u3063\u305f\u3002\u9577\u3044\u6587\u5b57\u5217\u306e\u5834\u5408ATL\u306e\u65b9\u304c\u8efd\u3044\u3088\u3046\u3060\u3002<\/p>\n<p>\u3055\u3066\u3001\u3053\u3053\u3089\u3078\u3093\u306e\u901f\u5ea6\u306e\u9055\u3044\u3067\u3042\u308b\u304c\u3001\u30bd\u30fc\u30b9\u3092\u307f\u305f\u611f\u3058\u3067\u306fATL\u3067\u306fHeapAlloc\u3067\u30e1\u30e2\u30ea\u30922624\u30d0\u30a4\u30c8\u78ba\u4fdd\u3057memcpy_s\u3067\u30b3\u30d4\u30fc\u3057\u3066\u3044\u308b\u304c\u3001WTL\u3067\u306fnew\u3067\u30e1\u30e2\u30ea\u30922614\u30d0\u30a4\u30c8\u78ba\u4fdd\u3057memcpy\u3067\u30b3\u30d4\u30fc\u3057\u3066\u3044\u308b\u3068\u3053\u308d\u306e\u5dee\u306a\u306e\u304b\u3082\u3057\u308c\u306a\u3044\u3002\u304c\u3001\u3061\u306a\u307f\u306bGetBuffer( 1300 )\u3067\u306e\u6bd4\u8f03\u3092\u3057\u3066\u307f\u308b\u3068ATL\u306f728\u3001WTL\u306f672\u3068\u306a\u308aWTL\u306e\u65b9\u304c\u901f\u3044\u3002\u3055\u3066\u3001\u3069\u3053\u306b\u9055\u3044\u304c\u3042\u308b\u306e\u304b\u3088\u304f\u898b\u3066\u307f\u308b\u3068ATL::CString\u3067\u306f\u6587\u5b57\u5217\u306e\u9577\u3055\u3092\u53d6\u5f97\u3059\u308b\u3068\u304d\u306bwcslen\u3092\u4f7f\u3063\u3066\u308b\u306b\u5bfe\u3057WTL\u3067\u306flstrlen\u3092\u4f7f\u3063\u3066\u308b\u3088\u3046\u3067\u3053\u3053\u3067\u3069\u3046\u3084\u3089\u901f\u5ea6\u5dee\u304c\u3067\u3066\u3044\u308b\u3088\u3046\u3067\u3042\u3063\u305f\u3002\u3053\u3053\u3067\u306a\u305c\u901f\u5ea6\u5dee\u304c\u51fa\u305f\u304b\u306b\u3064\u3044\u3066\u3060\u304c\u3001wcslen\u306fwcslen.c\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u3088\u3046\u306b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u3042\u308b\u305f\u3081\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u6700\u9069\u5316\u304c\u304b\u304b\u3063\u305f\u53ef\u80fd\u6027\u304c\u3042\u308b\u3002\u305f\u3081\u3057\u306b\u3001\u30dd\u30a4\u30f3\u30bf\u3092\u6e21\u3059\u3088\u3046\u30bd\u30fc\u30b9\u3092\u5909\u66f4\u3059\u308b\u3068<\/p>\n<pre>TCHAR p[] = _T( \"Hello, world!Hello, world!.....\r\nATL::CString str;\r\nstr = p;<\/pre>\n<p>RdTsc\u3092\u4f7f\u3063\u30661024*1024\u56de\u3067\u306e\u5e73\u5747\u3092\u3068\u308b\u3068ATL::CString\u306f4125\u3001WTL::CString\u306f4128\u306b\u306a\u3063\u305f\u3002\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u9577\u3044\u6642\u306b\u306f\u5b9f\u969b\u306b\u306f\u5bfe\u3057\u305f\u5909\u308f\u3089\u306a\u3044\u3053\u3068\u304c\u5206\u304b\u308b\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u6587\u5b57\u5217\u306e\u9577\u3055\u3092\u4e0e\u3048\u3066\u3042\u3052\u305f\u5834\u5408<\/p>\n<pre>TCHAR p[] = _T( \"Hello, world!Hello, world!.....\r\nATL::CString str;\r\nstr = ATL::CString( p, 1300 );<\/pre>\n<p>RdTsc\u3092\u4f7f\u3063\u30661024*1024\u56de\u3067\u306e\u5e73\u5747\u3092\u3068\u308b\u3068ATL::CString\u306f1423\u3001WTL::CString\u306f1390\u306b\u306a\u3063\u305f\u3002<\/p>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_2\">\u30d5\u30a9\u30fc\u30de\u30c3\u30c8  <a class=\"anchor_super\" id=\"l4aa6a85\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2008-03-14#l4aa6a85\" title=\"l4aa6a85\"> <\/a><\/h2>\n<p>\u305d\u306e\u4ed6\u826f\u304f\u4f7f\u3046\u3082\u306e\u3068\u3057\u3066\u306f\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u304c\u3042\u308b\u3053\u308c\u3092\u6bd4\u8f03\u3057\u3066\u307f\u3088\u3046\u304b\u3068\u3002<\/p>\n<pre>ATL::CString str;\r\nstr.Format( _T( \"%d%f\\r\\n\" ), 0, 0.0 );<\/pre>\n<p>pgomgr\u3067ATL::CString\u306e\u5834\u5408\u547d\u4ee4\u6570\u306f173\u3001WTL::CString\u306e\u5834\u5408\u547d\u4ee4\u6570\u306f437\u3002R<br \/>\nRdTsc\u3092\u4f7f\u3063\u30661024*1024\u56de\u3067\u306e\u5e73\u5747\u3092\u3068\u308b\u3068ATL::CString\u306f5735\u3001WTL::CString\u306f7505\u306b\u306a\u3063\u305f\u3002ATL\u306e\u65b9\u304c\u901f\u3044\u3088\u3046\u3060\u3002ATL\u3067\u306fvswprintf_s\u3092\u4f7f\u3063\u3066\u308b\u306e\u306b\u5bfe\u3057WTL\u3067\u306f\u72ec\u81ea\u306e\u30d1\u30fc\u30b9\u30eb\u30fc\u30c1\u30f3\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_3\">\u7d50\u5408  <a class=\"anchor_super\" id=\"l2e3423e\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2008-03-14#l2e3423e\" title=\"l2e3423e\"> <\/a><\/h2>\n<pre>ATL::CString str1;\r\nATL::CString str2 = _T( \"Hello, world!\" );\r\n\r\nfor( int n = 0; n &lt; 1024 * 1024; n++ )\r\n{\t\r\n\tstr1 += str2;\r\n}<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u7d50\u5408\u3057\u305f\u3068\u3053\u308d\u3001RdTsc\u3092\u4f7f\u3063\u3066\u5e73\u5747\u3092\u3068\u308b\u3068ATL::CString\u306f217\u3001WTL::CString\u306f4550\u306b\u306a\u3063\u305f\u3002\u3053\u308c\u306b\u3064\u3044\u3066\u306f\u3001ATL\u306e\u65b9\u304c\u9ad8\u901f\u3067\u3042\u308b\u3002<\/p>\n<p>\u3068\u3044\u3046\u611f\u3058\u3067\u3055\u307b\u3069\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306f\u5909\u308f\u3089\u306a\u3044\u3068\u307f\u3066\u3044\u3044\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3046\u3002\u7121\u96e3\u306bATL::CString\u3092\u9078\u629e\u3057\u3066\u3082\u554f\u984c\u306a\u3044\u304b\u3068\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ATL\u3084MFC\u3067\u4f7f\u308f\u308c\u308bCString\u3068WTL\u3067\u4f7f\u308f\u308c\u308bCString\u306e\u30d1\u30d5\u30a9\u30fc &hellip; <a href=\"https:\/\/soundengine.jp\/wordpress\/tips\/try\/666\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-666","post","type-post","status-publish","format-standard","hentry","category-try"],"_links":{"self":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/666","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/comments?post=666"}],"version-history":[{"count":12,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/666\/revisions"}],"predecessor-version":[{"id":3221,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/666\/revisions\/3221"}],"wp:attachment":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/media?parent=666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/categories?post=666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/tags?post=666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}