473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Send data from 1 program to another (on same PC)

What's the best way?

I could use sockets, but that's overkill. I could use pinvoke'd
SendMessage() like Win32, but I assume there's a C# wrapper for this.
What might it be? The receiving program still needs to respond to a
user message, and how would C# allow this? I've seen some people use
events to send data, but how it works isn't entirely clear to me.

Any thoughts would be appreciated......
Zytan
Jun 27 '08 #1
6 1863
I've seen some people use
events to send data, but how it works isn't entirely clear to me.
Er, I think they were using events to send data between forms of the
SAME program, not between two DIFFERENT programs. So, ignore that
thought.

Zytan
Jun 27 '08 #2
What's the best way?

Btw, all I want to do is send a string of text.

http://www.codeproject.com/KB/vb/Sen...y_message.aspx
This guy provides a way to do it using PostMessage() and events, but
it just seems ugly to build up a string from a bunch of PostMessage()
calls..... I think I'd rather use sockets, although that raises
security issues that PostMessage() does not, and it seems like
overkill.

Zytan
Jun 27 '08 #3
http://www.codeproject.com/KB/vb/Sen...y_message.aspx
This guy provides a way to do it using PostMessage() and events, but
it just seems ugly to build up a string from a bunch of PostMessage()
calls.....
This method is flawed. If you have more than one thread sending it,
you get synch errors. This could be fixed, but it makes it much more
complex.

Zytan
Jun 27 '08 #4
http://www.codeproject.com/KB/vb/Sen...y_message.aspx
This guy provides a way to do it using PostMessage() and events, but
it just seems ugly to build up a string from a bunch of PostMessage()
calls.....

This method is flawed. If you have more than one thread sending it,
you get synch errors. This could be fixed, but it makes it much more
complex.
Actually, you just need to look at the window handle in
System.Windows.Forms.Message to distinguish between windows sending
the messages. Since you can't (shouldn't) have multiple threads
running under at the same time using a GUI, anyway, you can (should)
never have the same window sending two messages at once.

Still seems ugly to me, though.

Zytan
Jun 27 '08 #5
What's the best way?
If both ends are managed and under your control then use Remoting.

Cheers
Doug Forster

Jun 27 '08 #6
Yes
"Zytan" <zy**********@gmail.comwrote in message
news:58**********************************@f36g2000 hsa.googlegroups.com...
>If both ends are managed and under your control then use Remoting.

Doug, remoting sounds very powerful and much more easy than sockets...

Can it be used for networking one PC to another PC? Can I have the
same server<-->client communication between two programs using
remoting, both managed & under my control, but just on two PCs instead
of on the same PC?

Zytan
Jun 29 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: zhimin | last post by:
Hi, I'm writing a program to send large file(100m) through dotnet using TCPListener & TCPClient, I'm sending the file with a ask and response loop: 1. Client send a flag 1 to server indicate it...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
15
by: cj | last post by:
How can I get a button in VB to send the contents of a text box via email in a manner similar to the "Send To\Mail Recipient" functionality that you can select via right clicking a file in Windows...
3
by: growse | last post by:
Right, I've got a 2 c# programs here. Lets call them A and B. My aim is to send a simple string from B to A. A is always running. I've overridden the WndProc method to give me messages that are...
14
by: Professor Yonce | last post by:
I have made form for E-Mail. I have entered code but the Import system does not work. It has squiggly line underneath it showing it is not communicating. It Will not build. Public Class...
2
by: Mesan | last post by:
Hello everyone, Thanks to many useful posts in this newsgroup and others, I've been able to come very close to something I've been wanting to do for a very long time. I've figured out how to...
1
by: mostafij | last post by:
// This code write random data into a file and every 5 seconds this //program send 5 seconds data into another file. #include <HEADER FILES> FILE *f1,*f2; int main(int argc, char *argv) {...
5
by: Mirxon | last post by:
Hello, I'm working on a C program under Ubuntu. It's basd on socket. Browser calls a client cgi (C program), and send some parameters to server (C program). Server runs another program...
0
by: Xionbox | last post by:
Hello everybody, The error I have seems very easy to solve, but for some odd reason I can't seem to solve it. Anyways, here's my "setup". I created a server running on localhost:1200 (telnet...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.