"The ordinal 345 not found in the DLL" error

chedli zaafouri 0 Reputation points
2024-10-24T14:44:35.6+00:00

I am facing an issue with a Visual Studio solution that contains a development project and a newly added unit test project to test this development project. The unit test project compiles without any issues, but when I run it, I get the following error message:

"The ordinal 345 could not be located in the dynamic link library."

Here are the steps I’ve taken to try to resolve the problem:

I ran Dependency Walker on the unit test executable and noticed that the error seems to originate from COMCTL32.dll, a system module. The problem is that ordinal 345 does not have an explicit function name, making it difficult to identify the exact issue.

In my development project, I use some functions related to ImageList_*, which are provided by COMCTL32.dll. However, I’m unsure if this ordinal 345 is related to those functions, since the error only affects the unit test project.

I have checked my compilation and linking settings (including the COMCTL32.dll version and x86/x64 architecture), and everything seems correct. The development project runs without issues, but the unit test project won’t run.

I also tried dynamic loading to work around the ordinal issue, but without success.

Below is a screenshot from Dependency Walker where you can see that ordinal 345 has no explicit function name:

I use:

  • Windows 11
  • Visual Studio 22 (VC143) & C++17
  • COMCTL32 version: 5.82.26100.1882

I would appreciate any help in understanding:

What could be causing this ordinal error? Could it be related to a specific version of COMCTL32.dll? Are there any ways to work around this problem without affecting the development project? Thanks in advance for any help or suggestions!

Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
1,004 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
351 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RLWA32 45,691 Reputation points
    2024-10-24T15:25:27.7166667+00:00

    I have seen a similar errors in connection with the TaskDialog (ordinal 344) and TaskDialogIndirect (ordinal 345) functions which are only available in ComCtl32.dll Version 6.

    You probably need to manifest your unit test to use the version 6 common controls dll.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.