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. creating a window from dll

creating a window from dll

Scheduled Pinned Locked Moved C / C++ / MFC
c++comhelptutorialquestion
3 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.
  • T Offline
    T Offline
    Tim Rymer
    wrote on last edited by
    #1

    is there anyway to call RegisterClass() and CreateWindow() "dynamically"? i need to make a message pump for a worker thread in an ATL control. Everyone says "make a message pump", so show me how. i dont want to know "what to do" i want to know "how to do it". Thanks, people. Let's see some CODE since this is called "CodeProject" haha Thanks if anyone can help me. ~Timothy T. Rymer www.digipen.edu tim.xpertz.com

    J 1 Reply Last reply
    0
    • T Tim Rymer

      is there anyway to call RegisterClass() and CreateWindow() "dynamically"? i need to make a message pump for a worker thread in an ATL control. Everyone says "make a message pump", so show me how. i dont want to know "what to do" i want to know "how to do it". Thanks, people. Let's see some CODE since this is called "CodeProject" haha Thanks if anyone can help me. ~Timothy T. Rymer www.digipen.edu tim.xpertz.com

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      Hey, behold the authentic message pump:

      // The real message pumpTM.
      // Use it wisely.
       
      MSG msg;

      while(GetMessage(&msg,NULL,0,0)!=0){
      TranslateMessage(&msg);
      DispatchMessage(&msg);
      }

      Jokes aside, every window created within a particular thread can only work if that thread, after window creation, gracefully decays into this message loop. GetMessage returns 0 upon calling PostQuitMessage (usually issued from the WM_DESTROY handler of the thread main window), signalling the thread to exit from the message pump (because no further message processing is required). Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      A 1 Reply Last reply
      0
      • J Joaquin M Lopez Munoz

        Hey, behold the authentic message pump:

        // The real message pumpTM.
        // Use it wisely.
         
        MSG msg;

        while(GetMessage(&msg,NULL,0,0)!=0){
        TranslateMessage(&msg);
        DispatchMessage(&msg);
        }

        Jokes aside, every window created within a particular thread can only work if that thread, after window creation, gracefully decays into this message loop. GetMessage returns 0 upon calling PostQuitMessage (usually issued from the WM_DESTROY handler of the thread main window), signalling the thread to exit from the message pump (because no further message processing is required). Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

        A Offline
        A Offline
        alex barylski
        wrote on last edited by
        #3

        Joaquín M López Muñoz wrote: The real message pump. TradeMark...? ;P :laugh: "An expert is someone who has made all the mistakes in his or her field" - Niels Bohr

        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