How to use resource dll in XTToolkitPro? |
Post Reply |
Author | |
minhduc031
Newbie Joined: 25 February 2008 Location: Vietnam Status: Offline Points: 5 |
Post Options
Thanks(0)
Posted: 25 February 2008 at 6:21am |
Dear all,
I have a problem with using resource dll to develop application by XTToolkitPro. I'm using: XTPResourceManager()->SetResourceManager(new CXTPResourceManager()); XTPResourceManager()->SetResourceFile(_T("Resource.dll")); but it is't working. I have some dialogs need to load from resource dll. Please tell me for valid method. Thanks for your attention. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
it requares to switch Toolkit resources. for your own resources use AfxSetResourceHandle.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Alro
Newbie Joined: 13 February 2008 Location: France Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Use it :
HINSTANCE m_Old = AfxGetResourceHandle(); AfxSetResourceHandle( ::GetModuleHandle("Ressource.dll") ); // TODO your code // TODO your code AfxSetResourceHandle( m_Old ); |
|
minhduc031
Newbie Joined: 25 February 2008 Location: Vietnam Status: Offline Points: 5 |
Post Options
Thanks(0)
|
Thanks of all,
But I used : hDll = LoadLibrary("Ressource.dll"); AfxSetResourceHandle(hDll); -> App crashed !!! My app using doc/view structure , and when i traced bug, i found out bug because of: CSplitterWnd::CreateView(...) , more deeply : BOOL CWnd::CreateDlg(LPCTSTR lpszTemplateName, CWnd* pParentWnd) { // load resource LPCDLGTEMPLATE lpDialogTemplate = NULL; HGLOBAL hDialogTemplate = NULL; HINSTANCE hInst = AfxFindResourceHandle(lpszTemplateName, RT_DIALOG); HRSRC hResource = ::FindResource(hInst, lpszTemplateName, RT_DIALOG); hDialogTemplate = LoadResource(hInst, hResource); if (hDialogTemplate != NULL) lpDialogTemplate = (LPCDLGTEMPLATE)LockResource(hDialogTemplate); ASSERT(lpDialogTemplate != NULL); // create a modeless dialog BOOL bSuccess = CreateDlgIndirect(lpDialogTemplate, pParentWnd, hInst); . . . } --->>>>bSuccess = FALSE. What's matter with my splitter create view? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
You don't have some dialog resource in your dll.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
minhduc031
Newbie Joined: 25 February 2008 Location: Vietnam Status: Offline Points: 5 |
Post Options
Thanks(0)
|
Hi Oleg,
Actually, my app is kind of multilanguages app using resource dlls. The solution which i choiced is using multi resource dll. So, i load a resource for each change language. With call dialog, it's no problem. But when i created splitter ctrl , crash happen !!! I checked resource dll, there is nothing to miss. Do you have another idea? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
It can only be missing resource problem. Double check you have all CFrameView dialogs in resources.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
minhduc031
Newbie Joined: 25 February 2008 Location: Vietnam Status: Offline Points: 5 |
Post Options
Thanks(0)
|
Oh! Dear Oleg,
Believe me, there is nothing to miss in the resource.I'm using UNICODE in it. So, is there any notes with this circumstance? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Another option if you use some custom control (not one from User32 or ComCtrl32) in this dialog. If so, need register it for this Instance.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
minhduc031
Newbie Joined: 25 February 2008 Location: Vietnam Status: Offline Points: 5 |
Post Options
Thanks(0)
|
Hi Oleg,
Thanks for your support. It worked when i registered it. I will call you as "Oleg Salenko" - a Top Football Player in Russian Team at Mondial USA 1994. |
|
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 |