Search code examples
c++winapivisual-c++windows-xpcomctl32

ComCtl32.dll Ordinal 345 not found error only on Windows XP


I need to make an application that runs on Windows XP and up for multiple reasons. I am using ComCtl32.dll to call TaskDialogIndirect. The only problem is that the error "The ordinal 345 could not be located in ..." only occurs on Windows XP. The program runs fine on all other versions. I do have a manifest in my .rc file with the ID 1. The only things that I am currently mainly using from

I could not find any solution to this problem online.

My manifest:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="*"
    name="redacted"
    type="win32"
/>
<description>redacted</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="*"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>

My call to InitCommonControlsEx:

INITCOMMONCONTROLSEX icc;
    icc.dwSize = sizeof(icc);
    icc.dwICC = ICC_STANDARD_CLASSES;
    InitCommonControlsEx(&icc);

Solution

  • First of all the minimum supported client requirement for TaskDialogIndirect is Windows Vista you might also want to check this out.

    Your best bet might be XTaskDialog. This serves as a good emulation of the Vista Task Dialog APIs for down level operating systems including Windows 98, Windows ME, Windows 2000, Windows XP and Windows 2003.