Print Page | Close Window

Foreign resource issue in ribbon sample

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=19588
Printed Date: 18 June 2025 at 11:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Foreign resource issue in ribbon sample
Posted By: chimpy
Subject: Foreign resource issue in ribbon sample
Date 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++



Replies:
Posted By: chimpy
Date 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++



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