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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top