CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 1999
    Location
    Boston, MA, USA
    Posts
    17

    Automation Problem...

    I start an MFC MDI Automation from a client. However, the CView:: OnInitialUpdate() of the server is not called, thus the program crashes. What is the problem with it? Should I move the initialization to elsewhere? I can’t figure out how to fix it. Any suggestions are greatly appreciated.



  2. #2
    Guest

    Re: Automation Problem...

    Did you find an answer to this yet? My problem is not quite the same, but
    might be related. When CreateObject (or New) is applied to the MFC application
    object, MFC's AfxWinMain()hangs because the message loop (pThread->Run()) never
    returns control to the calling thread until the application finishes.

    I don't know how to fix this so I'm asking around. For your problem, you
    may want to check the:

    if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)

    line in InitInstance(). This returns right away if running automation and
    will not let the app initialize the frame window.

    -- Rolando
    [email protected]



  3. #3
    Join Date
    Apr 1999
    Location
    Boston, MA, USA
    Posts
    17

    Re: Automation Problem...

    Thanks for your hint. I send a message to view for calling OnInitialUpdate() when I start the Automation. It works. But I am going to try your approach. When I start the Automation server from a client, TRACE() in the server does not display. Do you know how I can get debug message?


  4. #4
    Join Date
    Apr 1999
    Posts
    43

    Re: Automation Problem...

    I need much more information about your problem to help you. The best way is to send me a simple sample of your server and client, because everything else is ghosthunting.

    Mike


  5. #5
    Guest

    Re: Automation Problem...

    Interesting. I have a related problem : I have a dialog based automation
    client and a server. The client calls CreateDispatch() to automatically
    launch the server. But if I start a fresh copy of my client, a new
    instance of the server program is launched. But I want a single instance
    of the server to connect to all the clients. How can I do it ?
    With thanks,
    - Rajaraman


  6. #6
    Join Date
    Apr 1999
    Posts
    5

    Re: Automation Problem...

    Make your server a singleton


  7. #7
    Join Date
    May 1998
    Posts
    5

    Re: Automation Problem...

    You should place the /Automation in the command line (use the projects
    setting)
    start debug the server from VC IDE(PRESS GO\F5)
    Once the server had launch with the "Automation" in the command
    line it will not display the main window(see initinstance)
    it just "publish" it's class factories,so client can create
    COM object's

    than move to the client and run it.

    tomer




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