usnistgov / REFPROP-manager

A manager class for holding many copies of REFPROP in memory
9 stars 8 forks source link

I am getting errcode = 1 when calling the functions using handle. what does errCode =1 mean? #13

Closed krushnaeicp closed 2 years ago

krushnaeicp commented 2 years ago

I have created C# wrapper for refprop manager studying python and c++ wrapper code. I am able to create handle successfully using int handle = construct_handle(ref refpropBaseDirectoryPath, ref refpropMainDllFileName, ref ierr, ref herr, ref herrLen);

but when I try to call any function using the handle getting errCode = 1. Example below: var methodPtr = LoadMethodInDll(this.dllPtr, "SETPATHdll"); // convert "pointer" to delegate delegateSETPATHDll setPath = (delegateSETPATHDll)Marshal.GetDelegateForFunctionPointer(methodPtr, typeof(delegateSETPATHDll));

            // use function    
            setPath(ref this.handle, ref errCode, path, ref size);

I am getting errCode =1 for every function called using handle.

krushnaeicp commented 2 years ago

I figured it out and closing the issue.