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. C / C++ / MFC
  4. Subclass dialog item

Subclass dialog item

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 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.
  • J Offline
    J Offline
    John theKing
    wrote on last edited by
    #1

    Friends, I want to subclass an edit control present on my dialog template. For this purpose i derived my on class CMyDialog form base CEdit, and assign the instance of edit control to my class instead of CEdit class. Every thing works fine till here and program runs successfully. Then i needed to handle the WM_PAINT message of my edit control, so i override OnPaint in CMyDialog class. Till here everything works fine. Now the problem is that i want to handle WM_CREATE message of edit control also. For this purpose i am overriding OnCreate(), but the trouble is that the program is not calling my overridden OnCreate method. Any idea ???

    PJ ArendsP 1 Reply Last reply
    0
    • J John theKing

      Friends, I want to subclass an edit control present on my dialog template. For this purpose i derived my on class CMyDialog form base CEdit, and assign the instance of edit control to my class instead of CEdit class. Every thing works fine till here and program runs successfully. Then i needed to handle the WM_PAINT message of my edit control, so i override OnPaint in CMyDialog class. Till here everything works fine. Now the problem is that i want to handle WM_CREATE message of edit control also. For this purpose i am overriding OnCreate(), but the trouble is that the program is not calling my overridden OnCreate method. Any idea ???

      PJ ArendsP Offline
      PJ ArendsP Offline
      PJ Arends
      wrote on last edited by
      #2

      WM_CREATE is sent to the edit control befeore you get a chance to subclass it, so you have to override PreSubclassWindow() instead.


      [

      ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

      Within you lies the power for good; Use it!

      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