0
我嘗試調用的DllImport以下艾莎函數(從documentation時:P /調用EntryPointNotFoundException試圖分配指針容器
#define snd_seq_client_info_alloca(ptr) __snd_alloca(ptr, snd_seq_client_info)
上堆分配snd_seq_client_info_t 容器
下面是我在C++中發現的一個實現,它是在閱讀類似於我想要在Mono中完成的application的代碼時:
snd_seq_client_info_t* cinfo;
snd_seq_client_info_alloca(&cinfo);
這裏就是我有這麼遠,但它不工作:
[DllImport(libasound.so.2)]
private static extern void snd_seq_client_info_alloca(out IntPtr ptr);
internal static void MyFunction()
{
IntPtr clientInfo = IntPtr.Zero;
snd_seq_client_info_alloca(out clientInfo);
// and then some more ...
}
,但我得到以下異常:
System.EntryPointNotFoundException: snd_seq_client_info_alloca
at (wrapper managed-to-native)
MonoMultiJack.ConnectionWrapper.Alsa.LibAsoundWrapper:snd_seq_client_info_alloca (intptr&)
`EntryPointNotFoundException`和`#define`。噢,有時候只是忽略了那些顯而易見的東西。謝謝。至少它現在編譯,我只需要搜索庫代碼來分配內存大小。 – Residuum 2010-11-23 11:55:26