By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,710 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,710 IT Pros & Developers. It's quick & easy.

using Dlls present in remote machine

P: n/a
I need to import dlls that are present in the remote machine. Its a dll
written in C that exposes methods. I want to import that dll in my C#
application. But that dll is not present in the local machine. Its not a
webservice. I need something like remote method invocation(but dlls).
Nov 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Rohith,

Do you need the dll to run on the remote machine or do you need it to
run on the local machine?

If you need it to run on the local machine, then you should just
distribute it with your application and call it through the P/Invoke layer.

If you need it to run on the remote machine, then you have a few
options. The first would be to create a component derived from
ServicedComponent that will act as a server in COM+, and then make the
remote call from the client machine. The COM+ component would then make the
call to the dll on the remote machine.

You can also use remoting to do this as well, or expose a web service
from the remote machine. In the end, you will have to wrap the call somehow
in a technology that will allow the remote call.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Rohith" <Ro****@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
I need to import dlls that are present in the remote machine. Its a dll
written in C that exposes methods. I want to import that dll in my C#
application. But that dll is not present in the local machine. Its not a
webservice. I need something like remote method invocation(but dlls).

Nov 17 '05 #2

P: n/a
Nicholas,

I need to run that dll in the remote machine and in my local C# application
i need to use those methods in dll.. If you have samples or articles where i
could get more information regarding this kindly let me know.
Thanks
"Nicholas Paldino [.NET/C# MVP]" wrote:
Rohith,

Do you need the dll to run on the remote machine or do you need it to
run on the local machine?

If you need it to run on the local machine, then you should just
distribute it with your application and call it through the P/Invoke layer.

If you need it to run on the remote machine, then you have a few
options. The first would be to create a component derived from
ServicedComponent that will act as a server in COM+, and then make the
remote call from the client machine. The COM+ component would then make the
call to the dll on the remote machine.

You can also use remoting to do this as well, or expose a web service
from the remote machine. In the end, you will have to wrap the call somehow
in a technology that will allow the remote call.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Rohith" <Ro****@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
I need to import dlls that are present in the remote machine. Its a dll
written in C that exposes methods. I want to import that dll in my C#
application. But that dll is not present in the local machine. Its not a
webservice. I need something like remote method invocation(but dlls).


Nov 17 '05 #3

P: n/a
Rohith,

When you say you need to run them local in your C# application, I assume
you mean that you need to initialize the call from your C# application, but
have it execute on the remote machine.

In this case, look up "Remoting" in the .NET documentation. There
should be a tutorial there on how to create a remoting server and client
proxy.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Rohith" <Ro****@discussions.microsoft.com> wrote in message
news:A8**********************************@microsof t.com...
Nicholas,

I need to run that dll in the remote machine and in my local C#
application
i need to use those methods in dll.. If you have samples or articles where
i
could get more information regarding this kindly let me know.
Thanks
"Nicholas Paldino [.NET/C# MVP]" wrote:
Rohith,

Do you need the dll to run on the remote machine or do you need it to
run on the local machine?

If you need it to run on the local machine, then you should just
distribute it with your application and call it through the P/Invoke
layer.

If you need it to run on the remote machine, then you have a few
options. The first would be to create a component derived from
ServicedComponent that will act as a server in COM+, and then make the
remote call from the client machine. The COM+ component would then make
the
call to the dll on the remote machine.

You can also use remoting to do this as well, or expose a web service
from the remote machine. In the end, you will have to wrap the call
somehow
in a technology that will allow the remote call.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Rohith" <Ro****@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
>I need to import dlls that are present in the remote machine. Its a dll
> written in C that exposes methods. I want to import that dll in my C#
> application. But that dll is not present in the local machine. Its not
> a
> webservice. I need something like remote method invocation(but dlls).


Nov 17 '05 #4

P: n/a

"Rohith" <Ro****@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
I need to import dlls that are present in the remote machine. Its a dll
written in C that exposes methods. I want to import that dll in my C#
application. But that dll is not present in the local machine. Its not a
webservice. I need something like remote method invocation(but dlls).


If the DLL is a native C++ code DLL, there is no way to do call any method
directly from C#.
But, you say it's a C dll that exposes 'methods', well a C dll doesn't
expose methods, it can at best export functions. Now these functions can be
called through PInvoke but only when the DLL is local. If you really need
this to be remoted, you will have to create a C# wrapper for your DLL and
use .NET remoting to call it from a C# remoting client. Another option is
wrap the DLL in a C# DLL using System.EnterpriseServices and drop this DLL
in a servertype COM+ application, export a proxy from this server
application and use this proxy at the client to call the server from a C#
client.

Willy.


Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.