Print Page | Close Window

TaskDialog XML problems

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6912
Printed Date: 12 November 2025 at 5:45pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: TaskDialog XML problems
Posted By: scottp
Subject: TaskDialog XML problems
Date Posted: 18 April 2007 at 1:26am
Hi
I like the new CXTPTaskDialog - but I have found a few problems.

Using the CreateFromResource for XML created by TDPad has a  these
problems:
  1. TDPad creates CommandLink with named button IDs <CommandLink ID="OK> - this does not work with CXTPTaskDialog
  2. Not specifying the Dialog Width creates the dialog with a different size when using ComCtl32.dll compared to fully emulated TaskDialog <Dialog Width="250" Name="Dialog000">
  3. Using *Error image does not work <MainInstruction Image="*Error">
  4. The Dialog property AllowCancel defaults to FALSE when using emulated TaskDialog and defaults to TRUE when using ComCtl32.dll - it should default to FALSE
hopefully we will get a few fixes in 11.1.1

Scott



Replies:
Posted By: Oleg
Date Posted: 18 April 2007 at 9:27am
Hello,
 
1. Yes, you need to specify numbers - ID="100" or use <OK/> instead  <CommandLink ID="OK>
2. Thanks, will check
3. works for me, please try with our sample.
4. Thanks, checking


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Oleg
Date Posted: 18 April 2007 at 9:42am
Hi,
 
4. Actually also can't reproduce. Show code/xml you tried.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: scottp
Date Posted: 18 April 2007 at 9:28pm
Hi Oleg,

Here is the HTML XML resource I used (subtitute it for one in the sample resources)

3. This dialog does not parse correctly, I thought it was because I used *Error, but if I modify the WindowTitle, ExpandedInformation, or Explaination to make them shorter then it parses OK.  Editing this dialog to make it parse then correctly shows the Error icon.

4. using this dialog (edited to parse) on Vista in the sample and try toggling the "Use ComCtl32.dll (Vista Only)" option - the Cancel button will appear

  <Dialog Name="Dialog000">
    <WindowTitle>AAAAAAAAE License Security Key</WindowTitle>
    <MainInstruction Image="*Error">Error Initialising Security Key</MainInstruction>
    <Content>There has been a problem initialising the current Security Key type.</Content>
    <ExpandedInformation Footer="True">
      Unable to initialise local AAAA Security Key
      ErrorCode: 0 1001
    </ExpandedInformation>
    <Buttons Default="1">
      <CommandLink ID="1">
        <Text>Auto Search</Text>
        <Explanation>Allow AAAAAAAAE to search for a valid Security Key connected to your machine or network</Explanation>
      </CommandLink>
      <CommandLink ID="2">
        <Text>Edit Security Key options</Text>
        <Explanation>Edit the current Security Key options using the License Manager</Explanation>
      </CommandLink>
    </Buttons>
  </Dialog>






Posted By: Oleg
Date Posted: 19 April 2007 at 5:57am
Hi,
 
You  use ID="2" that is IDCANCEL.    For custom buttons better use ID from 10.
 
It's designed - if there is Cancel button in dialog, AllowCancel  parameter will be ignore.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: scottp
Date Posted: 23 April 2007 at 9:15am
Hi Oleg,

One more problem I have found. CXTPTaskDialog::CreateFromResource only loads the resources from AfxGetInstanceHandle, and not from AfxGetResourceHandle.

Could you make a change to allow checking both places for the resource:

BOOL CXTPTaskDialog::CreateFromResource(UINT nIDResource, LPCTSTR lpszDialog)
  {
  USES_CONVERSION;

  LPCTSTR lpszResourceName = MAKEINTRESOURCE(nIDResource);

  HINSTANCE hInst = AfxGetResourceHandle();
  HRSRC hRsrc = ::FindResource(hInst, lpszResourceName, RT_HTML);
  if (hRsrc == NULL)
    {
    hInst = AfxGetInstanceHandle();
    hRsrc = ::FindResource(hInst, lpszResourceName, RT_HTML);
    if (hRsrc == NULL)
      return FALSE;
    }
.....

And/or allow the resouce HINSTANCE handle to be passed in.

Thanks

Scott




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net