Highlighted
Absent Member.
Absent Member.
2077 views

[archive] Screen messes up when calling external executable.

[Migrated content. Thread originally posted on 15 January 2008]

I have a problem when I call an external EXE program. The call executes fine and the program displays another window on top of my Acu Cobol application. If I move this external window around my application does not re-paint the screen properly. This affects just my Accu Cobol application window. It will either clear the contents of my screen or create what looks like a kaleidoscope when I move the external window around. If anyone knows what is causing this I would appreciate some tips that we can try to resolve this.

Thanks,

Jim
0 Likes
10 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Screen messes up when calling external executable.

Some example code (small) to reproduce is generally a good idea.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Screen messes up when calling external executable.

I have read in other posts that this problem is similar to the Ghost Window problem. It is like my cobol application has locked up and the screen is not refreshed if I move the called application around. The called application is a 3rd party VB application compiled into an EXE. I call it from my Cobol application and the VB screen runs on top of my application, my application waits for the VB aplication to return control and here is where I feel the Ghost Window problem comes in.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Screen messes up when calling external executable.

Here is a screen shot (I hope) of the problem. As you can see ... well umm as you can not see is the behind the x-charge window is my application window.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Screen messes up when calling external executable.

How are you calling the EXE? Look at synchronous vs. asynchronous. That's probably it.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Screen messes up when calling external executable.

I first tried to call the EXE directly using the C$SYSTEM command and then changed it to use the DLL to execute the EXE. Both ways of calling the EXE give me the same results. I will research your suggestion.

Thanks for your reply!

Jim
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Screen messes up when calling external executable.

Look at synchronous vs. asynchronous


I did a search on this on this forum and in the Docs and did not come up with much. Can you give me more hints or maybe even some example code?

Thanks,
Jim
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Screen messes up when calling external executable.

CSYS-ASYNC is a flag used for C$SYSTEM that causes the command to be executed independently from COBOL. If this flag is not used, then the COBOL program will wait until the command is complete and could cause the display to not refresh.

Of course there could be many other things causing this, so some sample code would be most helpful.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Screen messes up when calling external executable.

Robstan,

I have to wait for the other application to end before control is released back to my program. I am processing payments and I am calling an external credit card proccessing program to process a credit card and must wait for the program to finish to get the results.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Screen messes up when calling external executable.

ROBSTAN,

I took a closer look at what I was doing and used the CSYS-ASYNC flag for my call and then put my program in a loop checking to see if the 3rd party program was still running using the IsXCClientRunning() COM Object and displaying a space to the bottom right corner of my window. I had reported this to Support and they basically told me there was nothing they could do since control was not in the hands of the runtime. I am not fond of putting my program in an infinate loop but that was the only thing I could think of to solve this problem.

Thanks for all your help and GFORSETH as well, Thanks.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Screen messes up when calling external executable.

You could always check for something like a keystroke or a click on a button in your program in case the user needs to stop the infinite loop.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.