{"id":1727,"date":"2019-07-31T13:44:37","date_gmt":"2019-07-31T05:44:37","guid":{"rendered":"https:\/\/www.xiaobo.li\/?p=1727"},"modified":"2019-07-31T14:02:30","modified_gmt":"2019-07-31T06:02:30","slug":"c-c%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b%e5%af%b9%e7%85%a7","status":"publish","type":"post","link":"https:\/\/www.xiaobo.li\/notes\/archives\/1727","title":{"rendered":"C++ \/ C# \u6570\u636e\u7c7b\u578b\u5bf9\u7167"},"content":{"rendered":"\n<table class=\"wp-block-table\"><tbody><tr><td>C++ \u8f93\u5165\u8f93\u51fa&nbsp;&nbsp;&nbsp; C#&nbsp;<br>==================================<br>char chr[255]&nbsp;&nbsp; O&nbsp;&nbsp;&nbsp; StringBuilder<br>KCA_DIR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I&nbsp;&nbsp;&nbsp; int<br>LPCSTR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I&nbsp;&nbsp;&nbsp; string<br>int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; I&nbsp;&nbsp;&nbsp; int<br>LPSTR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; O&nbsp;&nbsp;&nbsp; StringBuilder<br>int*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; O&nbsp;&nbsp;&nbsp; out int<br>DWORD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; I&nbsp;&nbsp;&nbsp; int<br>DWORD*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; O&nbsp;&nbsp;&nbsp; out int<br>BOOL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I&nbsp;&nbsp;&nbsp; bool<br>Rc_DBMgr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I&nbsp;&nbsp;&nbsp; IntPtr<br>long*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; O&nbsp;&nbsp;&nbsp; out long <\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>\nAPI\u4e0eC#\u7684\u6570\u636e\u7c7b\u578b\u5bf9\u5e94\u5173\u7cfb\u8868\n\n<\/td><\/tr><tr><td>API\u6570\u636e\u7c7b\u578b<\/td><td>\u7c7b\u578b\u63cf\u8ff0<\/td><td>C#\u7c7b\u578b<\/td><td>API\u6570\u636e\u7c7b\u578b<\/td><td>\u7c7b\u578b\u63cf\u8ff0<\/td><td>C#\u7c7b\u578b<\/td><\/tr><tr><td>WORD<\/td><td>16\u4f4d\u65e0\u7b26\u53f7\u6574\u6570<\/td><td>ushort<\/td><td>CHAR<\/td><td>\u5b57\u7b26<\/td><td>char<\/td><\/tr><tr><td>LONG<\/td><td>32\u4f4d\u65e0\u7b26\u53f7\u6574\u6570<\/td><td>int<\/td><td>DWORDLONG<\/td><td>64\u4f4d\u957f\u6574\u6570<\/td><td>long<\/td><\/tr><tr><td>DWORD<\/td><td>32\u4f4d\u65e0\u7b26\u53f7\u6574\u6570<\/td><td>uint<\/td><td>HDC<\/td><td>\u8bbe\u5907\u63cf\u8ff0\u8868\u53e5\u67c4<\/td><td>int<\/td><\/tr><tr><td>HANDLE<\/td><td>\u53e5\u67c4,32\u4f4d\u6574\u6570<\/td><td>int<\/td><td>HGDIOBJ<\/td><td>GDI\u5bf9\u8c61\u53e5\u67c4<\/td><td>int<\/td><\/tr><tr><td>UINT<\/td><td>32\u4f4d\u65e0\u7b26\u53f7\u6574\u6570<\/td><td>uint<\/td><td>HINSTANCE<\/td><td>\u5b9e\u4f8b\u53e5\u67c4<\/td><td>int<\/td><\/tr><tr><td>BOOL<\/td><td>32\u4f4d\u5e03\u5c14\u578b\u6574\u6570<\/td><td>bool<\/td><td>HWM<\/td><td>\u7a97\u53e3\u53e5\u67c4<\/td><td>int<\/td><\/tr><tr><td>LPSTR<\/td><td>\u6307\u5411\u5b57\u7b26\u768432\u4f4d\u6307\u9488<\/td><td>string<\/td><td>HPARAM<\/td><td>32\u4f4d\u6d88\u606f\u53c2\u6570<\/td><td>int<\/td><\/tr><tr><td>LPCSTR<\/td><td>\u6307\u5411\u5e38\u5b57\u7b26\u768432\u4f4d\u6307\u9488<\/td><td>String<\/td><td>LPARAM<\/td><td>32\u4f4d\u6d88\u606f\u53c2\u6570<\/td><td>int<\/td><\/tr><tr><td>BYTE<\/td><td>\u5b57\u8282<\/td><td>byte<\/td><td>WPARAM<\/td><td>32\u4f4d\u6d88\u606f\u53c2\u6570<\/td><td>int<\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>\n<strong>Wtypes.h&nbsp;<\/strong><strong>\u4e2d\u7684\u975e\u6258\u7ba1\u7c7b\u578b<\/strong>\n\n<\/td><td>\n<strong>\u975e\u6258\u7ba1&nbsp;C&nbsp;<\/strong><strong>\u8bed\u8a00\u7c7b\u578b<\/strong>\n\n<\/td><td>\n<strong>\u6258\u7ba1\u7c7b\u540d<\/strong>\n\n<\/td><td>\n<strong>\u8bf4\u660e<\/strong>\n\n<\/td><\/tr><tr><td>\n<strong>HANDLE<\/strong>\n\n<\/td><td>\n<strong>void*<\/strong>\n\n<\/td><td>\nSystem.IntPtr\n\n<\/td><td>\n32&nbsp;\u4f4d\n\n<\/td><\/tr><tr><td>\n<strong>BYTE<\/strong>\n\n<\/td><td>\n<strong>unsigned char<\/strong>\n\n<\/td><td>\nSystem.Byte\n\n<\/td><td>\n8&nbsp;\u4f4d\n\n<\/td><\/tr><tr><td>\n<strong>SHORT<\/strong>\n\n<\/td><td>\n<strong>short<\/strong>\n\n<\/td><td>\nSystem.Int16\n\n<\/td><td>\n16&nbsp;\u4f4d\n\n<\/td><\/tr><tr><td>\n<strong>WORD<\/strong>\n\n<\/td><td>\n<strong>unsigned short<\/strong>\n\n<\/td><td>\nSystem.UInt16\n\n<\/td><td>\n16&nbsp;\u4f4d\n\n<\/td><\/tr><tr><td>\n<strong>INT<\/strong>\n\n<\/td><td>\n<strong>int<\/strong>\n\n<\/td><td>\nSystem.Int32\n\n<\/td><td>\n32&nbsp;\u4f4d\n\n<\/td><\/tr><tr><td>\n<strong>UINT<\/strong>\n\n<\/td><td>\n<strong>unsigned int<\/strong>\n\n<\/td><td>\nSystem.UInt32\n\n<\/td><td>\n32&nbsp;\u4f4d\n\n<\/td><\/tr><tr><td>\n<strong>LONG<\/strong>\n\n<\/td><td>\n<strong>long<\/strong>\n\n<\/td><td>\nSystem.Int32\n\n<\/td><td>\n32&nbsp;\u4f4d\n\n<\/td><\/tr><tr><td>\n<strong>BOOL<\/strong>\n\n<\/td><td>\n<strong>long<\/strong>\n\n<\/td><td>\nSystem.Int32\n\n<\/td><td>\n32&nbsp;\u4f4d\n\n<\/td><\/tr><tr><td>\n<strong>DWORD<\/strong>\n\n<\/td><td>\n<strong>unsigned long<\/strong>\n\n<\/td><td>\nSystem.UInt32\n\n<\/td><td>\n32&nbsp;\u4f4d\n\n<\/td><\/tr><tr><td>\n<strong>ULONG<\/strong>\n\n<\/td><td>\n<strong>unsigned long<\/strong>\n\n<\/td><td>\nSystem.UInt32\n\n<\/td><td>\n32&nbsp;\u4f4d\n\n<\/td><\/tr><tr><td>\n<strong>CHAR<\/strong>\n\n<\/td><td>\n<strong>char<\/strong>\n\n<\/td><td>\nSystem.Char\n\n<\/td><td>\n\u7528&nbsp;ANSI&nbsp;\u4fee\u9970\u3002\n\n<\/td><\/tr><tr><td>\n<strong>LPSTR<\/strong>\n\n<\/td><td>\n<strong>char*<\/strong>\n\n<\/td><td>\nSystem.String&nbsp;\u6216System.StringBuilder\n\n<\/td><td>\n\u7528&nbsp;ANSI&nbsp;\u4fee\u9970\u3002\n\n<\/td><\/tr><tr><td>\n<strong>LPCSTR<\/strong>\n\n<\/td><td>\n<strong>Const char*<\/strong>\n\n<\/td><td>\nSystem.String&nbsp;\u6216System.StringBuilder\n\n<\/td><td>\n\u7528&nbsp;ANSI&nbsp;\u4fee\u9970\u3002\n\n<\/td><\/tr><tr><td>\n<strong>LPWSTR<\/strong>\n\n<\/td><td>\n<strong>wchar_t*<\/strong>\n\n<\/td><td>\nSystem.String&nbsp;\u6216System.StringBuilder\n\n<\/td><td>\n\u7528&nbsp;Unicode&nbsp;\u4fee\u9970\u3002\n\n<\/td><\/tr><tr><td>\n<strong>LPCWSTR<\/strong>\n\n<\/td><td>\n<strong>Const wchar_t*<\/strong>\n\n<\/td><td>\nSystem.String&nbsp;\u6216System.StringBuilder\n\n<\/td><td>\n\u7528&nbsp;Unicode&nbsp;\u4fee\u9970\u3002\n\n<\/td><\/tr><tr><td>\n<strong>FLOAT<\/strong>\n\n<\/td><td>\n<strong>Float<\/strong>\n\n<\/td><td>\nSystem.Single\n\n<\/td><td>\n32&nbsp;\u4f4d\n\n<\/td><\/tr><tr><td>\n<strong>DOUBLE<\/strong>\n\n<\/td><td>\n<strong>Double<\/strong>\n\n<\/td><td>\nSystem.Double\n\n<\/td><td>\n64&nbsp;\u4f4d<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>STDINT.H<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">typedef   signed          char int8_t;<br>\ntypedef   signed short     int int16_t;<br>\ntypedef   signed           int int32_t;<br>\ntypedef   signed       __INT64 int64_t;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/* exact-width unsigned integer types *\/<br>\ntypedef unsigned          char uint8_t;<br>\ntypedef unsigned short     int uint16_t;<br>\ntypedef unsigned           int uint32_t;<br>\ntypedef unsigned       __INT64 uint64_t;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/* 7.18.1.2 <em>\/ \/<\/em> smallest type of at least n bits <br><em>\/ \/<\/em> minimum-width signed integer types *\/<br> typedef   signed          char int_least8_t;<br> typedef   signed short     int int_least16_t;<br> typedef   signed           int int_least32_t;<br> typedef   signed       __INT64 int_least64_t;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/* minimum-width unsigned integer types *\/<br>\ntypedef unsigned          char uint_least8_t;<br>\ntypedef unsigned short     int uint_least16_t;<br>\ntypedef unsigned           int uint_least32_t;<br>\ntypedef unsigned       __INT64 uint_least64_t;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/* 7.18.1.3 <em>\/\n\/<\/em> fastest minimum-width signed integer types *\/<br>\ntypedef   signed           int int_fast8_t;<br>\ntypedef   signed           int int_fast16_t;<br>\ntypedef   signed           int int_fast32_t;<br>\ntypedef   signed       __INT64 int_fast64_t;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/* fastest minimum-width unsigned integer types *\/<br>\ntypedef unsigned           int uint_fast8_t;<br>\ntypedef unsigned           int uint_fast16_t;<br>\ntypedef unsigned           int uint_fast32_t;<br>\ntypedef unsigned       __INT64 uint_fast64_t;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">typedef   signed       __INT64 intptr_t;<br>typedef unsigned       __INT64 uintptr_t;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C++ \u8f93\u5165\u8f93\u51fa&nbsp;&nbsp;&nbsp; C#&nbsp;===== &hellip; <a href=\"https:\/\/www.xiaobo.li\/notes\/archives\/1727\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[299,296],"tags":[],"class_list":["post-1727","post","type-post","status-publish","format-standard","hentry","category-csharpcode","category-c"],"_links":{"self":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/1727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/comments?post=1727"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/1727\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/media?parent=1727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/categories?post=1727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/tags?post=1727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}