![]() Return Marshal.PtrToStringUni(MediaInfo_Option(Handle, option, Value)) įinally, modify your implementation: static void Main(string args) Private static extern IntPtr MediaInfo_Option(IntPtr Handle, string option, string Value) Ĭreate function for that: public string Option(string option, string Value = "") I forgot to include in my last post that you also need to set the Inform option through the MediaInfo_Option API, this is important step to define the returned data: Var objMediaInfo = new result = objMediaInfo.Inform() Then in your implementation, you must pass the full path of the media file not just its name: static void Main(string args) Private static extern void MediaInfo_Delete(IntPtr Handle) Return Marshal.PtrToStringUni(MediaInfo_Inform(Handle, (UIntPtr)0)) ĭon't forget to delete the pointer (Handle) that created by _MediaInfo_New_. Public System.UIntPtr Open(string FileName) Private static extern IntPtr MediaInfo_Inform(IntPtr Handle, UIntPtr Reserved) Private static extern UIntPtr MediaInfo_Open(IntPtr Handle, string FileName) I am aware there is already a fully developed wrapper for this, but I would like to keep this simple and lightweight.Ĭhanges I have tried a few different media files. ![]() However, I am only getting a blank string in return. Return Marshal.PtrToStringUni(MediaInfo_Inform(Handle)) Īnd I am calling this class using the below console app: static void Main(string args) Private static extern void MediaInfo_Close(IntPtr Handle) Private static extern IntPtr MediaInfo_Inform(IntPtr Handle) Private static extern void MediaInfo_Open(string FileName) Private static extern IntPtr MediaInfo_New() ![]() To wrap the dll, I have created a MediaInfo class, based on my (limited) understanding from the quickstart guide. Using MediaInfo DLL (64-bit), I am attempting to get the standard text output providing information about an mp4 file. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |