Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Foreign resource issue in ribbon sample
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Foreign resource issue in ribbon sample

 Post Reply Post Reply
Author
Message
chimpy View Drop Down
Groupie
Groupie
Avatar

Joined: 10 March 2009
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote chimpy Quote  Post ReplyReply Direct Link To This Post Topic: Foreign resource issue in ribbon sample
    Posted: 21 March 2012 at 5:11am
I've been having a play with the CodeJock ribbon sample and decided to try out the foreign resources. In CMainFrame's constructor I added the following

XTPResourceManager()->SetResourceFile (resource_dll_path);

where resource_dll_path is a string set to the path of ToolkitPro.ResourceSv.dll

When I bring up the ribbon customise dialog, I find I can't click on the 'Customize Ribbon' button on the left of this dialog.

If I change resource_dll_path to point to the .xml version of this fine everything works as expected. It doesn't seem to matter what language .dll file I choose either.

I did wonder if the presence of a XTPCoreTree custom control in the resource file was causing the issue

XTP_IDD_RIBBONCUSTOMIZE_RIBBON DIALOGEX DISCARDABLE 0, 0, 452, 227
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION
CAPTION "Customize &Ribbon"
FONT 8, "MS Shell Dlg"
BEGIN
    LTEXT           "Customize the Ribbon",XTP_IDC_RIBBONPAGE_TITLE,14,7,284,
                    22
    LTEXT           "&Choose commands from:",IDC_STATIC,18,34,106,8
    COMBOBOX        XTP_IDC_RIBBONCOMBO_CATEGORIES,18,45,164,85,
                    CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
    CONTROL         "",XTP_IDC_RIBBONLIST_COMMANDS,"XTPCoreTree",WS_TABSTOP,
                    18,65,164,145,WS_EX_CLIENTEDGE
    PUSHBUTTON      "&Add >>",XTP_IDC_RIBBONBUTTON_ADD,190,109,52,14
    PUSHBUTTON      "<< &Remove",XTP_IDC_RIBBONBUTTON_REMOVE,190,126,52,14
    LTEXT           "&Customize the Ribbon:",XTP_IDC_RIBBONSTATIC_CUSTOMIZE,
                    249,34,106,8
    COMBOBOX        XTP_IDC_RIBBONCOMBO_TABGROUP,248,45,164,85,
                    CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
    CONTROL         "",XTP_IDC_RIBBONLIST_QUICKACCESS,"XTPCoreTree",
                    WS_TABSTOP,249,65,164,98,WS_EX_CLIENTEDGE
    PUSHBUTTON      "Ne&w Tab",XTP_IDC_RIBBONBUTTON_NEWTAB,249,168,52,14
    PUSHBUTTON      "&New Group",XTP_IDC_RIBBONBUTTON_NEWGROUP,305,168,52,14
    PUSHBUTTON      "Rena&me",XTP_IDC_RIBBONBUTTON_RENAME,361,168,52,14
    PUSHBUTTON      "",XTP_IDC_RIBBONBUTTON_UP,422,109,21,14
    PUSHBUTTON      "",XTP_IDC_RIBBONBUTTON_DOWN,422,126,21,14
    LTEXT           "Customizations:",XTP_IDC_RIBBONSTATIC_CUSTOMIZATIONS,
                    251,188,50,8
    PUSHBUTTON      "Re&set",XTP_IDC_RIBBONBUTTON_RESET,305,186,52,14
    PUSHBUTTON      "Im&port/Export",XTP_IDC_RIBBONBUTTON_IMPORT,305,203,77,
                    14
END

Not sure. Anyone else seen this and got a workaround (apart from using the .xml file instead).
Product: Xtreme ToolkiPro version 13.2.0
Platform: Windows XP (32bit) - SP 2
Language: C++
Back to Top
chimpy View Drop Down
Groupie
Groupie
Avatar

Joined: 10 March 2009
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote chimpy Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2012 at 12:40pm

Well, seeing as though no-one has replied yet, either through the forum or via a support ticket, I thought I'd have a go at fixing it myself :)

Turns out if you want to provide your own customise sheet that's derived from CXTPPropertySheet (like in the samples), you need to provide an override for AddPage


void CustomisePropertySheet::AddPage(CXTPPropertyPage* pPage, int nIndex)
{
CXTPPropertySheet::InsertPage(nIndex, pPage);

 

    LPCDLGTEMPLATE pResource = XTPResourceManager()->LoadDialogTemplate((UINT)(UINT_PTR)pPage->m_psp.pszTemplate);

 

    if (pResource)

    {

        pPage->m_psp.pResource = pResource;

        pPage->m_psp.dwFlags |= PSP_DLGINDIRECT;

    }

}

Product: Xtreme ToolkiPro version 13.2.0
Platform: Windows XP (32bit) - SP 2
Language: C++
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.031 seconds.