Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. MFC classes problem

MFC classes problem

Scheduled Pinned Locked Moved Managed C++/CLI
helpc++questionannouncement
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    FredrickNorge
    wrote on last edited by
    #1

    I get an ASSERT(::IsWindow(m_hWnd)) when i try update a CEdit item in from another class like Myclass c; c.OnUpdate(); what do i need to do to solve this issue? Any sugestions appreciated.

    L 1 Reply Last reply
    0
    • F FredrickNorge

      I get an ASSERT(::IsWindow(m_hWnd)) when i try update a CEdit item in from another class like Myclass c; c.OnUpdate(); what do i need to do to solve this issue? Any sugestions appreciated.

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      FredrickNorge wrote:

      what do i need to do to solve this issue?

      IsWindow() is returning false because the m_hWnd HANDLE is not a valid HANDLE. Windows have to be "Created" before a HANDLE exists. In MFC look at something like CWnd::Create(.....) If you are just starting Windows programming you should in use a tutorial and/or invest in book(s).

      led mike

      F 1 Reply Last reply
      0
      • L led mike

        FredrickNorge wrote:

        what do i need to do to solve this issue?

        IsWindow() is returning false because the m_hWnd HANDLE is not a valid HANDLE. Windows have to be "Created" before a HANDLE exists. In MFC look at something like CWnd::Create(.....) If you are just starting Windows programming you should in use a tutorial and/or invest in book(s).

        led mike

        F Offline
        F Offline
        FredrickNorge
        wrote on last edited by
        #3

        such as.... VERIFY(m_dlg1.Create(Main::IDD, this)); EDIT: the dialog is already drawn and past OnInitDialog, however i am using tabing so all dialogs are visible at the same time. -- modified at 18:20 Friday 30th March, 2007

        L 1 Reply Last reply
        0
        • F FredrickNorge

          such as.... VERIFY(m_dlg1.Create(Main::IDD, this)); EDIT: the dialog is already drawn and past OnInitDialog, however i am using tabing so all dialogs are visible at the same time. -- modified at 18:20 Friday 30th March, 2007

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          FredrickNorge wrote:

          however i am using tabing so all dialogs are visible at the same time.

          I don't understand the significance of that.

          FredrickNorge wrote:

          such as.... VERIFY(m_dlg1.Create(Main::IDD, this));

          Well that's an example but even an edit control is a window that must be created. Are you creating controls dynamically? Another reason MFC m_hWnd doesn't work is when you try to use them from worker threads.

          led mike

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups