Revise a .dll from inprocess to remote?

Dear all:
I did a .dll in which a few methods are included using COM. But it only support inprocess (in the same computer with Client). How to revise the server to change the .dll supporting remote (it can be run on seperated computers)? Will it take long time? Thank you.
[281 byte] By [Xiaolei Shang] at [2007-11-20 1:11:03]
# 1 Re: Revise a .dll from inprocess to remote?
Can you clarify this more ?
Krishnaa at 2007-11-10 23:19:09 >
# 2 Re: Revise a .dll from inprocess to remote?
Can you clarify this more ?
Sure. I created a ATL project and defined a few functions. All opinions are default. Then I built it as .dll file. In client, some program will use these function. Can this .dll file be accessed in different computers from client?
Xiaolei Shang at 2007-11-10 23:20:20 >
# 3 Re: Revise a .dll from inprocess to remote?
Yes, I think you can make a DCOM server.

Look at these samples and articles here,
http://www.codeproject.com/com/#DCOM
Krishnaa at 2007-11-10 23:21:19 >
# 4 Re: Revise a .dll from inprocess to remote?
dllhost.exe surrogate process ( http://www.google.com/search?client=opera&rls=en&q=dllhost.exe+surrogate+process)

I believe, nothing to be changed in server - just another registration process :)
Igor Vartanov at 2007-11-10 23:22:19 >
# 5 Re: Revise a .dll from inprocess to remote?
dllhost.exe surrogate process (http://www.google.com/search?client=opera&rls=en&q=dllhost.exe+surrogate+process)

What is the function of dllhost.exe? Is it related to my case? If so, how can I use it?
I believe, nothing to be changed in server - just another registration process :)
Do you mean: as long as I use ATL project to develop our own methods, and the project is compiled as a .dll file, the dll file can be used in server and a client which is run on another different computer can access the server and use the methods defined in .dll file?
Thank you.
Xiaolei Shang at 2007-11-10 23:23:18 >
# 6 Re: Revise a .dll from inprocess to remote?
What is the function of dllhost.exe? Is it related to my case? If so, how can I use it?

Do you mean: as long as I use ATL project to develop our own methods, and the project is compiled as a .dll file, the dll file can be used in server and a client which is run on another different computer can access the server and use the methods defined in .dll file?
Thank you.

Dllhost.exe is a proxy for your COM dll's. It is not something that you "choose" to use, the Windows operating system does this for you. When you have a COM dll on your machine which needs to be accessed from a remote computer, Windows spawns dllhost.exe. Hence the name, host. It's acting like a little server which takes the requests from the remote computer (like, "call function x()"), then calls your dll (since it's on the same machine, there's no problem with this), your dll returns a value from some function (or returns nothing), and finally the dll host takes the return value and sends it back to the remote machine (or if nothing is returned, dll host simply tells the remote machine that the function is done running).

One of the foundations of COM is that a dll's interfaces, objects, methods, etc. should be able to be accessed from anywhere. It doesn't matter that a COM client program sits on a different computer than the dll. So yes, is the answer to your last question.

Note: there are a few exceptions to the remote COM client/server thing, but I'm not going to go into it right here, and it shouldn't affect you (the solution to these exceptions is why DCOM was made).

-Greg Dolley
greg_dolley at 2007-11-10 23:24:23 >
# 7 Re: Revise a .dll from inprocess to remote?
I get it now! Thanks a lot!
Xiaolei Shang at 2007-11-10 23:25:16 >
# 8 Re: Revise a .dll from inprocess to remote?
What is the function of dllhost.exe? Is it related to my case? If so, how can I use it?I do remember you need a solution quickly... :)

But you have to understand one thing and remember it: the COM is not an easy thing, and DCOM especially, so it cannot be explained in a couple of lines. And if you were given with some link, it would be better follow it first. Please, don't avoid doing your job.

Asking questions with no firm understanding of basics of basics is just a wasting of time - both sides.

Do you mean: as long as I use ATL project to develop our own methods, and the project is compiled as a .dll file, the dll file can be used in server and a client which is run on another different computer can access the server and use the methods defined in .dll file?The ATL-ness of a dll project has no relevance to the point - absolutely. You may do it in a VB - with absolutely the same result. That's the COM, man - it's language-independent by design.
Igor Vartanov at 2007-11-10 23:26:25 >