Jump to content
Sign in to follow this  
torels

return value from an exe

Recommended Posts

torels

Hi there

I wanted to know if anyone knows how to return a value from an exe. Like a DllCall.

Is this even possible... and if yes is it in AutoIt ?

I think it could be done by writing data to some predefined memory address and then read them so to get a $DllCallVar[0] kind of thing where the exe writing the data is the dll. And the one reading is the DllCall function. But this is very risky.

any other ideas on how to make it less risky OR by using any other method ?

thanks for your help :)


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites
monoceres

Eh? Like this?

Exit 1234

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
Mat

KK, using stdout. means you need to write the exe to return using consoleWrite.

ExeCall.zip

Contains an example, which just has:

ConsoleWrite ("Success")
If You unzip and run ExeCall.au3, you should get a msgBox saying "Success".

MDiesel

Share this post


Link to post
Share on other sites
Juvigy

Or the other method is to write in a file or in the registry.

Share this post


Link to post
Share on other sites
torels

thanks to everyone :)

writing to a file or the registry was not in my options... I wanted it to be in the memory.

btw... what's Exit 1234 ???


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites
Mat

When exit a program, an exit code is sent to the os. if 0 it is a natural exit, else it defines the exit code.

Within autoit, if you have defined the exit function it can be got by @ExitMethod, and describes simply why the script is exiting.

For dos it is something like %ERRORLEVEL%.

Read up on exit, I think what monoceres meant is that you can then read this exit code, but I'm not sure how.

MDiesel

Share this post


Link to post
Share on other sites
monoceres

Read up on exit, I think what monoceres meant is that you can then read this exit code, but I'm not sure how.

It's done with the GetExitCodeProcess or using the built in autoit function runwait.


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.