[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-atl
Subject:    Re: More on Remote Server up but window not open
From:       Lucinda Ng <luc () CHYRON ! COM>
Date:       1997-10-31 17:36:20
[Download RAW message or body]


Thanks, it works after I configure the application on the remote machine
in the context of "interactive user".

Lucinda

At 11:12 AM 10/31/97 -0500, you wrote:
>Did you configure the application on the remote machine to run in the
>context of the "Interactive User"? You need to do that for it to show up
>on the desktop.
>
>-mike
>
>On Fri, 31 Oct 1997, Lucinda Ng wrote:
>
>> Sorry, I miss out the body of the 'connect ' function in ATL server
>> in my previous mail.
>>
>> When I run my MFC Client, I can see that the remote ATL Server is up from
>> the Task Manager,
>> but the window does not appear on the screen of the remote machine.
>> If I put both the server and the client in same machine, it works fine (the
>> window is there).
>>
>> - I use VC5 and NT4.0.
>> - On the client machine, I use DCOMCNFG to set the server to run on a
>> remote machine.
>> - On the server machine, I use DCOMCNFG to allow all GUEST access and
>> launch the server.
>>
>> When I run my MFC Client, I can see that the remote ATL Server is up from
>> the Task Manager,
>> but the window does not appear on the screen of the remote machine.
>> If I put both the server and the client in same machine, it works fine (the
>> window is there).
>>
>> - I use VC5 and NT4.0.
>> - On the client machine, I use DCOMCNFG to set the server to run on a
>> remote machine.
>> - On the server machine, I use DCOMCNFG to allow all GUEST access and
>> launch the server.
>>
>>
/////////////////////////////////////////////////////////////////////////////
>> // MFC Client -- CTestClient
>> //
>>
>> void CTestclientView::OnInitialUpdate()
>> {
>>         CView::OnInitialUpdate();
>>
>>         HRESULT hr;
>>
>>         IMyWin *m_pITestServer = NULL;
>>
>>         hr = CoCreateInstance(CLSID_MyWin, NULL, CLSCTX_SERVER, IID_IMyWin,
>> (void**)&m_pITestServer);
>>         if (FAILED(hr))
>>         {
>>                 AfxMessageBox(_T("Failed to connect to server"));
>>                 return;
>>         }
>>
>>         m_pITestServer->connect();
>>         return;
>> }
>>
>>
>>
/////////////////////////////////////////////////////////////////////////////
>> // ATL Server -- CMyWin
>>
>> class ATL_NO_VTABLE CMyWin :
>>         public CComObjectRootEx<CComMultiThreadModel>,
>>         public CComCoClass<CMyWin, &CLSID_MyWin>,
>>         public CWindowImpl<CMyWin>,
>>         public IDispatchImpl<IMyWin, &IID_IMyWin, &LIBID_MYSERVERLib>
>> {
>> public:
>>         CMyWin()
>>         {
>>         }
>>
>>         ~CMyWin() {};
>>
>> DECLARE_REGISTRY_RESOURCEID(IDR_MYWIN)
>>
>> BEGIN_COM_MAP(CMyWin)
>>         COM_INTERFACE_ENTRY(IMyWin)
>>         COM_INTERFACE_ENTRY(IDispatch)
>> END_COM_MAP()
>>
>> BEGIN_MSG_MAP(CRendererWin)
>>         MESSAGE_HANDLER(WM_NCDESTROY, OnNCDestroy)
>>         MESSAGE_HANDLER(WM_SIZE, OnSize)
>>         MESSAGE_HANDLER(WM_ERASEBKGND, OnErase)
>>         MESSAGE_HANDLER(WM_PAINT, OnPaint)
>> END_MSG_MAP()
>>
>> //CWidowImplement
>> LRESULT OnNCDestroy(UINT /* uMsg */, WPARAM /* wParam */, LPARAM /* lParam
>> */, BOOL& /* lResult */)
>>         {
>>                 Stop();
>>                 return 0;
>>         }
>> LRESULT OnErase(UINT uMsg , WPARAM  wParam , LPARAM  lParam , BOOL&
bHandled)
>>         {
>>
>>                 HDC hdc = (HDC) wParam; // handle of device context
>>
>>                 CRect r(0,0,0,0);
>>                 GetClientRect(&r);
>>                 bHandled = FALSE;
>>
>>                 return 0;
>>         }
>>
>> LRESULT OnPaint(UINT uMsg , WPARAM  wParam , LPARAM  lParam , BOOL&
bHandled)
>>         {
>>                 HDC hdc = (HDC) wParam; // handle of device context
>>                 bHandled = TRUE;
>>                 return 1;
>>         }
>>
>>
>> LRESULT OnSize(UINT uMsg , WPARAM wParam, LPARAM lParam , BOOL& lResult )
>>         {
>>
>>                 lResult = TRUE;
>>                 return 1;
>>         }
>>
>> public:
>>
>>         bool Run()
>>         {
>>                 RECT rcPos = { 200, 0, 500,300 };
>>                 //HMENU hMenu = LoadMenu(_Module.GetResourceInstance(),
>> MAKEINTRESOURCE(IDR_MYWIN));
>>                 //Create(GetDesktopWindow(), rcPos, _T("Renderer
Window"), WS_VISIBLE |
>> WS_OVERLAPPEDWINDOW, 0, (UINT)hMenu);
>>                 Create(GetDesktopWindow(), rcPos, _T("Renderer
Window"),WS_VISIBLE |
>> WS_OVERLAPPEDWINDOW);
>>                 ShowWindow(SW_SHOWNORMAL);
>>                 return S_OK;
>>         }
>>
>>         bool Stop()
>>         {
>>                 PostQuitMessage(0);
>>                 return S_OK;
>>         }
>>
>> // IMyWin
>> public:
>>         STDMETHOD(connect)()
>>         {
>>                 Run();
>>                 return S_OK;
>>         }
>> };
>>
>> Can anybody tell me why?
>> Any help will be appreciated.
>>
>>
>> Lucinda
>>
>> ----------------------------------------------------------------
>> Users Guide http://www.microsoft.com/sitebuilder/resource/mailfaq.asp
>> contains important info including how to unsubscribe.  Save time, search
>> the archives at http://microsoft.ease.lsoft.com/archives/index.html
>>
>
>----------------------------------------------------------------
>Users Guide http://www.microsoft.com/sitebuilder/resource/mailfaq.asp
>contains important info including how to unsubscribe.  Save time, search
>the archives at http://microsoft.ease.lsoft.com/archives/index.html
>

----------------------------------------------------------------
Users Guide http://www.microsoft.com/sitebuilder/resource/mailfaq.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://microsoft.ease.lsoft.com/archives/index.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic