I have to convert a very very simple program from Vb to C#.
The Vb has those references
From seeing here if I am not mistaken those should be managed dlls. I achieve the same result if I follow the procedure here with the dumpbin.exe program.
So everything should be fine.
But when I do that CWorkpiece instance = new CWorkpiece();
I get the following error
which tells that the relevant dll is not in the right place.
However the file is right were it should be
That said I have thought that perhaps I had done a wrong investigation but adding the following lines didn't help
[DllImport("C:\\Temp\\1\\Okuma.CLDATAPI.dll")]
public static extern int CWorkpiece();
So in short the problem is all related with that dll which can't be found Thank you in advance for any help Patrick
All applications developed with .NET THINC-API libraries are required to include an exact version of THINC-API libraries with the custom installation. THINC-API libraries compiled with application should be installed with your application folder.
The above error message shows that THINC-API library named Okuma.CLDATAPI.dll cannot be found at the folder where the application runs from.
Solution: Include THINC-API libraries compiled in your application with your custom setup and re-install your application with new setup.
Yes the THINC API libraries are managed .NET libraries. The command (CMD) API is written in VB, and the data API in VC++. Depending on the API version you have, these libraries either written in .NET 1.1 or 4.0. So you really shouldn't be attempting to Pinvoke them.
The real problem you are facing is attempting to run your program in an environment which does not have the THINC API installed. Yes, you have the libraries referenced by your application, but that is not enough.
The THINC API libraries have several dependencies including:
Obtain a copy of the API Install disc; either from a disc that has shipped with an Okuma machine, or a new version through your Okuma dealer.
Install the development version of the THINC API in your development environment.
Note that you will not be able to Init()
or call any other API functions unless your environment is one of the following: