Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find an entry point named 'TaskDialogIndirect' in DLL 'ComCtl32'

We have a particular Vista x64 machine that, when running our C# WinForms app, displays the following error:

System.EntryPointNotFoundException: Unable to find an entry point named 'TaskDialogIndirect' in DLL 'ComCtl32'.

This same code works fine on other Vista machines. For some reason, this particular Vista machine always throws this exception.

How can we fix this?

like image 799
Judah Gabriel Himango Avatar asked Apr 05 '09 16:04

Judah Gabriel Himango


2 Answers

I had problems with this and Naughter's free XTaskDialog API, to get a fallback mechanism on Windows XP machines via emulation, rendering this dialog implementation much more useful. :)

In my case it was an activation context issue, as mentioned in this blog entry.

Or, quoted here, in case the blog post is lost in cyberspace some day (applies to Visual Studio):

  1. Open your project properties in the Solution Explorer,
  2. On the Security tab, check Enable ClickOnce Security Settings,
  3. Now you can see appearing the app.manifest file in the Properties folder of your solution, open it,
  4. Beneath the </trustInfo> tag, insert the code below.
  5. If you try to build, there may be an error. To fix it, uncheck the Enable ClickOnce Security Settings.

The code to insert in step 4:

<dependency>
  <dependentAssembly>
    <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" 
        version="6.0.0.0" processorArchitecture="*"
        publicKeyToken="6595b64144ccf1df" language="*" />
  </dependentAssembly>
</dependency>
like image 80
Jonas Avatar answered Sep 17 '22 22:09

Jonas


I would suggest comparing the version of comctl32.dll on the working and non-working Vista machines -- and comparing their checksums even if they report the same version.

Other things to check:

  • Is it possible that the non-working machine has a pre-release version of Vista?
  • Is it possible that a non-Vista version of comctl32.dll has been copied onto the machine and is being picked up by the application? (The Depends utility that comes with Visual Studio may help here.)
  • Is it possible that a virus or worm (or what not) has replaced the comctl32.dll?

It might also be worth reading this article on activation contexts.

like image 23
Paul Ruane Avatar answered Sep 17 '22 22:09

Paul Ruane