The AppCom object allows to communicate between two Seccia applications.
To send a message to another application, the current application must known the target AppCom object ID. This ID is given by the AppCom.GetID function. There are several methods to do that.
For a progam that executes a second application and these two applications communicate together: first in your main application you have to launch the second application with arguments, then send the AppCom object ID of the second application to the main application (see example below).
Functions
| GetID | Retrieves the ID of the AppCom object. |
|---|---|
| GetTargetID | Retrieves the target ID previously specified with AppCom.SetTargetID. |
| SendText | Sends a text to the target application specified by the AppCom.SetTargetID function. |
| SetTargetID | Changes the target AppCom object ID. |
Events
| OnReceiveText | Is called when the application receives a message from another Seccia application through an AppCom object. |
|---|
Constants
The AppCom object has no constants.
Example
// Main Application
/////////////////////
// Run and send AppCom ID
myDisk.Execute("second.exe", myAppCom.GetID())
// Second Application
//////////////////////
// Retrieve the ID of the main application
myAppCom.SetTargetID(GetArgument(0))
// Now send the ID of the second application
// -1: user command
myAppCom.SendText(myAppCom.GetID(), "-1")
// Main Application
// (AppCom.OnReceiveText)
//////////////////////////
if param=="-1"
myAppCom.SetTargetID(text)
return
end
// Your code here
/////////////////////
// Run and send AppCom ID
myDisk.Execute("second.exe", myAppCom.GetID())
// Second Application
//////////////////////
// Retrieve the ID of the main application
myAppCom.SetTargetID(GetArgument(0))
// Now send the ID of the second application
// -1: user command
myAppCom.SendText(myAppCom.GetID(), "-1")
// Main Application
// (AppCom.OnReceiveText)
//////////////////////////
if param=="-1"
myAppCom.SetTargetID(text)
return
end
// Your code here