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!