pan

pan

  • NA
  • 1
  • 0

how can i transfer the function?

Nov 25 2005 1:29 AM

Hi Friends.......


[DllImport("kernel32",EntryPoint="LoadLibrary",SetLastError=true)]
static extern IntPtr LoadLibrary(string lpLibName);

[DllImport("kernel32",EntryPoint="GetProcAddress",SetLastError=true)]
static extern IntPtr GetProcAddress(IntPtr hModule, string lpProcName);

[DllImport("kernel32",EntryPoint="FreeLibrary",SetLastError=true)]
static extern bool FreeLibrary(IntPtr hModule);

IntPtr hModule = IntPtr.Zero;
IntPtr pfn = IntPtr.Zero;

// Load the library and get a pointer to the function
hModule = LoadLibrary("ADll.dll");
pfn = GetProcAddress(hModule, "GetValue");


/////now,we know the address of the function,and how can i transfer it?????
thanks