Sign in to follow this  
Followers 0
dolphins

Working fine from command line but not as "subprogram"

10 posts in this topic

Hi,

I have an AutoIt script that is reading and analysing a text file and then create a PDF of it (with a third party library). This script (.exe / it is compiled) is working fine if I start it in a DOS Box or from the desktop.

If I start this script from inside another AutoIt script (I would call this a "subprogram"), I get other results in my PDF. How is that possible?

Here is the command to start the script from inside the "main" AutoIt script:

ShellExecuteWait($MyBin & "\PDFcreate.exe", "-I -P -AUTO", $PDFPrint & "\", "open", @SW_HIDE)

Is it possible that the calling script can influence the called script?

Regards

Dolphins

Share this post


Link to post
Share on other sites



What do you mean by "I get other results"? Do you get an empty PDF, no PDF at all or an unexpected content?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

unexpected content

basically 99% is ok ... but about 1% of the info in the PDF is wrong

Edited by dolphins

Share this post


Link to post
Share on other sites

You could try to run ShellExecuteWait without the @SW_HIDE flag so you can see if there are any error messages.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

dolphins,

What is the EXACT command from DOS?

I do not see where you are passing a filename to "PDFcreate.exe" in the shellexecute command.

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

Command line from DOS Box is this:

c:binpdfcreate.exe -I -P -AUTO

So in this command I don't set the working directory. But if I paste this into a desktop link and set the working directory, there is no difference in the result compared to the DOS Box.

The name of the files to read come from a text file (that name is defined in a config file). So I don't need to give the name of the input files in the command line, they come from that text file.

Share this post


Link to post
Share on other sites

dolphins,

I see...nice problem. You are going to need to identify some pattern to the difference, or see if there is an error anywhere (as water suggested).

Good Luck and keep us posted!

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

unexpected content

basically 99% is ok ... but about 1% of the info in the PDF is wrong

Can you post a screenshot of a PDF that is OK versus one in error? Maybe it's an ANSI/ASCII or a code page problem. Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

right now I am trying to get the graphical debugger working on my Win 7 Prof 64-bit ... I get some error from a Ribbon MRU Manager.

I guess I need to get the debugger running to solve this. Thanks for your help in this thread!

Share this post


Link to post
Share on other sites

Hi,

I found the reason ... it is not related to AutoIt. It was my mistake.

Thanks for your help and support!

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