unable to load MediaInfo Library
<p>Am using Mediainfo library in my C# project,before start invoking this dll,i just ran VC++ program that comes with the package and deployed in to my local system.am not sure what exactly it did when it deploys,it register something in the system,so my process can identify the mediainfo.dll,so it worked well in my local (32bit).</p>

<p>When i start deploying in Testserver,i can't run or deploy the VC++(bcoz test server don't have visual studio to do that,except debugger).so am getting this error </p>

<pre><code> public class MediaInfo
{
    //Import of DLL functions. DO NOT USE until you know what you do (MediaInfo DLL do NOT use CoTaskMemAlloc to allocate memory)  

    [DllImport("MediaInfo.dll")]
    private static extern IntPtr MediaInfo_New();


    //MediaInfo class

    public String Inform()
    {
        if (Handle == (IntPtr)0)
            return "Unable to load MediaInfo library";
        if (MustUseAnsi)
            return Marshal.PtrToStringAnsi(MediaInfoA_Inform(Handle, (IntPtr)0));
        else
            return Marshal.PtrToStringUni(MediaInfo_Inform(Handle, (IntPtr)0));
    }
    public String Get(StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo, InfoKind KindOfSearch)
    {
        if (Handle == (IntPtr)0)
            return "Unable to load MediaInfo library";
        if (MustUseAnsi)
        {
            IntPtr Parameter_Ptr=Marshal.StringToHGlobalAnsi(Parameter);
            String ToReturn=Marshal.PtrToStringAnsi(MediaInfoA_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter_Ptr, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch));
            Marshal.FreeHGlobal(Parameter_Ptr);
            return ToReturn;
        }
        else
            return Marshal.PtrToStringUni(MediaInfo_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch));
    }
    public String Get(StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo)
    {
        if (Handle == (IntPtr)0)
            return "Unable to load MediaInfo library";
        if (MustUseAnsi)
            return Marshal.PtrToStringAnsi(MediaInfoA_GetI(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo));
        else
            return Marshal.PtrToStringUni(MediaInfo_GetI(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo));
    }
    public String Option(String Option, String Value)
    {
        if (Handle == (IntPtr)0)
            return "Unable to load MediaInfo library";
        if (MustUseAnsi)
        {
            IntPtr Option_Ptr=Marshal.StringToHGlobalAnsi(Option);
            IntPtr Value_Ptr=Marshal.StringToHGlobalAnsi(Value);
            String ToReturn=Marshal.PtrToStringAnsi(MediaInfoA_Option(Handle, Option_Ptr, Value_Ptr));
            Marshal.FreeHGlobal(Option_Ptr);
            Marshal.FreeHGlobal(Value_Ptr);
            return ToReturn;
        }
        else
            return Marshal.PtrToStringUni(MediaInfo_Option(Handle, Option, Value));
    }
    public int State_Get() { if (Handle == (IntPtr)0) return 0; return (int)MediaInfo_State_Get(Handle); }
    public int Count_Get(StreamKind StreamKind, int StreamNumber) { if (Handle == (IntPtr)0) return 0; return (int)MediaInfo_Count_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber); }
    private IntPtr Handle;
    private bool MustUseAnsi;

    //Default values, if you know how to set default values in C#, say me
    public String Get(StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo) { return Get(StreamKind, StreamNumber, Parameter, KindOfInfo, InfoKind.Name); }
    public String Get(StreamKind StreamKind, int StreamNumber, String Parameter) { return Get(StreamKind, StreamNumber, Parameter, InfoKind.Text, InfoKind.Name); }
    public String Get(StreamKind StreamKind, int StreamNumber, int Parameter) { return Get(StreamKind, StreamNumber, Parameter, InfoKind.Text); }
    public String Option(String Option_) { return Option(Option_, ""); }
    public int Count_Get(StreamKind StreamKind) { return Count_Get(StreamKind, -1); }
}
</code></pre>

<p>Just google thru SourceForge.net found this <a href="https://sourceforge.net/projects/mediainfo/forums/forum/297610/topic/4037237" rel="nofollow">https://sourceforge.net/projects/mediainfo/forums/forum/297610/topic/4037237</a> but still i don't know what they are suggesting.</p>

<p>look like they ask to import the com object but anyone please guide me how to import the com object in C# ?</p>

<p>Some how its fail to import the dll,is this any other way to import or just give the path to find the dll ?</p>

<p>like </p>

<pre><code>PathToMediaInfoDLL := "C:\Documents and Settings\Administrator\My Documents\autohotkey\MediaInfo.dll"
</code></pre>

<p>Thanks a bunch in advance.</p>
