G
Guest
Is there a way to import data from an unmanaged dll? For example,
unmanaged.dll:
__declspec(dllexport) int unmanagedErrno;
managed.cs:
class Managed
{
//this doesn't work:
[DllImport("unmanaged.dll")]
static extern int unmanagedErrno;
}
This fails because "extern" doesn't work for data, only methods. Is there a way to access "unmanagedErrno" in managed code?
Thanks,
Mark Urish
unmanaged.dll:
__declspec(dllexport) int unmanagedErrno;
managed.cs:
class Managed
{
//this doesn't work:
[DllImport("unmanaged.dll")]
static extern int unmanagedErrno;
}
This fails because "extern" doesn't work for data, only methods. Is there a way to access "unmanagedErrno" in managed code?
Thanks,
Mark Urish