{"categories":["C#","C++"],"version":"1.0","height":"190","published":"2017-01-28 12:00:00","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/Takachan/","title":"C#\u3068C++\u9593\u3067char*\u3082\u3057\u304f\u306fLPSZ\u3092\u3084\u308a\u53d6\u308a\u3059\u308b","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakap-tech.com%2Fentry%2F2017%2F01%2F28%2F120000\" title=\"C#\u3068C++\u9593\u3067char*\u3082\u3057\u304f\u306fLPSZ\u3092\u3084\u308a\u53d6\u308a\u3059\u308b - PG\u65e5\u8a8c\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":"https://cdn-ak.f.st-hatena.com/images/fotolife/T/Takachan/20170115/20170115150341.jpg","blog_url":"https://takap-tech.com/","author_name":"Takachan","blog_title":"PG\u65e5\u8a8c","url":"https://takap-tech.com/entry/2017/01/28/120000","width":"100%","description":"C#\u304b\u3089C++\u306eDLL\u3092\u547c\u3073\u51fa\u3059\u305f\u3081\u306bDllImport\u3057\u305f\u3068\u304d\u306bchar*\u304c\u5f15\u6570\u306b\u3042\u308b\u5834\u5408\u306e\u3084\u308a\u53d6\u308a\u306e\u4ed5\u65b9\u3067\u3059\u3002 C++\u5074\u306f\u30b7\u30b0\u30cd\u30c1\u30e3\u3092\u6301\u3064\u30b3\u30fc\u30c9\u304c\u3042\u3063\u305f\u5834\u5408 // C++\u5074\u5ba3\u8a00 uint32_t __stdcall Function(char* szMessage); // \u3082\u3057\u304f\u306f uint32_t __stdcall Function(LPSTR szMessage); C#\u5074\u306e\u76f8\u4e92\u904b\u7528\u6642\u306e\u547c\u3073\u51fa\u3057\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 // szMessage \u304c[IN]\u3060\u3051\u306e\u5834\u5408 [DllImport(\"Hoge.dll\", EntryPoint=\"Function\", /* CharSet = \u2026","type":"rich"}