coredll ?

  • Thread starter Thread starter Lloyd Dupont
  • Start date Start date
L

Lloyd Dupont

I have an unexpected MissingMethodException in my code using some interop.
I tried to understand.

I looked (with the windows explorer of the desktop) in my device\windows
and I can't find any coredll.dll !! (just find coredll-dll.sig)

is it normal ?
(I mean is it one of those invisible dll ?)
 
it was just an interop issue, silly me

I had code like

//---------
[DllImport("coredll")]
public static extern int AMethod();
//---------

which I transform to

//----------
[DllImport("coredll")]
static extern int AMethodCF();
[DllImport("user32")]
static extern int AMethodDT();
public static int AMethod()
{
if(IsDevice)
AMethodCF();
else
AMethodDT();
}
//----------

well, I obviously forgot about the entry point, didn't I ?

the good solution being:

//----------
[DllImport("coredll", EntryPoint="AMethod")]
static extern int AMethodCF();
[DllImport("user32", EntryPoint="AMethod")]
static extern int AMethodDT();
public static int AMethod()
{
if(IsDevice)
AMethodCF();
else
AMethodDT();
}
//----------
 
Back
Top