我有一個c庫有cdecl回調。我怎樣才能使用這些從C#。如何使用cdecl回調與pinvoke
一切似乎是說,他們必須STDCALL回調
是明確的:
delegate int del();
[dllimport("mylib.dll",CallingConvention=CallingConvention.Cdecl)]
public static extern int funcwithcallback(del foo);
德爾地方必須調用CDECL明智與.NET 2.0,使用
你想創建在C#`Cdecl`回調(即`Cdecl`函數,非託管代碼可以調用),或者是你試圖從C#調用非託管(即本機C)`Cdecl`函數? – 2011-02-09 00:03:54