C# messaging

  • Thread starter Thread starter GTi
  • Start date Start date
G

GTi

Do anyone have a simple solution how I can send a simple message (int)
from a C program to a C# program/service ?
Preferred both ways C <-> C#

(Windows messages - how ?)

It must be extremely easy and in-memory (no disk media).

Best regards,
Newbie GTi
 
Is your C program Windows based or DOS based?

If both the C and C# are Windows based (they create a window) you can send
and receive regular windows messages between the 2 applications using
SendMessage().

If your C program is DOS based, you may be able to launch it as a child
process from your C# program and redirect it’s STDIN and STDOUT to send and
receive text from it.

Hope this helps.
Regards,
DlgProc
 
Sorry, didn't mention that.
Both are windows applications.
(C# will not be a win service)

I was thinking of windows messages (SendMessage)
But how is this in C#? Unable to find any doc about it.
Sending, receiving messages.
RegisterWindowMessage() i C#

[DllImport("user32.dll")]
int RegisterWindowMessage(????? lpString);
What should be used instead of LPCTSTR?
 
Back
Top