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. C / C++ / MFC
  3. ATL equivalent of MFCs PreCreateWindow

ATL equivalent of MFCs PreCreateWindow

Scheduled Pinned Locked Moved C / C++ / MFC
5 Posts 3 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.
  • C Offline
    C Offline
    Chris Harrington
    wrote on last edited by
    #1

    Hi, First let me thank codeproject.com for these excellent forums. I have an MFC-based control which uses PreCreateWindow to specify the class for the new controls window. Job is accomplished in 2 lines of code. I'm hoping that it is that easy in ATL. I've been learning as I go and perhaps (hopefully) it is easy. Any pointers or code samples would be appreciated.

    M 1 Reply Last reply
    0
    • C Chris Harrington

      Hi, First let me thank codeproject.com for these excellent forums. I have an MFC-based control which uses PreCreateWindow to specify the class for the new controls window. Job is accomplished in 2 lines of code. I'm hoping that it is that easy in ATL. I've been learning as I go and perhaps (hopefully) it is easy. Any pointers or code samples would be appreciated.

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      In your CWindowImpl-derived class, use the DECLARE_WND_CLASS macro to set the window class name. Eg:

      class CMyControl : public CWindowImpl<CMyControl> /*other base classes...*/
      {
      ...
      DECLARE_WND_CLASS("MyATLControl")
      };

      --Mike-- http://home.inreach.com/mdunn/ All your base are belong to ME~!

      C 1 Reply Last reply
      0
      • M Michael Dunn

        In your CWindowImpl-derived class, use the DECLARE_WND_CLASS macro to set the window class name. Eg:

        class CMyControl : public CWindowImpl<CMyControl> /*other base classes...*/
        {
        ...
        DECLARE_WND_CLASS("MyATLControl")
        };

        --Mike-- http://home.inreach.com/mdunn/ All your base are belong to ME~!

        C Offline
        C Offline
        Chris Harrington
        wrote on last edited by
        #3

        I don't think this is correct. DECLARE_WND_CLASS gives the name of the new class. I want something more like DECLARE_WND_SUPERCLASS(), which seems to provide a mechanism for having both my class and the base class get messages. But I haven't found a real (meaning complete) example of using this. My ATL Wizard generated code has nothing like "class CMyControl : public CWindowImpl " in it.

        E 1 Reply Last reply
        0
        • C Chris Harrington

          I don't think this is correct. DECLARE_WND_CLASS gives the name of the new class. I want something more like DECLARE_WND_SUPERCLASS(), which seems to provide a mechanism for having both my class and the base class get messages. But I haven't found a real (meaning complete) example of using this. My ATL Wizard generated code has nothing like "class CMyControl : public CWindowImpl " in it.

          E Offline
          E Offline
          Erik Thompson
          wrote on last edited by
          #4

          I think I'm following this thread correctly. Have you tried using my CWindowImpl ATL Object Wizard? By setting a few items on the custom property page for the wizard you can get the desired effect I think you are looking for. http://www.codeproject.com/atl/RBCWindowImpl.asp Cheers, -Erik

          C 1 Reply Last reply
          0
          • E Erik Thompson

            I think I'm following this thread correctly. Have you tried using my CWindowImpl ATL Object Wizard? By setting a few items on the custom property page for the wizard you can get the desired effect I think you are looking for. http://www.codeproject.com/atl/RBCWindowImpl.asp Cheers, -Erik

            C Offline
            C Offline
            Chris Harrington
            wrote on last edited by
            #5

            Hi Erik, I saw your wizard while perusing codeproject.com . It looks applicable but I haven't had an opportunity to try it out yet. Thanks.

            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