Re: [問題] C++轉C#結構

看板C_Sharp作者 (生の直感、死の予感)時間16年前 (2009/07/21 10:59), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《gd3727 (燦爛流星)》之銘言: : 請問C#要如何引用下面的 C++ 方法與指標結構? : //bt_api.h (coredll.dll) : HANDLE RegisterBluetoothCOMPort : ( : LPCWSTR lpszType, // "BSP" or "COM" : DWORD dwIndex, // device index : PORTEMUPortParams* pParams // BT specific params : ); : typedef struct _portemu_port_params { : int channel; : int flocal; : BT_ADDR device; : int imtu; : int iminmtu; : int imaxmtu; : int isendquota; : int irecvquota; : GUID uuidService; : unsigned int uiportflags; : } PORTEMUPortParams; : //ws2bth.h : typedef ULONGLONG bt_addr, *pbt_addr, BT_ADDR, *PBT_ADDR; : 我只懂得… : [DllImport("coredll")] : private static extern int RegisterBluetoothCOMPort( : string lpszType, : uint dwIndex,...... : 接下來就不知道怎麼改寫了…。謝謝。 [StructLayout(LayoutKind.Sequential)] public _portemu_port_params { public int channel; ... } 可能需要條 structLayout 裡面的變數 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 154.20.172.64
文章代碼(AID): #1APIxyC_ (C_Sharp)
討論串 (同標題文章)
文章代碼(AID): #1APIxyC_ (C_Sharp)