Calling GetTextInit causes macro to crash

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
c0ntra
Newbie
Posts: 2
Joined: Mon Feb 06, 2012 4:33 pm
Location: Toronto

Calling GetTextInit causes macro to crash

Post by c0ntra » Mon Feb 06, 2012 4:41 pm

Hi,

I'm trying to use the text detection feature in Macro Scheduler 13, and for some reason whenever I call GetTextInit in my script, Windows throws an exception and I can't figure out why.
At first I thought it was because I was developing on a Windows 7 x64 computer but trying to run the macro on an x86 platform, but I tried compiling the exe using a virtual instance of Windows 7 X86, only to end up with the same result.

The error window that pops up says:

Code: Select all

Exception EAccessViolation in module Viewpoint_v1.6.exe at 00000000.
Access violation at address  00000000. Read of address 00000000.
The Eventlog shows:

Code: Select all

Log Name:      Application
Source:        Application Error
Date:          2/6/2012 10:18:15 AM
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      FC-004
Description:
Faulting application name: Viewpoint_v1.6.exe, version: 1.0.0.0, time stamp: 0x4f1958ad
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x00000000
Faulting process id: 0xbf0
Faulting application start time: 0x01cce4e27e02a6b3
Faulting application path: C:\Users\helpdesk\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Viewpoint_v1.6.exe
Faulting module path: unknown
Report Id: ca2fee39-50d5-11e1-996c-80ee731eaa20
Event Xml:
<Event>
  <System>
    <Provider>
    <EventID>1000</EventID>
    <Level>2</Level>
    <Task>100</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated>
    <EventRecordID>3512</EventRecordID>
    <Channel>Application</Channel>
    <Computer>FC-004</Computer>
    <Security>
  </System>
  <EventData>
    <Data>Viewpoint_v1.6.exe</Data>
    <Data>1.0.0.0</Data>
    <Data>4f1958ad</Data>
    <Data>unknown</Data>
    <Data>0.0.0.0</Data>
    <Data>00000000</Data>
    <Data>c0000005</Data>
    <Data>00000000</Data>
    <Data>bf0</Data>
    <Data>01cce4e27e02a6b3</Data>
    <Data>C:\Users\helpdesk\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Viewpoint_v1.6.exe</Data>
    <Data>unknown</Data>
    <Data>ca2fee39-50d5-11e1-996c-80ee731eaa20</Data>
  </EventData>
</Event>

And finally, the last few lines of log output from Macro Scheduler before the crash is:

Code: Select all

2/6/2012 10:18:13:538 - START: // Begin 
2/6/2012 10:18:13:539 -   END: // Begin 
2/6/2012 10:18:13:540 - START: Repeat>i
2/6/2012 10:18:13:543 -   END: Repeat>i
2/6/2012 10:18:13:544 - START: Let>i=i+1
2/6/2012 10:18:13:545 -   END: Let>i=i+1
2/6/2012 10:18:13:545 - START: MouseMove>1920,1080
2/6/2012 10:18:13:549 -   END: MouseMove>1920,1080
2/6/2012 10:18:13:549 - START: SetFocus>.+Windows Internet Explorer$
2/6/2012 10:18:14:470 -   END: SetFocus>.+Windows Internet Explorer$
2/6/2012 10:18:14:476 - START: 
2/6/2012 10:18:14:477 -   END: 
2/6/2012 10:18:14:478 - START: // Detect if the Viewpoint Application fails to load
2/6/2012 10:18:14:479 -   END: // Detect if the Viewpoint Application fails to load
2/6/2012 10:18:14:485 - START: 
2/6/2012 10:18:14:486 -   END: 
2/6/2012 10:18:14:487 - START: Let>WST_TIMEOUT=1
2/6/2012 10:18:14:490 -   END: Let>WST_TIMEOUT=1
2/6/2012 10:18:14:492 - START: GetTextInit

It would appear that anywhere in my code, if I place GetTextInit I experience the same crash; Even if it's the only line present in my code, as I attempted to comment everything else out to test.

Any help would be greatly appreciated

thanks

Adam

[/code]

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Feb 07, 2012 10:25 am

Can you clarify precisely which v13 build you are running?

Can you also send me your script and .exe so that I can see if the same script reproduces the same error here?

Could you send to support AT mjtnet.com
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

c0ntra
Newbie
Posts: 2
Joined: Mon Feb 06, 2012 4:33 pm
Location: Toronto

Post by c0ntra » Tue Feb 07, 2012 2:29 pm

Hi Marcus,

thanks for the reply. I've emailed you a copy of the source and exe to look at. We're currently using version 13.1.01

Adam

kevinm
Newbie
Posts: 1
Joined: Sun Feb 19, 2012 10:43 pm

Post by kevinm » Sun Feb 19, 2012 10:46 pm

I am getting the same error when using GetTextInit, with v13.1.02,

Has this been resolved?

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Feb 21, 2012 11:11 am

We have not been able to replicate this in any application. It is possible that the issue is related to the application that you are trying to extract from.

1. Does the problem occur when attempting to get text from a different application - e.g. try with Notepad and the Desktop.

2. Does it occur when using GetTextAtPoint. Try GetTextAtPoint against your application and also against Notepad and the Desktop.

If we can identify which application this occurs in, we can feed back to the vendor of the text capture library.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

t7n7
Newbie
Posts: 2
Joined: Thu Aug 23, 2012 7:23 pm

Any updateS?

Post by t7n7 » Thu Aug 23, 2012 7:26 pm

Hi,

I just purchased the enterprise version and am experiencing the same issue.

Running version: 13.1.06 April 2012

It is critical that I require my app to be compiled in order for it to run. At the moment, everything works except when i compile to an exe file with the GetTextInit command inside.

I also tried to create a new script with just the GetTextInit command and NOTHING ELSE and the program would still crash once compiled into an exe file.

MY OS: Windows 7 64BIT SP 2 with all the updates / patches / service packs.

Thanks

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Fri Aug 24, 2012 1:33 am

Taken from the version 13 help file.
Create Exe

If your script contains any of the text capture functions (GetTextAtPos, GetTextInRect, GetWindowsTextEx, GetTextPos, WaitScreenText) you will need to supply the following files with your .exe:

GetWord.dll
GetWordNT.dll
GetWord_x64.dll
GetWordNT_x64.dll
GetWord_x64.exe
License.dat

These files can be found in the Macro Scheduler program folder. Copy the above files to the same location as your .exe.

t7n7
Newbie
Posts: 2
Joined: Thu Aug 23, 2012 7:23 pm

:D

Post by t7n7 » Wed Aug 29, 2012 6:10 pm

Thanks Rain!!

I'm a happy camper for now... though I do wish these libraries are included in the next update for a single executable!

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Thu Aug 30, 2012 3:38 pm

You're very welcome.

I believe (But don't know for sure) the reason why the files are not automatically included is to keep the executable size as small as possible plus not every script uses the GetText functions. GetWordNT_x64.dll and GetWord_x64.exe combined are over 4 MB. I personally haven't used the GetText functions and would hate for my executable's sizes to increase by roughly 5 MB.

Maybe Marcus can include an option like a check box in the compiler to include those files? You can post the suggestion in the "Enhancement Suggestions" forum here http://www.mjtnet.com/forum/enhancement ... ns-f8.html

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Thu Aug 30, 2012 5:39 pm

It's a third party library so the issue may be the license terms.

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Aug 30, 2012 6:31 pm

You could also import them into your script then have the script export them to be used. I'd also make sure to delete them when I was finished with them. Its possible this violates some licensing terms but if it does, I haven't seen it.

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Thu Aug 30, 2012 8:11 pm

I couldn't find the getword license on their website.

If you just gotta have a single file distribution use an installer package, like inno, to combine everything.

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Aug 31, 2012 8:14 am

While they are third party libraries the "issue" is technical. These are low level hooks that have to hook into every application and process running on your system. Otherwise they cannot do what they do. These hooks *HAVE* to live in external DLLs. It is simply impossible to make them work as part of the application. A lot of work has been done to shrink the number of files required to as small as possible.

Welcome to the world of software distribution. Barely any software exists that doesn't need multiple files to function. That's why we use installers, which package up all the files you require so that your user/customer can run one installer file which unpacks all the files and sets everything up for them. As suggested you could use the free Inno Setup installer, or use Macro Scheduler's own binary import/export functions. Or just use a good old zip file.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts