CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 1999
    Posts
    1

    ATL service thread message pump



    I have created a service with ATL Wizard. In the

    "void CServiceModule::Run()" function I found the code


    while (GetMessage(&msg, 0, 0, 0))

    DispatchMessage(&msg);


    My question is: where are messages from "DispatchMessage(&msg)" processed?


    Thanx a lot!



  2. #2
    Join Date
    Apr 1999
    Posts
    2

    Re: ATL service thread message pump

    If your object is running in a STA then all calls to its methods will go through the Message loop. Read up on STA Stuff.


  3. #3
    Join Date
    Apr 1999
    Posts
    2

    Re: ATL service thread message pump


    Hi,

    When you call CoInitialize or CoInitailizeEx with apartment model threading the COM Subsystem will
    create an Invisible Window with class name "OleMainThreadWndClass". it will use this window to
    recieve client requests. this is the simplest expaination, if you need more details refer to any book
    which explains COM threading models and proxy implementation

    Regards,
    Anil


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured