c# pinvoke SndGetSoundFileList?
I'd like to call SndGetSoundFileList from c#, but I got no idea how the p/invoke for this function needs to be, due to the pointer parameters.
HRESULT SndGetSoundFileList (
SND_EVENT seSoundEvent,
DWORD grfLocations,
SNDFILEINFO** ppS开发者_Python百科oundFiles,
int* pcSoundFiles
);
I'd like to get the list as a string-array, of course.
Can anyone help me here?
Thanks!
For the array parameter, use out IntPtr
as the parameter type. Then use Marshal.PtrToStructure to retrieve the structures, and call LocalFree to free the memory when you're done.
精彩评论