Skip to main content

[archive] Screen messes up when calling external executable.

  • January 16, 2008
  • 16 replies
  • 0 views

[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

16 replies

[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
Some example code (small) to reproduce is generally a good idea.

[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
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.

[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
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.

[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
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.

[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
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.

[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
How are you calling the EXE? Look at synchronous vs. asynchronous. That's probably it.

[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
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

[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
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

[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
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

[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
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

[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
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.

[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
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.

[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
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.

[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
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.

[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
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.

[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
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.