{"id":285,"date":"2014-05-06T13:49:40","date_gmt":"2014-05-06T04:49:40","guid":{"rendered":"https:\/\/prg.waou.biz\/?p=285"},"modified":"2019-01-14T07:33:54","modified_gmt":"2019-01-13T22:33:54","slug":"dll%e3%81%ae%e4%bd%9c%e6%88%90","status":"publish","type":"post","link":"https:\/\/prg.waou.biz\/?p=285","title":{"rendered":"DLL\u306e\u4f5c\u6210"},"content":{"rendered":"<p><a href=\"https:\/\/prg.waou.biz\/wp-content\/uploads\/TDll.zip\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a><\/p>\n<p>\u25a0\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u3064\u3044\u3066<\/p>\n<p>A:\u300cWin32\u30b3\u30f3\u30bd\u30fc\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u300d\u300cDLL\u300d\uff08\u8ffd\u52a0\u30aa\u30d7\u30b7\u30e7\u30f3\u306a\u3057\uff09<\/p>\n<p>B:\u300cWin32\u30b3\u30f3\u30bd\u30fc\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u300d\u300cDLL\u300d\uff08\u30b7\u30f3\u30dc\u30eb\u3092\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\uff09<br \/>\n\u30d5\u30a1\u30a4\u30eb\u306fA\u3068\u540c\u3058\u3060\u304c\u3001CPP,H\u306bEXPORTS\u6587\u3042\u308a\u3002<\/p>\n<p>C:\u300cWin32\u30b3\u30f3\u30bd\u30fc\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u300d\u300cDLL\u300d\uff08\u7a7a\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\uff09<br \/>\n\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u7b49\u4e00\u5207\u306a\u3057\u3002<\/p>\n<p>\u306a\u304a\u3001\u9078\u629e\u306f\u300cWin32\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u300d\u304b\u3089\u3082\u3067\u304d\u308b\u304c\u3001\u7d50\u679c\u306f\u300cWin32\u30b3\u30f3\u30bd\u30fc\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u300d\u3068\u5909\u308f\u3089\u306a\u3044\u3002<\/p>\n<p>\u8981\u306f\u7a7a\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u3059\u308b\u3068\u30d5\u30a1\u30a4\u30eb\u306f\u4f55\u3082\u4f5c\u6210\u3055\u308c\u305a\u3001\u3053\u3053\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u306a\u3044\u3067\u304a\u304f\u3068cpp,\u30d5\u30a1\u30a4\u30eb\u7b49\u304c\u4f5c\u6210\u3055\u308c\u308b\u3002h\u30d5\u30a1\u30a4\u30eb\u306f\u4f5c\u6210\u3055\u308c\u306a\u3044\u3002\u30b7\u30f3\u30dc\u30eb\u3092\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3059\u308b\u3068\u4f5c\u6210\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306b\u4f55\u3084\u3089\u66f8\u304b\u308c\u308b\u3068\u3044\u3046\u3053\u3068\u3002<br \/>\n<strong>\u7a7a\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3068\u306f\u305b\u305a\u306b\u3001\u30b7\u30f3\u30dc\u30eb\u3092\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3057\u306a\u3044\u306e\u304c\u3084\u308a\u3084\u3059\u305d\u3046\u3002<\/strong><\/p>\n<p>\u25a0DLL\u306e\u4f5c\u6210\uff08\u3053\u306e\u4f8b\u3067\u306f\u300cTDll\u300d\u304c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\uff09<\/p>\n<p>[\u30d5\u30a1\u30a4\u30eb]-[\u65b0\u898f\u4f5c\u6210]-[\u30d7\u30ed\u30b8\u30a7\u30af\u30c8]\u3067\u3001\u300c\u65b0\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u300d\u753b\u9762\u3092\u8d77\u52d5\u3002<br \/>\n\u305d\u306e\u753b\u9762\u306e[\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8]\u3067\u3001[Win32 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8]\u3092\u9078\u629e\u3002<br \/>\n \u540c\u753b\u9762\u306e[\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d]\u3067\u3001\u4f5c\u6210\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u540d\u4ed8\u3051\u308b\u4efb\u610f\u306e\u540d\u524d\u3092\u5165\u529b\u3002<br \/>\n[OK]\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3002<br \/>\n<a href=\"https:\/\/prg.waou.biz\/wp-content\/uploads\/21.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prg.waou.biz\/wp-content\/uploads\/21-300x190.jpg\" alt=\"2\" width=\"300\" height=\"190\" class=\"alignnone size-medium wp-image-288\" srcset=\"https:\/\/prg.waou.biz\/wp-content\/uploads\/21-300x190.jpg 300w, https:\/\/prg.waou.biz\/wp-content\/uploads\/21-200x126.jpg 200w, https:\/\/prg.waou.biz\/wp-content\/uploads\/21.jpg 759w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u300cWin32 \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 \u30a6\u30a3\u30b6\u30fc\u30c9\u300d\u753b\u9762\u304c\u8d77\u52d5\u3002<br \/>\n[\u6b21\u3078]\u3092\u30af\u30ea\u30c3\u30af\u3057\u3001\u305d\u306e\u753b\u9762\u306e[\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u7a2e\u985e]\u3067\u3001DLL\u3092\u9078\u629e\u3057\u3001[\u5b8c\u4e86]\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3002<br \/>\n<a href=\"https:\/\/prg.waou.biz\/wp-content\/uploads\/31.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prg.waou.biz\/wp-content\/uploads\/31-300x173.jpg\" alt=\"3\" width=\"300\" height=\"173\" class=\"alignnone size-medium wp-image-287\" srcset=\"https:\/\/prg.waou.biz\/wp-content\/uploads\/31-300x173.jpg 300w, https:\/\/prg.waou.biz\/wp-content\/uploads\/31-200x115.jpg 200w, https:\/\/prg.waou.biz\/wp-content\/uploads\/31.jpg 605w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/prg.waou.biz\/wp-content\/uploads\/41.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prg.waou.biz\/wp-content\/uploads\/41-300x189.jpg\" alt=\"4\" width=\"300\" height=\"189\" class=\"alignnone size-medium wp-image-291\" srcset=\"https:\/\/prg.waou.biz\/wp-content\/uploads\/41-300x189.jpg 300w, https:\/\/prg.waou.biz\/wp-content\/uploads\/41-200x126.jpg 200w, https:\/\/prg.waou.biz\/wp-content\/uploads\/41.jpg 627w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\ncpp\u30d5\u30a1\u30a4\u30eb\u306b\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\u3002\uff08\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u65e2\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u30b3\u30fc\u30c9\u306f\u305d\u306e\u307e\u307e\uff09<\/p>\n<p>\u305d\u306e\u4e0b\u306b\u5fc5\u8981\u306a\u95a2\u6570\u3092\u8a18\u8ff0\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u3001\u8db3\u3057\u7b97\u95a2\u6570\u3002<\/p>\n<p>int __stdcall TestFunc(int x, int y)<br \/>\n {<br \/>\n return x + y;<br \/>\n }<\/p>\n<p><def \u8a2d\u5b9a><\/p>\n<p>DEF\u30d5\u30a1\u30a4\u30eb\u306b\u3001\u30a8\u30af\u30b9\u30dd\u30fc\u30c8(\u5916\u90e8\u516c\u958b)\u3059\u308b\u95a2\u6570\u306e\u540d\u524d\u3092\u63d0\u793a\u3002<br \/>\nDEF\u30d5\u30a1\u30a4\u30eb\u306e\u7d44\u307f\u8fbc\u307f\u306f\u3001[\u30d7\u30ed\u30b8\u30a7\u30af\u30c8]-[\u65b0\u3057\u3044\u9805\u76ee\u306e\u8ffd\u52a0]\u3067\u3001[\u30e2\u30b8\u30e5\u30fc\u30eb\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb(def)]\u3092\u9078\u629e\u3002\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u5165\u529b\u3057\u3001[\u8ffd\u52a0]\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3002(\u30d5\u30a1\u30a4\u30eb\u540d\u306f\u3001\u4f55\u3067\u3082\u826f\u304f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u3068\u540c\u3058\u540d\u3067\u3082\u53ef\u80fd)<br \/>\n<a href=\"https:\/\/prg.waou.biz\/wp-content\/uploads\/51.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prg.waou.biz\/wp-content\/uploads\/51-300x221.jpg\" alt=\"5\" width=\"300\" height=\"221\" class=\"alignnone size-medium wp-image-290\" srcset=\"https:\/\/prg.waou.biz\/wp-content\/uploads\/51-300x221.jpg 300w, https:\/\/prg.waou.biz\/wp-content\/uploads\/51-200x147.jpg 200w, https:\/\/prg.waou.biz\/wp-content\/uploads\/51.jpg 698w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u4f5c\u6210\u3055\u308c\u305fDEF\u30d5\u30a1\u30a4\u30eb\u306e\u4e00\u756a\u4e0b\u306b EXPORTS \u3068\u8a18\u8ff0\u3002<br \/>\nEXPORTS \u306e\u4e0b\u65b9\u306b\u3001\u30a8\u30af\u30b9\u30dd\u30fc\u30c8(\u5916\u90e8\u516c\u958b)\u3059\u308b\u5404\u7a2e\u95a2\u6570\u306e\u540d\u524d\u3092\u3001\u884c\u5358\u4f4d\u3067\u8a18\u8ff0\u3002<br \/>\n \u4f8b\u3048\u3070\u3001<br \/>\nint TestFunc(int x, int y)\u306e\u95a2\u6570\u3092\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3059\u308b\u5834\u5408\u306f\u3001<\/p>\n<p>LIBRARY<br \/>\nEXPORTS<br \/>\n TestFunc<\/p>\n<p>[\uff8b\uff9e\uff99\uff84\uff9e]-[\uff7f\uff98\uff6d\uff70\uff7c\uff6e\uff9d\u306e\uff8b\uff9e\uff99\uff84\uff9e]\u3067\u3001Debug\u30d5\u30a9\u30eb\u30c0\u5185\u306bDLL\u304c\u4f5c\u6210\u3055\u308c\u308b\u3002<\/def><\/p>\n<p>\u25a0C#\u304b\u3089\u5229\u7528<br \/>\n DllImport(&#8220;TDll.dll&#8221;, EntryPoint = &#8220;TestFunc&#8221;)]<br \/>\n        public static extern int TestFunc(int x, int y);<\/p>\n<p>        private void button1_Click(object sender, EventArgs e)<br \/>\n        {<br \/>\n            textBox1.Text = TestFunc(9, 6).ToString();<br \/>\n        }<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9 \u25a0\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u3064\u3044\u3066 A:\u300cWin32\u30b3\u30f3\u30bd\u30fc\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u300d\u300cDLL\u300d\uff08\u8ffd\u52a0\u30aa\u30d7\u30b7\u30e7\u30f3\u306a\u3057\uff09 B:\u300cWin32\u30b3\u30f3\u30bd\u30fc\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u300d\u300cDLL\u300d\uff08\u30b7\u30f3\u30dc\u30eb\u3092\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\uff09 \u30d5\u30a1\u30a4\u30eb\u306fA\u3068\u540c\u3058\u3060\u304c [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_lightning_design_setting":[],"footnotes":""},"categories":[17],"tags":[],"class_list":["post-285","post","type-post","status-publish","format-standard","hentry","category-windowsapi"],"_links":{"self":[{"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/posts\/285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=285"}],"version-history":[{"count":7,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/posts\/285\/revisions"}],"predecessor-version":[{"id":988,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/posts\/285\/revisions\/988"}],"wp:attachment":[{"href":"https:\/\/prg.waou.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}