You can use this "Inter Process" I gather from the name?
I have never really used any of this kind of stuff before, could you explain a little about it. Can you get "wires crossed" due to the naming of the channnels? what are the limitations?
Thanks, sorry of the questions seem kind of basic
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
XIncludeFile "IPC.pbi"
Repeat
Delay(1)
Until IPCReceiveString("JUST_A_TEST") = "this is a string"
Debug "received: "+"this is a string"
IPCSendString("JUST_A_TEST", "aha!")
Debug "sent: "+"aha!"
To test, run p1 than p2. All this does is to use memory mapped files to store data (aka global memory). I need this stuff to "talk" to a service in my program. The only limitation (but because of windows) is that if you need this to run in a non-admin account, you need to first use IPCSendString so the file mapping is created before you read it and also use IPCInit() at first. This will allow the file mappings to be accessed from a restricted program too. I will make this better, I am just starting to work at it these days.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Playing with this you need to consider the clean up. When I tried this sending data from one app to another the recieveing app checked it's buffer and the same data was alwyas in there. The workaround was to have the receiver clear it.
Try these two apps, note the receiver app clears the buffer, if you remove that line have a look at what happens. I really like this though
XIncludeFile "IPC.pbi"
IPCInit()
OpenConsole()
PrintN("Waiting to Receive Text...")
Repeat
rcvd.s = IPCReceiveString("JUST_A_TEST")
If rcvd <> ""
PrintN(rcvd)
rcvd = ""
IPCSendString("JUST_A_TEST","") ;clear string from buffer, comment this line to see what I mean
PrintN("Waiting to Receive Text...")
EndIf
Delay(1)
ForEver
CloseConsole()
I swaped the debugger for the consol as it's easier for me I find
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
With the security could you have two users communicate? For example, (an idea just popped into my head but I'm about to go to bed so I don't have time to try it now) if you had two users on RDP teminal services sessions could this be used as a chat program?
I could have this on servers for admins to chat if they bump into eachother on the same box "Oi! Get off, I'm about to reboot!" etc
hmm, needs some thought
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein