cancel
Showing results for 
Search instead for 
Did you mean: 

Error while loading CR95HF.dll file

FPapi.1
Associate II

I'm having problems loading the CR95HF.dll library into the Visual studio 2019 development environment. When I try to add the file copied in the path C:\Windows\System32\ the system returns the following error: "A reference "CR95HF.dll" can't be added, Please make sure that the file is accessible and that it is a valid assembly or COM component.

Can someone help me?

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Hi,

see https://docs.microsoft.com/en-us/dotnet/framework/interop/creating-prototypes-in-managed-code to create the prototypes to use the API from the DLL.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
Brian TIDAL
ST Employee

Hi

can you share more information about your environment (Win 10?) and the programming language being used (C#?)?

if using C#, make sure to follow the various post about Unmanaged C++ Dll Call From Managed C# Application.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

My environment is windows 10.

I'm working on a Windows Forms App (.NET Framework) project, in VB code.

Brian TIDAL
ST Employee

Hi,

CR95HF.dll is an unmanaged DLL (see http://net-informations.com/faq/net/dll.htm for differences between managed and unmanaged DLL). Have you registered the DLL (regsvr32)?

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I put my file in the project folder (...\bin\CR95HF.dll). I tried to upload it via the command prompt with the regsvr32 command but the following error came back: "The module "P:\...\bin\CR95HF.dll" failed to load.

Make sure the binary is stored at the specified path or debug it to check for problrms with the binary or dependent .DLL files.

The specified module could not be found.".

Brian TIDAL
ST Employee

Sorry, it seems registration is not what is needed as there is no exported DllRegisterServer in this DLL.

See https://docs.microsoft.com/en-us/dotnet/framework/interop/consuming-unmanaged-dll-functions

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
FPapi.1
Associate II

Ah ok, so what should be the code to include the CR95HF.dll file in my project?

Thank you in advance.

FP

Brian TIDAL
ST Employee

Hi,

see https://docs.microsoft.com/en-us/dotnet/framework/interop/creating-prototypes-in-managed-code to create the prototypes to use the API from the DLL.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.