Jump to content

Call a Function in compiled EXE or in AU3 script from outside


ptrex
 Share

Recommended Posts

It' s a pitty, because there is lot's of potential going down the drain this way !!

why?

What's the difference between your "syntax" (call(_PV,20,1,2)) and the way valik suggested? In both cases you need to know the function name and the parameters, so if you think you can do it your way, you can also do it the "valik way"... Regarding the return value of your function, you will get into trouble. As JPM told you, you can only get the exit status of the script this way. So this is kind of limited, as you can only return numerical values of a limited range.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

@/dev/null

(call(_PV,20,1,2)) and the way valik suggested? In both cases you need to know the

The difference is that the CALL function works only for NON compiled scripts, in the same script process.

The method of Valik works for compiled EXE scripts. This was needed in case you make a UDF lib which you compile to an EXE.

And want to call idividual functions in the compiled UDF lib.

This is the only workable solution so far.

only return numerical values of a limited range

Not only numerical values. But all are Alfanumerical values.

Indead it will be the return values But this will do for most UDF's.

Most UDF's have return values, don't they ?

So that is not a problem.

regards,

ptrex

Link to comment
Share on other sites

@/dev/null

The difference is that the CALL function works only for NON compiled scripts, in the same script process.

The method of Valik works for compiled EXE scripts. This was needed in case you make a UDF lib which you compile to an EXE.

And want to call idividual functions in the compiled UDF lib.

This is the only workable solution so far.

?? I think we are talking about different things... ??

Not only numerical values. But all are Alfanumerical values.

you cannot have alphanumerical values as an EXIT value!

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

@/dev/null

ConsoleWrite(today()&@CR)

Func today()  ;Return the current date in mm/dd/yyyy form
    return (@MON & "/" & @MDAY & "/" & @YEAR)
EndFunc

This seems AlfaNum to me :)

Up till now i can return anything I need. I don' t see a problem (yet ?!)

Anything that is returned to the console I/O I can return to the COM object as a return value.

I don't see your point ?

regards,

ptrex

Link to comment
Share on other sites

@/dev/null

ConsoleWrite(today()&@CR)

Func today()  ;Return the current date in mm/dd/yyyy form
    return (@MON & "/" & @MDAY & "/" & @YEAR)
EndFunc

This seems AlfaNum to me :)

Erm... ptrex, do we talk about function return codes or AutoIT script EXIT codes (exit())???

I do talk about exit codes as that is the only thing that makes sense with your request!!

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Link to comment
Share on other sites

If you got something going, keep us up to date.

Gladly, but I should tell you that because of the complexity of what I'm doing, I will probably end up doing most of my own COM objects in VB.Net 2. I hope to do some of the simpler items in WSC like you demonstrated but have yet to figure to how to force multiple instances to refer to the same COM object. (It can't be as simple as implementing a Singleton pattern like in Java, can it? I need to learn a lot more about vbscript constructors...) If someone wants to volunteer knowledge of how to implement an object to do that with WSC (as Valik described), it sounds like we'd all be interested.
Link to comment
Share on other sites

  • 16 years later...
10 minutes ago, CreativeMind said:

it's been 15 years. Any news on the progress on how to call a custom function in compiled exe or au3 script?

Not very "@CreativeMind" to ask such silly question. If you need help with a script of yours, make a post in the help area.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

  • Moderators

CreativeMind,

What he said!

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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