Generating a Windows Dll File for Custom Checksum with Visual Studio.

Updated Mar 12, 2025

Environment

Software

  • Vehicle Communication Toolkit

Driver

  • NI-XNET

Operating System

  • Windows

To implement custom checksum with NI-VCOM on Windows, the dll file is needed. This article will introduce how to setup the compile toolchain to generate the dll file for custom checksum on Windows. 

  1. Create a new project in Visual Studio
  2. Select the project template Dynamic-Link Library (DLL).

  1. Save the project by clicking Create.

  1. Delete dllmain.cpp and pch.cpp files in Source Files.

  1.  Add your cpp file containing the algorithm code by right-click Source Files->Add->Existing Item...
  2. Delete pch.h and framework.h in Header Files.

  1. Add the header files nixnet.h and NIXNETCustomInterfaceCAN.h by right-click Header Files->Add->Existing Item... 

  1. You will see the error "unexpected end of file while looking for precompiled header. Did you forget to add ‘#include "pch.h"’ to your source?". This error can be resolved by following the steps below:
    1. In the Solution Explorer window, right-click the project name, and then choose Properties to open the project Property Pages dialog.
    2. In the Configuration drop-down, select All Configurations.
    3. Select the Configuration Properties->C/C++->Precompiled Headers property page.
    4. In the property list, select the drop-down for the Precompiled Header property, and then choose Not Using Precompiled Headers. Choose OK to save your changes.

  1. In the Solution Explorer window, right-click the Solution, and then choose Build Solution.
  2. In the Output window, the Build process is successful.

  1. In the Solution Configurations drop-down, select Release, and then build solution again.
  2. The Output window should show the messages as below. The dll file is located in D:\Work\NI_VCOM_Windows_XYZ\DLL\x64\Release.

 

An example project is attached. You can find the header files and cpp file mentioned above. You can use the project as it is.

Was this information helpful?

Yes

No