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?
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.
User contributions licensed under CC BY-SA 3.0