看板 C_Sharp 關於我們 聯絡資訊
目前在寫一個用 C# 呼叫 win32 api 的小程式 其中有個function不太知道怎麼使用,麻煩指導一下(初學c#) 以下為 Win32 Function 的傳入內容 ULONG abc( PWCHAR Disk, ULONG Session, PVOID List, PULONG size ); 其中 [in] PVOID List [in,out] PULONG size List:User allocated buffer which will receive the list as a multi-string size:Points to a ULONG containing the size of exclusionList. ======================================================================== 我在C#的宣告中, unsafe static extern ulong abc (string Disk, ulong Session, void* List, ulong* size); 我比較不懂的是在 最後兩個參數的怎使用,有看過別人在c裡頭的用法如下 ULONG Size = 32; BYTE *x = new BYTE[32]; abc(Disk, Session,x,&Size); 好像就是 allocate 32個 byte,x 這個 pointer 指到第一個 那在C#中該怎麼使用呢?感謝... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 124.11.141.144
pico2k:google "C# Marshal" ... 02/20 16:57
Flychop:不好意思,可以再縮小範圍嗎?我已經 google過了 thx 02/20 21:11