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

Multilanguage FormView

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


Joined: 14 November 2007
Location: Russian Federation
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote aionov Quote  Post ReplyReply Direct Link To This Post Topic: Multilanguage FormView
    Posted: 20 February 2008 at 10:26am
Hi Oleg!
I use XML resource file throth XTPResource, for SDI application.
For dialogs and menus it's worked!
How to use this resource for the FormView?
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: 20 February 2008 at 1:23pm
Hi,
 
Need to overrie Create and add CreateDlg methods:
 
BOOL CsamplesView::CreateDlg(LPCTSTR lpszTemplateName, CWnd* pParentWnd)
{
 LPCDLGTEMPLATE lpDialogTemplate = XTPResourceManager()->LoadDialogTemplate(CsamplesView::IDD);
 // create a modeless dialog
 BOOL bSuccess = CreateDlgIndirect(lpDialogTemplate, pParentWnd, AfxGetInstanceHandle());
 return bSuccess;
}
BOOL CsamplesView::Create(LPCTSTR /*lpszClassName*/, LPCTSTR /*lpszWindowName*/,
 DWORD dwRequestedStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,
 CCreateContext* pContext)
{
 ASSERT(pParentWnd != NULL);
 ASSERT(m_lpszTemplateName != NULL);
 m_pCreateContext = pContext;    // save state for later OnCreate

 // call PreCreateWindow to get prefered extended style
 CREATESTRUCT cs; memset(&cs, 0, sizeof(CREATESTRUCT));
 if (dwRequestedStyle == 0)
  dwRequestedStyle = AFX_WS_DEFAULT_VIEW;
 cs.style = dwRequestedStyle;
 if (!PreCreateWindow(cs))
  return FALSE;
 // create a modeless dialog
 if (!CreateDlg(m_lpszTemplateName, pParentWnd))
  return FALSE;
 m_pCreateContext = NULL;
 // we use the style from the template - but make sure that
 //  the WS_BORDER bit is correct
 // the WS_BORDER bit will be whatever is in dwRequestedStyle
 ModifyStyle(WS_BORDER|WS_CAPTION, cs.style & (WS_BORDER|WS_CAPTION));
 ModifyStyleEx(WS_EX_CLIENTEDGE, cs.dwExStyle & WS_EX_CLIENTEDGE);
 SetDlgCtrlID(nID);
 CRect rectTemplate;
 GetWindowRect(rectTemplate);
 SetScrollSizes(MM_TEXT, rectTemplate.Size());
 // initialize controls etc
 if (!ExecuteDlgInit(m_lpszTemplateName))
  return FALSE;
 // force the size requested
 SetWindowPos(NULL, rect.left, rect.top,
  rect.right - rect.left, rect.bottom - rect.top,
  SWP_NOZORDER|SWP_NOACTIVATE);
 // make visible if requested
 if (dwRequestedStyle & WS_VISIBLE)
  ShowWindow(SW_NORMAL);
 return TRUE;
}
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.133 seconds.