How could I get return handle from DllImport?

  • Thread starter Thread starter Sherry
  • Start date Start date
S

Sherry

Hi,

I used LoadLibrary in C++. Now I changed it to C#.
C++ codes:
hKernelLib = LoadLibrary("kernel32.dll");
C# codes:
[DllImport("kernel32.dll")]

The problem is I need hKernelLib (which is the value returned from invoking
LoadLibrary), and it will be a parameter for the next API (such as
GetProcAddress).
How could I get this return value from DllImport?

Thanks
 
Back
Top