Sign in to follow this  
Followers 0
Mercer

Stuck :(

7 posts in this topic

#1 ·  Posted (edited)

Hi folks,

I'm new here but been lurking around the forums and looking at the odd snippet here and there! I just picked up Autoit last week and I've been having a blast with it it so far, amazing bit of software!

Anyway, without further ado I'll try to explain the scripting dilemma I'm struggling with in the hopes that some kind soul will take pity on me and set me right:

Basically, I've got an application that automatically processes and debugs C++ files (in VC++ 2008 express edition), I have everything fine tuned except for arguably the most important part: Detecting when the source code debugging is complete so that I can then move onto the next file. I need a way to make autoit detect when the debug for a file is complete and I'm at a loss how to go about doing so! (I'm guessing the best way to do this would be having some kind of interaction between my autoit app and VC++, but I have no idea where to start).

I'm hoping there's a simple way to do this, if anyone can give some tips I'd be extremely grateful. :)

Edited by Mercer

Share this post


Link to post
Share on other sites



Hi folks,

I'm new here but been lurking around the forums and looking at the odd snippet here and there! I just picked up Autoit last week and I've been having a blast with it it so far, amazing bit of software!

Anyway, without further ado I'll try to explain the scripting dilemma I'm struggling with in the hopes that some kind soul will take pity on me and set me right:

Basically, I've got an application that automatically processes and debugs C++ files (in VC++ 2008 express edition), I have everything fine tuned except for arguably the most important part: Detecting when the source code debugging is complete so that I can then move onto the next file. I need a way to make autoit detect when the debug for a file is complete and I'm at a loss how to go about doing so! (I'm guessing the best way to do this would be having some kind of interaction between my autoit app and VC++, but I have no idea where to start).

I'm hoping there's a simple way to do this, if anyone can give some tips I'd be extremely grateful. :)

Well without knowing to much about that software and what you're doing, maybe you can check the process? Does that debugging spawn another process you can check for using ProcessExists()?


EndFuncAutoIt is the shiznit. I love it.

Share this post


Link to post
Share on other sites

Hi EndFunc, thanks for the reply!

Unfortunately the debugger is built into the app as far as I can tell nothing external is triggered - but your suggestion inspired me to look at the interface a bit more - Playing about with autoit window info it seems the output area of the debugger is in read only text format, however, the characters can be highlighted and selected, just not edited - I'm wondering if there's maybe a way for autoit to search the text of a window control / class? Perhaps this way I could search for certain key words to determine if the debugging was complete?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Look at Autoit helpfile into section Function reference/Window management/Controls

You can use ControlGetText() or StatusbarGetText() to see if some "Finished ..." text appears

Or you can test if some button gets enabled/disabled by ControlCommand() with IsEnabled command

Edited by Zedna

Share this post


Link to post
Share on other sites

Look at Autoit helpfile into section Function reference/Window management/Controls

You can use ControlGetText() or StatusbarGetText() to see if some "Finished ..." text appears

Or you can test if some button gets enabled/disabled by ControlCommand() with IsEnabled command

Thanks Zedna, Controlgettext or Statusbargettext seems like the best option for this(?).

This is the info from autoit window info relating to the status bar:

>>>> Control <<<<

Class: msctls_statusbar32

Instance: 1

ClassnameNN: msctls_statusbar321

Advanced (Class): [CLASS:msctls_statusbar32; INSTANCE:1]

ID:

And when the source is built successfully in VC++, the text on the status bar at the bottom is set to "Build succeeded".

So to make my program wait until the status bar says "Build Succeeded" before it continues, I would do something like:

Do
$name = statusbargettext("[CLASS:msctls_statusbar32; INSTANCE:1]", "", 1)
until $name = ("Build Succeeded")

Which doesn't work, but that's where I'm hoping I can get just a bit more help with getting this to work :)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Thanks for all the help, Zedna - undortunately it seems that the status bar is unreadable from VC++, I tried all the methods described here but they all return a blank to the text output :)

So, I've decided to do the check based on the file count of the output directory. When all the files are compiled, there should be at least 63 files in the "release" folder. So the following code is supposed to check that at least 63 files exist in order to continue. But for some reason I can't get it to work correctly? Is something borked here:

$size = DirGetSize("C:\AutoCompile\trunk\bin\Release", 1)

while $size[2] <63
sleep(100)
if $size[2] = 63 Then Exitloop
WEnd
                    

msgbox(0, "Done", "Compile Successful")

Appreciate all the help so far!

Edit: Ok sorry, I think I sorted it out - I was coutning the directories instead of the files. New code:

while 1
$size = DirGetSize("C:\AutoCompile\trunk\bin\Release", 1)
sleep(100)
if $size[1] = 63 Then Exitloop
WEnd
                    

msgbox(0, "Done", "Compile Successful")

Works good!

Edited by Mercer

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  
Followers 0