I get a problem in calling C++ dll function in C#
-
Hello, I am trying to call c++ dll function from C#. Could anybody help me? Here is the C++ function declaration. long WINAPI GetPredictValues (double& m_vo2Max, double& m_vo2_kg_max, double& m_o2PulseMax) And this is my declaration in C#. [DllImport("c:\\ProgramFiles\\VacuMed\\turboFit\\tf32mmf.dll",SetLastError=true)] public static extern int GetPredictValues(out double vo2Max,out double vo2_kg_Max,out double o2PulseMax); And I get an error on the line below. double vo2max,vo2kgmax,o2Pulsemax; GetPredictValues( out vo2max, out vo2kgmax,out o2Pulsemax);An unhandled exception of type 'System.NullReferenceException' occurred Additional information: Object reference not set to an instance of an object Thank you for any help. Sincerely,
-
Hello, I am trying to call c++ dll function from C#. Could anybody help me? Here is the C++ function declaration. long WINAPI GetPredictValues (double& m_vo2Max, double& m_vo2_kg_max, double& m_o2PulseMax) And this is my declaration in C#. [DllImport("c:\\ProgramFiles\\VacuMed\\turboFit\\tf32mmf.dll",SetLastError=true)] public static extern int GetPredictValues(out double vo2Max,out double vo2_kg_Max,out double o2PulseMax); And I get an error on the line below. double vo2max,vo2kgmax,o2Pulsemax; GetPredictValues( out vo2max, out vo2kgmax,out o2Pulsemax);An unhandled exception of type 'System.NullReferenceException' occurred Additional information: Object reference not set to an instance of an object Thank you for any help. Sincerely,
On what line does the exception occur? I don't think the exception message came up on the line that you posted... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
On what line does the exception occur? I don't think the exception message came up on the line that you posted... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
I'm sorry I had forgotten to write the line that the error message occur. The message occur on the line below: double vo2max,vo2kgmax,o2Pulsemax; GetPredictValues( out vo2max, out vo2kgmax,out o2Pulsemax); Thank you for your help Hai