Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I see there are some other posts related to this issue. However, I want to ask if there is new elegant way to just exchange some messages between a C#.net application and a C++ application?
They are running on the same machine.
Thanks in advance.
What you want is inter-process communication (IPC), which is language-agnostic by definition.
Typical solutions include:
Named pipes (also called FIFOs)
Mail slots
File mapping
Sockets
RPC
etc.
You use different ones depending on your needs.
Here is information on windows-supported IPC methods: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574%28v=vs.85%29.aspx
Most of this functionality is exposed in C# through WCF, which is windows-specific of course. If you're using Mono, you're out of luck.
C++ doesn't define any IPC constructs in the language itself, so you will have to use platform-specific libraries regardless.
Search around for IPC examples in C# and C++ and you will get plenty of hits.
Here's a SO post to get you started: IPC Mechanisms in C# - Usage and Best Practices
I have always used sockets, that is the simplest way I can think of (not the most elegant though)
There are many mechanisms you can use to do this.
This article enumerates the common ways to accomplish interprocess communication on the windows platform. Most if not all are possible form both C# and C++ (though I would hate to see you use DDE from C#, though it has apparently been done).
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I want to share data between programs that run locally which uses different languages, I don't know how to approach this.
For example, if I have a program that uses C# to run and another that uses python to run, and I want to share some strings between the two, how can I do it?
I thought about using sockets for this but I'm not sure that this is the right approach, I also thought about saving the data in a file, then reading the file from the other program, but, it might even be worse than using sockets.
Note that I need to share strings almost a thousand times between the programs
There are a lot of ways to do so, I would recommend you reading more about IPC (Inter Process Communication) - sockets, pipes, named pipes, shared memory and etc...
Each method has it's own advantages, therefore, you need to think about what you're trying to achieve and choose the method that fits you the best.
Any kind of IPC (InterProcess Communication) — sockets or shared memory. Any common format — plain text files or structured, JSON, e.g. Or a database.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm currently thinking about developing a sockscap-like tool with some cool new features and a nice WPF gui.
For those who don't remember:
SocksCap was a tool that allowed you use any application with the use of a SOCKS4/5 Proxy... So e.g. you could play games with another IP without using VNC and alike.
However I'm not much of a network guy, so I'd love some input on how to "socksify / proxify" from an external application within a windows environment. As this is supposed to be a project, not a "quick and dirty" thing I'm only into "clean and generic" approaches instead of "modify HOSTS entry" or "plugin for each application"...
So how would someone with knowledge about networking programming start his research about redirecting (routing?) an applications traffic via a proxy?
Thanks for any help :-)
Google always helps.
Under windows there is something similar to socksify:
FreeCap -- is a program for transparency redirect connections from programs through SOCKS server. In fact that some programs hasn't native SOCKS support (for example Internet Explorer), In this case FreeCap will be helpful, transparently redirect all connections requests through SOCKS server.
The internal implementation of this seems hijacked the socket call of the client applications.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
What is COM+? What is equivalent for COM+ in .Net?
COM+ was Microsoft's offering in the battle for the middle tier that raged in the late nineties. A set of extensions built on top of COM with typical middleware duties like componentizing modules across machines and getting them to work together in a transaction-safe way. CORBA was another one, now also largely forgotten.
The only thing it really accomplished was to make Java a significant force.
ServicedComponent http://msdn.microsoft.com/en-us/library/7c05y13x(VS.71).aspx
Right here on wikipedia. Has a section on .Net
Component Object Model
There is no equivalent in .Net as you can still use COM+ in .Net but there are better ways of achieving the same thing.
COM Interop used to be a rather dangerous, if not overly-hyped feature.
Why dangerous? It used to collect and dispose of live com pointers, thus pulling the rug right out from under you. Oh my, it was so much fun. It could be fixed by now I would hope.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How can I make an interface for console applications to make them look like edit.com under Microsoft's operating systems. Target languages are C, C++ and C#.NET.
Have a look at curses:
e.g.:
http://sourceforge.net/projects/curses-sharp/
That would be based on a very simple framework which writes directly to the video to draw the underlying shadows, drop down menus, etc, not alone that, since 'Edit.com` would be written in assembler for speed in relation to drawing, this is quite ancient by today's standards, you can however take a look at PDCurses which will enable you to do this kind of thing.
The neat beauty is, PDCurses is compatible with the unix equivalent of Curses.
But, really, today, it is all about GUI and Windows....
What kind of application are you trying to do?
IIRC, from my old days, there was an object orientated framework for this using TurboVision, which has a port available with open source now, see this wikipedia entry on this TurboVision.
Today, console applications are either old DOS applications emulated more and less in Windows, or command-line interpreters.
Anyway, if you really want to do an editor, use the System.Console class in the System NameSpace and use the SetCursorPosition method to write what you want where you want
The edit.com window you are showing appear to be developed with Turbo Vision, an old console gui library written by Borland many years ago.
Borland put the software in public domain and release its C++ sources. There is also a porting to Pascal, developed by the community, called Free Vision.
Unfortunately ,I don't think there is a porting or a wrapper to dot.net, so you have to write your own. Or, at least, you can look at the sources to get inspired...
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a project written in Java (>1.5).
Is it possible to write parts of the project with C#?
For instance the GUI and calling the methods and instantiate the classes written in java?
If yes, how?
I am author of jni4net, open source intraprocess bridge between JVM and CLR. It's build on top of JNI and PInvoke. No C/C++ code needed. I hope it will help you.
Not without something like ikvm - or using web services etc to communicate between the two sides. Basically it's likely to be much more work than either rewriting your existing project code in C# or writing the GUI in Java.
There is something called Java Language Conversion Assistant for .NET. You can convert your Java classes to c# and start coding.
There is also something called JNBridge (not free).
It seems like my solution is very limited. and apply only to specific version of java.
I probably will stay with old good C :) Can't imagine how to work without shared libraries :)
This document explain how to create a dll from java and use it in C code. I'm not C# or java expert but i'm sure that you can load external dll's in C# as well. So not a complete solution but good starting point, IMHO.
Generally dll it's a perfect way to mixing languages.
In simple way you can pack your java classes to jar file then
In C# use Process class for execute and map IO stream
I did some research on this a few years ago (2005 I believe) and I liked JNBridgePro as the best third party product to do this. Check it out here http://www.jnbridge.com/
Good luck!