Example #1
0
 public int Load(string dllfile)
 {
     this.m_hinst = CDD.LoadLibrary(dllfile);
     if (this.m_hinst.Equals(IntPtr.Zero))
     {
         MessageBox.Show("Error while loading library, code=" + CDD.GetLastError().ToString());
         return(-2);
     }
     return(this.GetDDfunAddress(this.m_hinst));
 }
Example #2
0
        private int GetDDfunAddress(IntPtr hinst)
        {
            IntPtr procAddress = CDD.GetProcAddress(hinst, "DD_key");

            this.key = (Marshal.GetDelegateForFunctionPointer(procAddress, typeof(CDD.pDD_key)) as CDD.pDD_key);
            if (procAddress.Equals(IntPtr.Zero))
            {
                return(-1);
            }
            return(1);
        }