How to pass/access Window Handle from Client app to COM Server (DCOM exe)

Hi,
I am having one C++ Client application and created a DCOM service.

Inside a Client application - created a window. Inside a DCOM server exe, I wanted to use this client created window and use it for purpose.

I tried to pass the HWND from Client to COM server -- for this since HWND param is not allowed at Server end, I used LONG insted. I able to receive same pointer reference, what is sent at client app.

But If I check IsWindow(hwnd) --- I got FAILURE here.

If, I try to use FindWindow("myWindow") inside COM Server code -- still I am not able to get appropriate Window handle.

Can someone pl. tell me, what is the way to access / pass Window handle from client app to COM Server exe ?

Thanks in advance.
swift04Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
That whole idea won't work - services run on an invisible (hidden) desktop, (see http://support.microsoft.com/kb/171890 - "INFO: Services, Desktops, and Window Stations"), and a window handle from the logged on user's desktop is meaningless in that context.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sarabandeCommented:
you could do p2p between the client and the server (service). normally the client would send a request to the service (for example via sockets or via shared memory) or would connect to service. then the service could respond or send data to thread of the client which then could be displayed by the client's main ui thread asynchronously.

Sara
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.