![]() |
pb with CXTPTaskDialog |
Post Reply
|
| Author | |
Manu
Newbie
Joined: 09 September 2008 Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Topic: pb with CXTPTaskDialogPosted: 09 September 2008 at 12:06pm |
|
Hello I have a problem with this code
CXTPTaskDialog taskDlg(this);
taskDlg.AddButton(_T("Change password"), IDOK); taskDlg.SetCommonButtons(TDCBF_CANCEL_BUTTON); taskDlg.SetMainIcon(TD_WARNING_ICON); taskDlg.SetMainInstruction(_T("Change Password")); taskDlg.SetContent(_T("Remember your changed password.")); int nRet = taskDlg.DoModal(); switch (nRet) { case 0: AfxMessageBox(_T("Task Dialog could not be created!")); break; case IDOK: // the user pressed the OK button, change password. break; case IDCANCEL: // user canceled the dialog. break; }; return;
if I trace into the DoModal()
m_nSelButtonID = (int)CXTPTaskDialogFrame::DoModal();
if (m_lpDlgTemplate == NULL)
{ const int nDlgTemplateSize = sizeof(DLGTEMPLATE) + sizeof(DWORD) * 8; m_lpDlgTemplate = (DLGTEMPLATE*)malloc(nDlgTemplateSize); ZeroMemory(m_lpDlgTemplate, nDlgTemplateSize); } the sizeof(DLGTEMPLATE) + sizeof(DWORD) * 8;
can't be evaluated and after I have a lot of Debug Assertion Failed!
my version of codejock is 11.2.2
Thanks
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 09 September 2008 at 2:57pm |
|
Hi,
Can you attach screenshot of call stack?
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Manu
Newbie
Joined: 09 September 2008 Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Posted: 10 September 2008 at 2:31am |
|
Hello
here my call stack and after other informations /********************************************* /*begin call stack /********************************************** STRUCTURE! 00e3593f() line 843 + 31 bytes /*End
/******************
I have a problem of assert here :
HICON CXTPTaskDialogClient::CreateIcon(HICON hIcon, PCWSTR lpwzIcon, CSize sizeIcon, BOOL bUseHandle)
{ HICON hNewIcon = NULL; if (bUseHandle && hIcon != NULL)
{ hNewIcon = ::CopyIcon(hIcon); } else if (!bUseHandle) { if (m_pConfig->hInstance == NULL || lpwzIcon == NULL || !IS_INTRESOURCE(lpwzIcon)) { return FALSE; } if (lpwzIcon == TD_ERROR_ICON ||
lpwzIcon == TD_WARNING_ICON || lpwzIcon == TD_INFORMATION_ICON || lpwzIcon == TD_SHIELD_ICON) { DWORD dwID = 0; if (m_bUseSysIcons)
{ switch ((ULONG_PTR)lpwzIcon) { case (ULONG_PTR)TD_ERROR_ICON: dwID = 0x0067; break; case (ULONG_PTR)TD_WARNING_ICON: dwID = 0x0065; break; case (ULONG_PTR)TD_INFORMATION_ICON: dwID = 0x0068; break; case (ULONG_PTR)TD_SHIELD_ICON: dwID = 0x006a; break; // vista and later. } hNewIcon = XTPResourceManager()->CreateIconFromResource(
CXTPModuleHandle(_T("user32.dll")), MAKEINTRESOURCE(dwID), sizeIcon); } if (hNewIcon == NULL)
{ switch ((ULONG_PTR)lpwzIcon) { case (ULONG_PTR)TD_ERROR_ICON: dwID = XTP_IDI_TASKERROR; break; case (ULONG_PTR)TD_WARNING_ICON: dwID = XTP_IDI_TASKWARN; break; case (ULONG_PTR)TD_INFORMATION_ICON: dwID = XTP_IDI_TASKINFO; break; case (ULONG_PTR)TD_SHIELD_ICON: dwID = XTP_IDI_TASKSHIELD; break; } hNewIcon = XTPResourceManager()->LoadIcon(MAKEINTRESOURCE(dwID), sizeIcon);
} } else { hNewIcon = XTPResourceManager()->CreateIconFromResource( m_pConfig->hInstance, (LPTSTR)lpwzIcon, sizeIcon); } } ASSERT(hNewIcon != NULL); //here my problem
return hNewIcon; and after here
CSize CXTPTaskDialogClient::CalcCommandButtonSize()
{ CXTPEmptySize sizeCommon; for (int nIDString = XTP_IDS_TASK_OK; nIDString <= XTP_IDS_TASK_CLOSE; ++nIDString)
{ CString strButton; XTPResourceManager()->LoadString(&strButton, nIDString); ASSERT(!strButton.IsEmpty()); //my problem CSize sizeButton = CalcButtonSize(strButton);
sizeCommon.cx = max(sizeCommon.cx, sizeButton.cx); sizeCommon.cy = max(sizeCommon.cy, sizeButton.cy); } return sizeCommon;
} Other information, when I try "VistaTaskDialog file" in your project all is ok, I think that a resource or other element is missing in my project but I do not find which
Thanks
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 September 2008 at 1:29am |
|
Hello,
Yes, I see you link statically, so you need include our resources to your exe.
add in res\app.rc2 file line
#include "XTToolkitPro.rc"
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |