Recent

Author Topic: Is there a Tutorial or Example using Messages  (Read 9362 times)

garlar27

  • Hero Member
  • *****
  • Posts: 652
Is there a Tutorial or Example using Messages
« on: December 28, 2010, 02:09:39 pm »
Hi!!

   I need to send a message between 2 different applications running on the same PC. I've tried using TCP communication but it is "slow" and I wanted to use Messages but I couldn't find much here: http://lazarus-ccr.sourceforge.net/docs/lcl/lclintf/postmessage.html

   Does anybody knows how to use the PostMessage, PeekMessage, SendMessage, and what their parameters means?

   Is there a Tutorial for this?

   Exists a different way to send something to another application?

Thanks in advance.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Is there a Tutorial or Example using Messages
« Reply #1 on: December 28, 2010, 02:19:47 pm »
To go a little back on the question, how slow was the TCP? I've managed to send 100Mb/s between applications.

Regarding Windows messages you'll propably be stuck with small messages like 2 ints or something.
Also Google the terms and you'll be given Microsoft descriptions to them and alot of examples.
« Last Edit: December 28, 2010, 02:21:35 pm by User137 »

garlar27

  • Hero Member
  • *****
  • Posts: 652
Re: Is there a Tutorial or Example using Messages
« Reply #2 on: December 28, 2010, 02:39:22 pm »
I just need to pass a signal, or a small text for synchronization or status data. I don't need to send larger data.
The delay is at connection time, and sometimes it takes up to 300ms (in worst cases) and I want to see if that connection time can be lowered.

ik

  • Jr. Member
  • **
  • Posts: 88
  • ik
    • LINESIP
Re: Is there a Tutorial or Example using Messages
« Reply #3 on: December 28, 2010, 03:16:59 pm »
You can try SipmleIPC that arrives with FPC (and have non gui components in Lazarus).

garlar27

  • Hero Member
  • *****
  • Posts: 652
Re: Is there a Tutorial or Example using Messages
« Reply #4 on: December 30, 2010, 08:13:51 pm »
Thanks, I'll try SimpleIPC.


Dibo

  • Hero Member
  • *****
  • Posts: 1055
Re: Is there a Tutorial or Example using Messages
« Reply #5 on: February 01, 2011, 06:22:39 pm »
IPC is some standard? I'm mean, if I create TSimpleIPCServer then some clients written e.g in C++ can connect to me?

ik

  • Jr. Member
  • **
  • Posts: 88
  • ik
    • LINESIP
Re: Is there a Tutorial or Example using Messages
« Reply #6 on: February 02, 2011, 12:57:14 pm »
IPC is a description of an action that you choose how to implement.

IPC stands for inter-process communication, and there are infinite ways in doing it.
You can use unix sockets, pipes, text files, databases, sockets, shared memory, signals (in posix)/messages (in windows) and the list goes on and on ...

You choose how and what to send and how "read" it.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8797
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Is there a Tutorial or Example using Messages
« Reply #7 on: February 02, 2011, 05:43:23 pm »
Quote
I'm mean, if I create TSimpleIPCServer then some clients written e.g in C++ can connect to me?
I don't really remember (just open up the corresponding unit yourself) whether TSimpleIPCServer uses pipes or socket, but from my guess it uses socket. So any application that can connect via socket should be able to connect to the server as well (CMIIW).

 

TinyPortal © 2005-2018