Allan

Allan

  • NA
  • 4
  • 0

C++ function call from C#

Dec 11 2005 10:57 AM
Newbie question. I'm trying to call the following function defined in a .dll BOOL OfflineSDK_IsMediaAvailable(BOOL* pbMediaReady) I've set up the [DLLImport] stuff and it works fine for other methods I'm calling in the DLL. I try to call the function but am getting System.NullReferenceException: Object reference not set to an instance of an object. [DllImport("OffLineSDK.dll", CharSet=CharSet.Auto, EntryPoint="?OffLineSDK_IsMediaAvailable@@YAHU_DEVICE@@PAH@Z")] private static extern bool ProDVD_OffLineSDK_IsMediaAvailable(ref bool available); Code in calling method.... { bool available = new bool(); OfflineSDK_IsMediaAvailable(ref available); } Any ideas?