thaukko

thaukko

  • NA
  • 1
  • 0

Problem DLLImport and events

Apr 19 2005 6:35 AM
Hi, i am trying to use a DLL(LibPl.dll) which was written C++. I imported the native Methods via DLLImport: [DllImport(DllFileName)] internal static extern uint PL_new_term_refs(int n); When I use this Method (PL_new_term_refs) in the Main Application everything works fine. But if exactly the same Code is called via an event/delegate it is not working anymore. What I get is the following Error: An unhandled exception of type 'System.NullReferenceException' occurred in aflib.dll Additional information: Object reference not set to an instance of an object. Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at ArteFACT.Rule.libpl.PL_new_term_refs(Int32 n) It seems that it can't find the static method at all. Does anybody have an Idea what it could be? Because I could not really find anything on the web and debugging didn't really help as well. Thanks in advance, Chris