What does 0x8007007F mean when importing a function from an unmanaged DLL?

-2

I'm trying to import functions from an unmanaged DLL into my C# program.

This is my code:

[DllImport("MarkEzd.dll", EntryPoint = "lmc1_Initial2", CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.StdCall)]
public static extern int piplmc1_Initial(string PathName, bool TestMode);

....

int intlmc1_Initial = piplmc1_Initial(m_strEzCADSotwareFullPath, false);
if (intlmc1_Initial > 0)
{
   return;
}

The error is, translated from French:

Unable to load DLL MarkEzd.dll, The Specified procedure can not be found Exception de HRESULT : 0x8007007F

What does this error mean?

c#
c++
pinvoke
dllimport
asked on Stack Overflow Aug 17, 2017 by Jerome • edited Aug 17, 2017 by David Heffernan

1 Answer

0

The error message tells you that the DLL that you loaded does not export a function named lmc1_Initial2.

You should double check the documentation for this library, and maybe it will be obvious where the error is. Perhaps a different DLL exports that function. Perhaps the name has been transcribed incorrectly. Note that letter case matters, so you must get all upper and lower case letters correct.

If the documentation does not help, use a tool like dumpbin or Dependency Walker to inspect the exported function names of the DLL.

answered on Stack Overflow Aug 17, 2017 by David Heffernan

User contributions licensed under CC BY-SA 3.0