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. ATL / WTL / STL
  4. Creating a CEdit in ATL ActiveX control with MFC Support?

Creating a CEdit in ATL ActiveX control with MFC Support?

Scheduled Pinned Locked Moved ATL / WTL / STL
c++questioncomdata-structuresdebugging
3 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.
  • G Offline
    G Offline
    greekgoddj
    wrote on last edited by
    #1

    I have an ATl ActiveX control I am writing which has support for MFC. I want to add a CEdit in my control so that the user can enter values. How do I create this? I have spent all yesterday (literraly) trying and no luck. I construct by CEdit myEdit; Followed by CWnd* parent = CWnd::FromHandle(this->m_hWnd); myEdit.Create(ES_CENTER | ES_NUMBER | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER, CRect(10, 10, 100, 40), parent, 1); This causes assertion...I cannot even find or understnad where the assertion is caused as when i look at the call stack in the debugger, there are no comments or ASSERT(...) around. Has anybody sucessfully added a CEdit to an ATL ActiveX control which supports MFC? If so...how? Thanks

    G 1 Reply Last reply
    0
    • G greekgoddj

      I have an ATl ActiveX control I am writing which has support for MFC. I want to add a CEdit in my control so that the user can enter values. How do I create this? I have spent all yesterday (literraly) trying and no luck. I construct by CEdit myEdit; Followed by CWnd* parent = CWnd::FromHandle(this->m_hWnd); myEdit.Create(ES_CENTER | ES_NUMBER | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER, CRect(10, 10, 100, 40), parent, 1); This causes assertion...I cannot even find or understnad where the assertion is caused as when i look at the call stack in the debugger, there are no comments or ASSERT(...) around. Has anybody sucessfully added a CEdit to an ATL ActiveX control which supports MFC? If so...how? Thanks

      G Offline
      G Offline
      greekgoddj
      wrote on last edited by
      #2

      Well...finally got this one figured out. Must add [code]AFX_MANAGE_STATE(AfxGetStaticModuleState());[/code] before [code]CWnd* parent = CWnd::FromHandle(this->m_hWnd); myEdit.Create(ES_CENTER | ES_NUMBER | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER, CRect(10, 10, 100, 40), parent, 1);[/code] Ciao ;P

      S 1 Reply Last reply
      0
      • G greekgoddj

        Well...finally got this one figured out. Must add [code]AFX_MANAGE_STATE(AfxGetStaticModuleState());[/code] before [code]CWnd* parent = CWnd::FromHandle(this->m_hWnd); myEdit.Create(ES_CENTER | ES_NUMBER | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER, CRect(10, 10, 100, 40), parent, 1);[/code] Ciao ;P

        S Offline
        S Offline
        sh1it505
        wrote on last edited by
        #3

        Sorry,I tried this,but still can't work,IE crashed and error is "Debug Assertion Failed"

        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