locked
DRA::RelayoutDialog don't Work? RRS feed

  • Question

  • i just only create a Simple Dialog based applitation,

    but the following code don't work:

    #if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP)
    void CTESTDlg::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/)
    {
     DRA::RelayoutDialog(
      AfxGetInstanceHandle(),
      this->m_hWnd,
      DRA::GetDisplayMode() != DRA::Portrait ?
       MAKEINTRESOURCE(IDD_TEST_DIALOG_WIDE) :
       MAKEINTRESOURCE(IDD_TEST_DIALOG));
    }
    #endif

    it is just the About Dialog.

    Windows XP + SP2

    Visual Studio 2005  professional + Windows Mobile 5.0 PPC/image

    thanks.

    Monday, January 29, 2007 8:43 AM

Answers

  • On your OnInitDialog handler, call

    AfxEnableDRA(TRUE);

    Right after

    CDialog::OnInitDialog();

    Monday, January 29, 2007 11:46 AM

All replies

  • On your OnInitDialog handler, call

    AfxEnableDRA(TRUE);

    Right after

    CDialog::OnInitDialog();

    Monday, January 29, 2007 11:46 AM
  • THANKS.

    but in other Dialog Proc, it can work well.

    and what about the WIN32 API of AfxEnableDRA()?

    just now , i try it. the result is the same.

    the Function can not change the result!

    what is the problem?

    Thank you very much!

    Monday, January 29, 2007 11:49 AM
  • now i know what is the problem:

    at first, i think the function DRA::RelayoutDialog can adjust the Dialog itself, means

    it can change the ID of the Dialog.

    now ,i  understand, DRA::RelayoutDialog  only Relay the Child Windows and Controls (the layout of the Child Windows and Controls  is to be adjusted according to the other Dialog, which has the Same ID of the Child Windows and Controls ,but has other Layout), but can not change the Dialog itself, such as the SIZE .

    Although,i can not sucess, but Thanks a lot.

    Tuesday, January 30, 2007 7:46 AM