Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - pb with CXTPTaskDialog
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

pb with CXTPTaskDialog

 Post Reply Post Reply
Author
Message
Manu View Drop Down
Newbie
Newbie


Joined: 09 September 2008
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Manu Quote  Post ReplyReply Direct Link To This Post Topic: pb with CXTPTaskDialog
    Posted: 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
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 09 September 2008 at 2:57pm
Hi,
Can you attach screenshot of call stack?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Manu View Drop Down
Newbie
Newbie


Joined: 09 September 2008
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Manu Quote  Post ReplyReply Direct Link To This Post 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
STRUCTURE! 00e35aad() line 855 + 60 bytes
STRUCTURE! 00e35395() line 706
STRUCTURE! 00e31c41() line 233 + 18 bytes
CWnd::OnWndMsg(unsigned int 1, unsigned int 0, long 1228696, long * 0x0012baa4) line 1811 + 13 bytes
CWnd::WindowProc(unsigned int 1, unsigned int 0, long 1228696) line 1585 + 30 bytes
STRUCTURE! 00e33ce1() line 344
AfxCallWndProc(CWnd * 0x0012c90c {CXTPTaskDialog hWnd=0x00571d0c}, HWND__ * 0x00571d0c, unsigned int 1, unsigned int 0, long 1228696) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x00571d0c, unsigned int 1, unsigned int 0, long 1228696) line 368
USER32! 7669f8d2()
USER32! 7669f794()
USER32! 766a06f6()
USER32! 766a069c()
STRUCTURE! 00e285c4() line 209 + 25 bytes
STRUCTURE! 00e25a51() line 637
STRUCTURE! 00e25bed() line 690 + 25 bytes
USER32! 7669f8d2()
USER32! 76691912()
USER32! 766a0817()
USER32! 766939f7()
NTDLL! 773499ce()
USER32! 7668a397()
USER32! 766b1c37()
USER32! 766a9b15()
CWnd::CreateDlgIndirect(const DLGTEMPLATE * 0x08df9548, CWnd * 0x0012df00 {CDialogRights hWnd=0x002b0730}, HINSTANCE__ * 0x00400000) line 327 + 36 bytes
CDialog::DoModal() line 531 + 32 bytes
STRUCTURE! 00e318eb() line 138
STRUCTURE! 00d6edc7() line 488 + 8 bytes
CDialogRights::OnButtonAddUser() line 1622 + 13 bytes
_AfxDispatchCmdMsg(CCmdTarget * 0x0012df00 {CDialogRights hWnd=0x002b0730}, unsigned int 16272, int 0, void (void)* 0x0040ace5 CDialogRights::OnButtonAddUser(void), void * 0x00000000, unsigned int 12, AFX_CMDHANDLERINFO * 0x00000000) line 88
CCmdTarget::OnCmdMsg(unsigned int 16272, int 0, void * 0x00000000, AFX_CMDHANDLERINFO * 0x00000000) line 302 + 39 bytes
CDialog::OnCmdMsg(unsigned int 16272, int 0, void * 0x00000000, AFX_CMDHANDLERINFO * 0x00000000) line 97 + 24 bytes
CWnd::OnCommand(unsigned int 16272, long 2232938) line 2088
CWnd::OnWndMsg(unsigned int 273, unsigned int 16272, long 2232938, long * 0x0012cf80) line 1597 + 28 bytes
CWnd::WindowProc(unsigned int 273, unsigned int 16272, long 2232938) line 1585 + 30 bytes
AfxCallWndProc(CWnd * 0x0012df00 {CDialogRights hWnd=0x002b0730}, HWND__ * 0x002b0730, unsigned int 273, unsigned int 16272, long 2232938) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x002b0730, unsigned int 273, unsigned int 16272, long 2232938) line 368
USER32! 7669f8d2()
USER32! 7669f794()
USER32! 766a06f6()
USER32! 766a069c()
STRUCTURE! 00e285c4() line 209 + 25 bytes
STRUCTURE! 00e25a51() line 637
STRUCTURE! 00e25bed() line 690 + 25 bytes
USER32! 7669f8d2()
USER32! 7669f794()
USER32! 766a0a05()
USER32! 766a0afa()
USER32! 766c4b0b()
USER32! 766c4c0b()
USER32! 766b47f2()
USER32! 766ae2c9()
USER32! 7669f8d2()
USER32! 7669f794()
USER32! 766a06f6()
USER32! 766a069c()
STRUCTURE! 00e285c4() line 209 + 25 bytes
STRUCTURE! 00e25a51() line 637
STRUCTURE! 00e25bed() line 690 + 25 bytes
USER32! 7669f8d2()
USER32! 7669f794()
USER32! 766a06f6()
USER32! 766a069c()
STRUCTURE! 00e29c39() line 804 + 25 bytes
CWnd::DefWindowProcW(unsigned int 514, unsigned int 0, long 655401) line 1000 + 32 bytes
CWnd::WindowProc(unsigned int 514, unsigned int 0, long 655401) line 1586 + 26 bytes
AfxCallWndProc(CWnd * 0x0012e0c4 {CButton hWnd=0x0022126a}, HWND__ * 0x0022126a, unsigned int 514, unsigned int 0, long 655401) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x0022126a, unsigned int 514, unsigned int 0, long 655401) line 368
USER32! 7669f8d2()
USER32! 7669f794()
USER32! 766a0008()
USER32! 766a0060()
USER32! 7668af07()
COccManager::IsDialogMessageW(CWnd * 0x0012df00 {CDialogRights hWnd=0x002b0730}, tagMSG * 0x01a3d654 {msg=0x00000202 wp=0x00000000 lp=0x000a0029}) line 614 + 17 bytes
CWnd::IsDialogMessageW(tagMSG * 0x01a3d654 {msg=0x00000202 wp=0x00000000 lp=0x000a0029}) line 179 + 33 bytes
CWnd::PreTranslateInput(tagMSG * 0x01a3d654 {msg=0x00000202 wp=0x00000000 lp=0x000a0029}) line 3424
CDialog::PreTranslateMessage(tagMSG * 0x01a3d654 {msg=0x00000202 wp=0x00000000 lp=0x000a0029}) line 92
CWnd::WalkPreTranslateTree(HWND__ * 0x00281cfa, tagMSG * 0x01a3d654 {msg=0x00000202 wp=0x00000000 lp=0x000a0029}) line 2667 + 18 bytes
CWinThread::PreTranslateMessage(tagMSG * 0x01a3d654 {msg=0x00000202 wp=0x00000000 lp=0x000a0029}) line 672 + 18 bytes
CStructureApp::PreTranslateMessage(tagMSG * 0x01a3d654 {msg=0x00000202 wp=0x00000000 lp=0x000a0029}) line 407
CWinThread::PumpMessage() line 848 + 30 bytes
CWnd::RunModalLoop(unsigned long 4) line 3478 + 19 bytes
CDialog::DoModal() line 539 + 12 bytes
CDoc_Need_Struct::EditGestionDroit() line 82
CStructureDoc::OnOutilGestionDroits() line 582
_AfxDispatchCmdMsg(CCmdTarget * 0x037d5e60 {CStructureDoc}, unsigned int 27921, int 0, void (void)* 0x0040999e CStructureDoc::OnOutilGestionDroits(void), void * 0x00000000, unsigned int 12, AFX_CMDHANDLERINFO * 0x00000000) line 88
CCmdTarget::OnCmdMsg(unsigned int 27921, int 0, void * 0x00000000, AFX_CMDHANDLERINFO * 0x00000000) line 302 + 39 bytes
CDocument::OnCmdMsg(unsigned int 27921, int 0, void * 0x00000000, AFX_CMDHANDLERINFO * 0x00000000) line 894 + 24 bytes
CView::OnCmdMsg(unsigned int 27921, int 0, void * 0x00000000, AFX_CMDHANDLERINFO * 0x00000000) line 170 + 33 bytes
CFrameWnd::OnCmdMsg(unsigned int 27921, int 0, void * 0x00000000, AFX_CMDHANDLERINFO * 0x00000000) line 894 + 33 bytes
CWnd::OnCommand(unsigned int 27921, long 0) line 2088
CFrameWnd::OnCommand(unsigned int 27921, long 0) line 321
CWnd::OnWndMsg(unsigned int 273, unsigned int 27921, long 0, long * 0x0012eda4) line 1597 + 28 bytes
CWnd::WindowProc(unsigned int 273, unsigned int 27921, long 0) line 1585 + 30 bytes
AfxCallWndProc(CWnd * 0x037f1d60 {CChildFrame hWnd=0x00540c84}, HWND__ * 0x00540c84, unsigned int 273, unsigned int 27921, long 0) line 215 + 26 bytes
CMDIFrameWnd::OnCommand(unsigned int 27921, long 0) line 55 + 35 bytes
CWnd::OnWndMsg(unsigned int 273, unsigned int 27921, long 0, long * 0x0012efd0) line 1597 + 28 bytes
CXTPCommandBarsSiteBase<CMDIFrameWnd>::OnWndMsg(unsigned int 273, unsigned int 27921, long 0, long * 0x0012efd0) line 192
CWnd::WindowProc(unsigned int 273, unsigned int 27921, long 0) line 1585 + 30 bytes
AfxCallWndProc(CWnd * 0x03ac7ea0 {CMainFrame hWnd=0x00281cfa}, HWND__ * 0x00281cfa, unsigned int 273, unsigned int 27921, long 0) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x00281cfa, unsigned int 273, unsigned int 27921, long 0) line 368
USER32! 7669f8d2()
USER32! 7669f794()
USER32! 766a06f6()
USER32! 766a069c()
STRUCTURE! 00e285c4() line 209 + 25 bytes
STRUCTURE! 00e25a51() line 637
STRUCTURE! 00e25bed() line 690 + 25 bytes
USER32! 7669f8d2()
USER32! 7669f794()
USER32! 766a06f6()
USER32! 766a069c()
STRUCTURE! 00e29c39() line 804 + 25 bytes
STRUCTURE! 00dba1b2() line 231 + 28 bytes
USER32! 7669f8d2()
USER32! 7669f794()
USER32! 766a0a05()
USER32! 766a0afa()
CWnd::SendMessageW(unsigned int 273, unsigned int 27921, long 0) line 39 + 75 bytes
STRUCTURE! 00d37146() line 654
STRUCTURE! 00d3754b() line 862 + 13 bytes
STRUCTURE! 00d370a8() line 737 + 16 bytes
STRUCTURE! 00dd4300() line 73
STRUCTURE! 00d9b35c() line 431 + 26 bytes
STRUCTURE! 00d23ebe() line 1004
CWnd::OnWndMsg(unsigned int 513, unsigned int 1, long 1114234, long * 0x0012fa58) line 1964
STRUCTURE! 00da0e79() line 2365
CWnd::WindowProc(unsigned int 513, unsigned int 1, long 1114234) line 1585 + 30 bytes
AfxCallWndProc(CWnd * 0x037777f0 {CXTPToolBar hWnd=0x004c1424}, HWND__ * 0x004c1424, unsigned int 513, unsigned int 1, long 1114234) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x004c1424, unsigned int 513, unsigned int 1, long 1114234) line 368
USER32! 7669f8d2()
USER32! 7669f794()
USER32! 766a06f6()
USER32! 766a069c()
STRUCTURE! 00e285c4() line 209 + 25 bytes
STRUCTURE! 00e25a51() line 637
STRUCTURE! 00e25bed() line 690 + 25 bytes
USER32! 7669f8d2()
USER32! 7669f794()
USER32! 766a0008()
USER32! 766a0060()
CWinThread::PumpMessage() line 853
CWinThread::Run() line 487 + 11 bytes
CWinApp::Run() line 400
AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, unsigned short * 0x00202f6c, int 1) line 49 + 11 bytes
wWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, unsigned short * 0x00202f6c, int 1) line 30
wWinMainCRTStartup() line 198 + 54 bytes
KERNEL32! 76bd4911()
NTDLL! 7732e4b6()
NTDLL! 7732e489()

/*****************
/*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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.