I have ActiveX VB6 DLL (have no access to its sources), and want to call method 'GetUnitInfo'
I use to import it like:
[DllImport(@"C:\Users\R\Documents\lab.dll")]
public static extern long GetUnitInfo(String strRequest, String strInfo, String strName);
But I get an exception:
Unable to find an entry point named 'GetUnitInfo' in DLL
Also I have tryied to load it:
Assembly myAssembly ;
myAssembly = Assembly.LoadFile("C:\\Users\\R\\Documents\\lab.dll");
but getting an exception
The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)
I have tryied to clean solution, to turn off manifest in project options, to create new manifest file, but it did not helped me...
Solution Explorer
, pressAdd Reference...
and locate the DLL.DllImport
is only used when you want to call functions in native DLLs (such as DLLs compiled with C, C++ or VB6, etc.) – Convolutelink.exe
.) – Proximal