Click here to Skip to main content
14,299,246 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello, please help me with some problem! I have a dll written on c++ and want to use its functions from wpf application that is located on another computer. Is it possible to do it?

What I have tried:

I've tried to use RPC, but it works only with two c++ applications.
Also I heard that WCF is used only with two .NET apllications, isn't it?
Posted
Updated 23-Sep-16 6:44am
Comments
Richard MacCutchan 23-Sep-16 3:08am
   
Why not just copy the DLL to the same computer that the application is on?
Member 10946783 23-Sep-16 3:12am
   
Unfourtunatelly it won't solve a problem because I need to use this dll like a server which will have a lot of clients on other computers, something like data acquisition system.
Rate this:
Please Sign up or sign in to vote.

Solution 1

You could use two .NET applications, one othe the local machine (say client) ant the other on the remote one (say server). The network communication happens between client and server so that you may use WCF (or whatever). The server interfaces with the C++ DLL (using, for instance P/Invoke).
Another option would be transforming the C++ DLL into a DCOM server.
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

I would probably ise WCF and make the server using .NET. From .NET, you can use your C++ code either by using mixed-mode C++/CLI or by using P/Invoke. Mixed-mode would be easier if you have comp'ex C++ code. P/Invoke would be appropriate if you have free functions much like Windows API.

On the other hand, if you communication already works between the client and server, you might prefer to use C++/CLI from your WPF application.

So there are a few possibilities but the best one depends on you existing code...
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100