Loading ...
Sorry, an error occurred while loading the content.

Re: initialize the Control enable/disable of dialog

Expand Messages
  • Simon Cooke
    ... If you re using the control wrappers, the first thing you must do in your OnInitDialog call is to attach them to the actual windows. Something like:
    Message 1 of 3 , Nov 1, 2003
    • 0 Attachment
      > From: "tlpr2000" <tlpr2000@...>
      > Subject: initialize the Control enable/disable of dialog
      >
      > i'm trying to initialize my dialogbox..
      >
      > my program is using extern value 'server'..
      > if 'server' is '0' or '1', i wanna to make disable editbox.
      > and if 'server' is '2', enable editbox
      >
      > my code is folowing..
      > i wrote my code in OnInitDialog() function like MFC
      > but i met run-time error at the sentence, "serverEdit.EnableWindow
      > (true);" because of IsWindow(m_hWnd)
      >
      > how do i solve this problem?
      > Your help is greatly appreciated.

      If you're using the control wrappers, the first thing you must do in
      your OnInitDialog call is to attach them to the actual windows.

      Something like:

      serverEdit.Attach(GetDlgItem(IDC_SERVEREDIT));

      ... should do it.

      The reason you're getting the IsWindow() message is because unless you
      Attach the controls, they're pointing at a NULL HWND.

      Simon
      --
      www.popcornfilms.com
    Your message has been successfully submitted and would be delivered to recipients shortly.