Jump to content
Sign in to follow this  
cag8f

Include statement necessary for compiling?

Recommended Posts

cag8f

I have a very simple script to create a message box:

MsgBox(0, "", "test")

I can run it by itself, from scite, without issue.  But when I compile it (using default options) and run the resulting EXE, I get an error, "Unable to open the script file."  When I then add the message constant include line:

#include <MsgBoxConstants.au3>

to my code, compile, and run the resulting EXE, the error message goes away.  Why is that line necessary for compiling, but not for running from within scite?

OS is Win 7 32 bit.

 

 

Share this post


Link to post
Share on other sites
Melba23

cag8f,

Running a compiled version of that simple script works fine on my Win7 x32 machine - and I see no reason why it should not. You do not need the #include file as you use magic numbers and not named constants, so adding it should make no difference at all. Does the error dialog come from Windows or from some AV/HIPS software you run? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
cag8f
Does the error dialog come from Windows or from some AV/HIPS software you run? :huh:

 

I'm not sure.  The title of the message box that appears is "AutiIt Error."  Is there a way to troubleshoot further?

Another anomaly that may or may not be related is that the EXE runs twice.  I receive the error message once, then again after I press OK.  Or if I don't press OK, the first box will disappear then the 2nd box will appear.  If I add the #include line, the EXE also runs twice--I receive my desired message box twice (with the same behavior as the error box).

When I then run the same EXE on a 64-bit system, I only receive one message box.

Thoughts on all of that?

Share this post


Link to post
Share on other sites
Melba23

cag8f,

What name do you give to the compiled exe? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Melba23

cag8f,

Beats me - perhaps someone else might suggest something. :(

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
cag8f

I'll try it on another computer I guess and see what happens.

Share this post


Link to post
Share on other sites
cag8f

On my home laptop (also Win 7 Ultimate), the EXE (without the #include line) runs without issue.  That is, when I run it, the expected message box appears, and it only runs once.

Compare this to my work computer, where the same EXE will run twice, and result in an error message each time.    Any idea how I can further troubleshoot to isolate the issue?  Re-install autoit is my only idea.

Share this post


Link to post
Share on other sites
aleph01

Before reinstalling AutoIt, try recompiling the script.  A glitch may have caused the .exe to be corrupt.


Meds.  They're not just for breakfast anymore. :'(

Share this post


Link to post
Share on other sites
cag8f

I've re-compiled many times by now--at least 10.

Share this post


Link to post
Share on other sites
cag8f

Good call, it appears so.  As my AV, I'm using the latest version of Avast.  Here are test results:

1.  If I disable Avast, build the EXE, and run it, there is no issue.  But if I then re-enable Avast and run the same EXE, I get the aforementioned error.

2.  If I enable Avast, build the EXE, and run it, I get the aforementioned error.  If I then disable Avast and run the same EXE, I get a different error box:

Title:  Path + Filename of EXE

Message:  Windows cannot find <path+filename>.  Make sure you typed the name correctly, and then try again.

And the EXE has been deleted.

I know what is happening.  I recently put Avast in silent mode, meaning it does not pop up any messages when it blocks files.  So it's blocking this file, but I'm not receiving a notification.  It is blocking aut2exe.exe during build--more specifically it is blocking a .tmp file created from aut2exe.exe during build.  Then I get the aforementioned error when I try to run the EXE, presumably b/c the .tmp file is missing.

I need to find a way to tell Avast that files created by aut2exe.exe are legitimate.  Anyone know how to do that?

Share this post


Link to post
Share on other sites
sahsanu

Hello,

I don't use Avast so I don't know where you can exclude files/folders but if you find the right option you should exclude this (change red words with your real unit and username):

X:UsersUserNameAppdataLocalAutoit v3Aut2Exe

Note: You should exclude this folder not just in manual/on demand scans but in real time scanning too.

Cheers,

sahsanu

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  

×