Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8417367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:01:23+00:00 2026-06-10T02:01:23+00:00

I am writing an application and wanted to use the TaskDialogIndirect function – however

  • 0

I am writing an application and wanted to use the TaskDialogIndirect function – however I did not want to write a huge amount of P/Invoke stuff etc. so I have included the WinAPICodePack. There is one problem though! When I create a control for the TaskDialog and add it to the dialog everything works fine. However running the Show methods results in an OverflowException in mscorlib. I tracked this down to some pointer handling and marshalling.

Experimenting with the code had the result, that I found out, that the DLL MUST be compiled for .NET 3.5 and the including app TOO. Having my app on .NET 4.0 invokes this error… any idea about a workaround – or can you even reproduce this error?

Another issue is that I can set the the Icon property to whatevery I want, but the icon is not shown at all. I have to setup an Opened event which dynamically sets the icon…

Information: Running Visual Studio 2012 RTM on Windows 8 Pro x64 RTM. Application is a standard WPF app.

Sample code:

TaskDialog td = new TaskDialog();
td.Cancelable = true;
td.Caption = "Caption";
td.InstructionText = "Instructions";
td.Text = "Text";

TaskDialogCommandLink buttonElevation =
    new TaskDialogCommandLink("elevation", "Elevation Required Sample");
buttonElevation.UseElevationIcon = true;

td.Controls.Add(buttonElevation);
td.Show(); // OverflowException occurs here!
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:01:25+00:00Added an answer on June 10, 2026 at 2:01 am

    I fixed this issues which was basically a 32bit/64bit error. In the NativeTaskDialog.cs file there is one line critical, it’s in the function

    IntPtr AllocateAndMarshalButtons(
        TaskDialogNativeMethods.TaskDialogButton[] structs)
    

    You need to locate the following line

     currentPtr = (IntPtr)((int)currentPtr + Marshal.SizeOf(button));
    

    and replace it with

     currentPtr = (IntPtr)(currentPtr.ToInt64() + Marshal.SizeOf(button));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a winforms application in C# (.NET 4.0, using EntityFramework). I wanted to
I am writing a Catalyst web application that presents some data that does not
I'm writing an application that I will use to keep up with my monthly
I am writing an android application where providing some sound(wmv). I wanted to know,
I am writing an MVC application, and I wanted to do some extra formatting
I am writing a web application using Django, on djangorecipe. I wanted to have
I’m writing a LightSwitch application and i could do with some advice. I wanted
I am writing application in Linux using C, pthreads and sockets. This will be
I am writing application on ActionScript for Android using Adobe AIR with native extentions.
Im writing an application that supposed to send coordinates in an SMS, but I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.