Jump to content

Script gets paused during DllCall ?


Recommended Posts

When I run this DllCall it will pause my script until the window I opened with the DllCall closes.

$dll = DllOpen("c:\progra~1\MXACSR6\p2mpi00.dll")

DllCall($dll, 'none', 'sendBrowserMessage','string', "CRTOBJ OBJCLS(POR) FLDLST(ORDRPM='TEST')")

DllClose($dll)

Send("{ENTER}")

This open the windows but does not send the {ENTER}. The function is blocked until the window is closed. I can manually hit enter on the keyboard, but it would make the script require user interaction. Once the window closes the script continues.

Any help would be great.

....... Here is the Documentation from the Program.......

int sendBrowserMessage(char *);

Send a command to be performed by the MAPICS Client. Function will block until MAPICS Client performs requested function.

Parms:

String that contains the command.

Returns:

0 if successful

-1 if MAPICS Client is not running

-2 if application is invalid (not allowed to send commands)

-4 if command is incorrect (syntax or semantics)

Link to comment
Share on other sites

Are you sure it's not sending Enter? Add this to the beginning of your script:

Opt("TrayIconDebug", 1)

so you can hover over the AutoIt icon, and see which line it's hung on.

Adding this before the Send command

msgbox(0,"","Dll call finished!")

If the messagebox show up, it didn't hang on the DllCall

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
Share on other sites

I made a small exe to wait for the window to pop up and then click enter. Thats works but I will have to add like 5 different .exe for various tasks throughout the script. I am afraid that I may have to pass a variable and it would not pass to the other .exe

Link to comment
Share on other sites

Okay, how about this. Make a second EXE who's only job is to wait for various windows that pop up and send an enter to them. Then call that exe first, and close it when you're done, like this

$EMpid = run(@scriptdir & "\EnterMaster.exe")

;

;do your dllcalls, etc

;

ProcessClose ($EMpid)

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...