Jump to content

Recommended Posts

Posted (edited)

Hello folks,

You can remotely execute a function in another script, spending almost all kinds of variables including arrays (1D only) and receive the results of function calls.

Current functions:

; #CURRENT# =====================================================================================================================
; _IPC_Startup
; _IPC_Shutdown
; _IPC_IsStarted
; _IPC_CallRemote
; ===============================================================================================================================

Example:

Compile and run this first...

#AutoIt3Wrapper_Compression=0                                           ;Compression parameter 0-4  0=Low 2=normal 4=High. Default=2
#AutoIt3Wrapper_UseUpx=n                                                ;(Y/N) Compress output program. Default=Y

#Include <Array.au3>
#Include "InterProcess.au3"

_IPC_Startup()

While 1
    Sleep(100)
WEnd

Then run it and see the result...

#AutoIt3Wrapper_Compression=0                                           ;Compression parameter 0-4  0=Low 2=normal 4=High. Default=2
#AutoIt3Wrapper_UseUpx=n                                                ;(Y/N) Compress output program. Default=Y

#Include <Array.au3>
#Include "InterProcess.au3"

Global $aNewArray
Dim $aArray[10] = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]

_ArrayDisplay($aArray, "$aArray")

If _IPC_IsStarted("script2.exe") Then $aNewArray = _IPC_CallRemote("script2.exe", 5000, "_ArrayUnique", $aArray, 1, 0, 1, "-")

_ArrayDisplay($aNewArray, "$aNewArray represents the 1st Dimension of $aArray")

Make tests and post comments...

Updated code!

Here's a link to the source code:

InterProcess.zip

- This UDF uses MailSlot by @trancexx.

Again, my thanks to @trancexx for the excellent work with Mailslots...

Edited by jscript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

  Reveal hidden contents

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Posted

  Quote

Make tests and post comments...

Well, the example is not working, so i can't really test it, i don't really understand the concept behind this.

P.S: And the syntax check shows a lot of errors/warnings.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

  On 4/15/2011 at 8:58 AM, 'MrCreatoR said:

Well, the example is not working, so i can't really test it, i don't really understand the concept behind this.

P.S: And the syntax check shows a lot of errors/warnings.

Updated, see the first post...

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

  Reveal hidden contents

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Posted (edited)

  On 4/15/2011 at 2:23 PM, 'JohnOne said:

Can it call Native functions?

It makes no sense to run native functions that way! Since your script is interpreted with an executable that contains all the native functions...

This was designed to use functions that are not part of your script, but other than running.

Edit: Although the example above use #include <Array.au3> in both scripts, but could be another function that was not part of the second script...

Edited by jscript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

  Reveal hidden contents

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Posted

  Quote

Example:

Compile and run this first..

Why?

It works without compilation.

- Start script2.au3

- Start script1.au3

Thank you.

:unsure:

The point of world view

Posted (edited)

@ptrex

Thank you! Next step is to implement the use of ByRef parameter and 2d arrays or more...

@ValeryVal

I'm glad you like it!!!

The worst is that I had not tested without compiling... :unsure:

Edited by jscript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

  Reveal hidden contents

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

  • 1 year later...
  • 4 months later...
Posted

You know what really caps off this UDF? Using the JSON UDF on top to send serialized messages and multi-dimensional arrays through to the other application.

Blah, blah, blah... lip service... lip service.Working on a number of projects right now, just waiting for my time to post them here on AutoIt forums.

  • 3 months later...
Posted
  On 6/17/2013 at 7:25 AM, Cynagen said:

You know what really caps off this UDF? Using the JSON UDF on top to send serialized messages and multi-dimensional arrays through to the other application.

So does that mean you have used JSON with this UDF or you think it would improve the UDF?

If you have combined the 2 then post your code (in another thread) it'd be great to see a "complete" (all singing all dancing) Inter-process communications method. :)

  • 7 months later...
Posted (edited)
  On 9/26/2013 at 4:57 AM, storme said:

So does that mean you have used JSON with this UDF or you think it would improve the UDF?

If you have combined the 2 then post your code (in another thread) it'd be great to see a "complete" (all singing all dancing) Inter-process communications method. :)

 

JSON UDF would improve on this UDF for the fact that the JSON UDF will serialize quite a bit of information including 2D arrays, thus expanding the capabilities of this UDF greatly. I'll get a working example together, but it's pretty straightforward, use the JSON UDF to serialize and pipe that through IPC, reverse on receiving end.

I would like to point out that while this is acceptable for IPC and multi-threading things, it's not the greatest at these feats, I've switched to MailSlot directly, which this is based on.

Edited by Cynagen

Blah, blah, blah... lip service... lip service.Working on a number of projects right now, just waiting for my time to post them here on AutoIt forums.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...