Shortcutbar without doc/view |
Post Reply |
Author | |
BobWansink
Groupie Joined: 24 January 2008 Status: Offline Points: 59 |
Post Options
Thanks(0)
Posted: 16 April 2008 at 5:25am |
Hi everyone,
I'm struggling with an interesting problem. Our application doesn't have a document/view architecture. Is it possible to add a Shortcutbar to the application without having to use the code: CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CShortcutBarDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CShortcutBarView)); AddDocTemplate(pDocTemplate); Since i don't have a doc and view, i can't make a CSingleDocTemplate and without the template pointer my application won't work... I'd like to hear your ideas about this. Is it necessary to make de doctemplate or can i do without? Can I create de doctemplate without a document and view? Thanks in advance! Bob |
|
BobWansink
Groupie Joined: 24 January 2008 Status: Offline Points: 59 |
Post Options
Thanks(0)
|
I've been working ahead for a while now, and I'm stuck at the following situation:
I have an application without Document/View Architecture. As such, I can't use the above mentioned code (CSingleDocTemplate). I want to add the Shortcutbar, but adding it to CMainFrame as member requires CMainFrame to have a 'protected' default constructor. Using a public constructor causes a debug assertion, since the system is going to try to create the CXTPShortcutBar outside of my createShortcutBar method. Without the public CMainFrame constructor, I won't be able to add the Shortcutbar; with it, you're forcing me to use the Document/View architecture, which isn't what I want. I hope my explanation isn't all too muddled by bad english, and I hope to recieve an answer soon. Bob |
|
BobWansink
Groupie Joined: 24 January 2008 Status: Offline Points: 59 |
Post Options
Thanks(0)
|
I've been plowing ahead for a while now. I've managed to get most things working like i want them to, but one little problem remains:
My CMainFrame class has a CXTPShortcutBar member. Creating a CMainFrame object without doc/view support, the default constructor is called. In DEBUG mode, it shows me a debug assertion failure at line 53 of xtpshortcutbarpaintmanager.cpp, where it tries the following: line 52: iconHandle.CreateIconFromResource(AfxFindResourceHandle(MAKEINTRESOURCE(XTP_IDI_SHORTCUT_EXPAND_ALPHA), RT_GROUP_ICON), MAKEINTRESOURCE(XTP_IDI_SHORTCUT_EXPAND_ALPHA), CSize(16, 16), TRUE); line 53: (breaking the application) ASSERT(!iconHandle.IsEmpty()); simply ignoring the problem, the debugger continues and the shortcutbar is created without any problems. The application runs smoothly and doesn't crash. Running the application in "Release" mode doesn't generate the exception (since assert is debug only..) and runs the application smoothly. It seems that the call to iconHandle.CreateIconFromResource() fails, causing the debug assertion. Does anyone know what I'm doing wrong here? Anyone from the CJ-Team know what's happening? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
If you build application statically you need add toolkit resource to your exe.
in res\app.rc2 file add
#include "XtToolkitPro.rc"
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
BobWansink
Groupie Joined: 24 January 2008 Status: Offline Points: 59 |
Post Options
Thanks(0)
|
Thanks Oleg! That solved it!
|
|
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 |