Skip to main content
Visitor II
May 14, 2020
Solved

Error while loading CR95HF.dll file

  • May 14, 2020
  • 5 replies
  • 2238 views

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?

    This topic has been closed for replies.
    Best answer by Brian TIDAL

    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

    5 replies

    Technical Moderator
    May 15, 2020

    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

    FPapi.1Author
    Visitor II
    May 15, 2020

    My environment is windows 10.

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

    Technical Moderator
    May 15, 2020

    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

    FPapi.1Author
    Visitor II
    May 15, 2020

    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.".

    Technical Moderator
    May 15, 2020

    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

    FPapi.1Author
    Visitor II
    May 18, 2020

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

    Thank you in advance.

    FP

    Technical Moderator
    May 24, 2020

    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