Page 1 of 1

StringIPC class - send/receive strings between processes

Posted: 26 Jan 2015, 18:29
by Learning one
:!: EDIT: instead of StringIPC class, it's recommended to use ObjRegisterActive, which is more powerful and flexible

StringIPC class allows you to exchange (send/receive) strings between processes. It doesn't use WM_COPYDATA, ClipBoard, FileMapping, COM, Mailslots, Pipes, Sockets, or similar; it's all done via Edit controls in hidden GUIs. ;)

>> Usage preview:

Code: [Select all] [Download] (Script.ahk)GeSHi © Codebox Plus

StringIPC := new StringIPCClass("Alpha")						; Creates "StringIPC" object and defines a name (address) of this process; "Alpha"
StringIPC.SendMessage("Beta", "Please do some stuff for me...") ; Sends a message to "Beta" process with the following text; "Please do some stuff for me..."

>> Download StringIPC.zip which includes; StringIPC class, examples, documentation, license. Run both example scripts (Alpha & Beta) and press F1, F2, 1, 2 hotkeys to start exchanging messages. Press Esc to exit.

>> This short video shows how StringIPC works - what's actually happening in background while processes are exchanging messages.
Image

Re: StringIPC class - send/receive strings between processes

Posted: 26 Jan 2015, 19:03
by joedf
Very nice!! :D

Re: StringIPC class - send/receive strings between processes

Posted: 27 Jan 2015, 01:52
by Soft
"It doesn't use WM_COPYDATA, ClipBoard, FileMapping, COM, Mailslots, Pipes, Sockets, or similar; it's all done via Edit controls in hidden GUIs"

Cool..!!

Re: StringIPC class - send/receive strings between processes

Posted: 28 Jan 2015, 03:17
by lexikos
Your script seems surprisingly complicated. It doesn't use WM_COPYDATA, but it does use SendMessage/OnMessage plus a Gui and a bunch of Edit controls. It seems to me that using WM_COPYDATA would be simpler; IPC.ahk, for instance.

Re: StringIPC class - send/receive strings between processes

Posted: 28 Jan 2015, 15:50
by Learning one
@lexikos: I absolutely agree that using WM_COPYDATA would be simpler. I know for majkinetor's IPC, and for OnMessage() example in AHK help, which use WM_COPYDATA.

However, one developer told me that I should avoid using WM_COPYDATA to exchange strings between processes. I also read about possible problems when using WM_COPYDATA (it was long itme ago, can't remember where). So that's the only reason I wrote this… Do you think that using WM_COPYDATA is reliable? Do you recommend it for sending strings between processes?

@joedf, Soft: Thx :)

Re: StringIPC class - send/receive strings between processes

Posted: 28 Jan 2015, 18:40
by lexikos
I am not aware of any issues with WM_COPYDATA. What have you heard?

Actually, there's a much more flexible and fairly simple IPC method available with v1.1.17+. I intend to post about it later, when I get more time.

Re: StringIPC class - send/receive strings between processes

Posted: 28 Jan 2015, 23:48
by boiler
lexikos wrote:Actually, there's a much more flexible and fairly simple IPC method available with v1.1.17+. I intend to post about it later, when I get more time.


Looking forward to this. Right now I clumsily do IPC via text file. I wasn't aware of IPC.ahk, but I guess now I'll just wait for the update.

Re: StringIPC class - send/receive strings between processes

Posted: 29 Jan 2015, 03:24
by lexikos
ObjRegisterActive demonstrates the other IPC method I was referring to.

Re: StringIPC class - send/receive strings between processes

Posted: 29 Jan 2015, 15:24
by Learning one
@lexikos: That developer only said that I should avoid using it, and I didn't ask for details... :(
Wow, ObjRegisterActive rocks! 8-) With such a powerful and flexible IPC method it really doesn't make sense to use StringIPC.
Thank you for making & presenting ObjRegisterActive! :)
First post updated.