public class CodeMine { [DllImport(@"C:\Old Drive\CM\Common50\CodeMine.fll", EntryPoint="@DispatchAPI@4")] public static extern int cmGetFLLVersion(); }Then, in a method of another class (in the same namespace, I have:
// The next line throws the error.
int version = CodeMine.cmGetFLLVersion();
MessageBox.Show(version.ToString());
I get:An unhandled exception of type 'System.NullReferenceException' occurred in ActiveDirectory.exe Additional information: Object reference not set to an instance of an object.on the line where I have the comment.