Skip to main content

[archive] C$RUN - Cancel?

  • October 24, 2007
  • 35 replies
  • 0 views

Show first post

35 replies

[Migrated content. Thread originally posted on 24 October 2007]

We are starting non-acu applications using the C$RUN using "appl.exe -options". I would like to use the same control in my acu program to close the application as I did to start it. However, my attempts to destroy the thread and cancel C$RUN have not worked.

If anyone has any ideas, I would appreciate it. If you need more details, I can provide it.

thanks, Mike :confused:
I like the idea of using an alias for all our common windows dll calls. Thanks!

Has anyone used the mountfocus on screen keyboard via a com call? http://www.virtual-keyboard.com/index.html

We are doing touch screen coding and the issue I am having is being able to start a keyboard in a manner than I can use a button on my page to close that keyboard when hit. I have it working using an ASYNC call of C$SYSTEM to start the .exe with my .kbd file but am not having any luck making the COM call. I did generate a .def file using axdefgen.exe, but it does not seem to work right, though the .def looks great. I have been emailing the support at mountfocus, but they do not know how to work with Acu. I have attached the .def file.

One of the big issues I'm having is calling the DLL. I don't want to move it from the istallation location, but when I try to call
call "@[DISPLAY]:C:\\Program Files\\MountFocus\\Keyboard\\Kbd.dll"

Program Files is changed to ProgramFiles in the message stating the dll can't be found.

Just to see if it helps, my contact at mountfocus noted the following things:

1) "Regarding AcuCobol I took a look at their website, and according to the specifications you should be able to control a COM object from an AcuCobol program. The name of the Runtime Keyboard COM server is ?Kbd.mfSoftkeys? (without the quotes)." I am not sure how I can call or start a com server.

2) When I tried going directly to the dll, I got this response... "The Kbd.dll is an ActiveX, but please note that it is only a proxy for the actual COM server (out of process) that is implemented in Kbd.exe. So, Kbd.exe is needed for Kbd.dll to work ? but not the other way around. In most cases I recommend instantiating the COM server directly without using the ActiveX proxy." I have asked for sample C or VB code that makes this call, but I do not have it yet.

Thanks to everyone for the help so far. I have a partial solution, I'm just hoping to find a better way to control the start and stop of this external keyboard.

[Migrated content. Thread originally posted on 24 October 2007]

We are starting non-acu applications using the C$RUN using "appl.exe -options". I would like to use the same control in my acu program to close the application as I did to start it. However, my attempts to destroy the thread and cancel C$RUN have not worked.

If anyone has any ideas, I would appreciate it. If you need more details, I can provide it.

thanks, Mike :confused:
It is significant to distinguish the COM and ActiveX versions. This because depending on whether you do the one or the other, there are two ways to create the def file and there are two ways to create the object.
I agree that there is no reason to use an ActiveX front end if you can deal with the COM object directly.
Then you should create the def file from the Library tab of the AxDefGen.
When it is a COM object, you instantiate the object using the CREATE verb, not DISPLAY.
Finally, when using COM (or ActiveX for that matter), you are not supposed to deal with any DLLs. No CALL at all, except if you want to do the installation and activation from within Acu.
You should defintely get a COM example in vb or C from them, going to save you lots of work.
If you have not done this before, you should nevertheless consider taking a training.

[Migrated content. Thread originally posted on 24 October 2007]

We are starting non-acu applications using the C$RUN using "appl.exe -options". I would like to use the same control in my acu program to close the application as I did to start it. However, my attempts to destroy the thread and cancel C$RUN have not worked.

If anyone has any ideas, I would appreciate it. If you need more details, I can provide it.

thanks, Mike :confused:
It is significant to distinguish the COM and ActiveX versions. This because depending on whether you do the one or the other, there are two ways to create the def file and there are two ways to create the object.
I agree that there is no reason to use an ActiveX front end if you can deal with the COM object directly.
Then you should create the def file from the Library tab of the AxDefGen.
When it is a COM object, you instantiate the object using the CREATE verb, not DISPLAY.
Finally, when using COM (or ActiveX for that matter), you are not supposed to deal with any DLLs. No CALL at all, except if you want to do the installation and activation from within Acu.
You should defintely get a COM example in vb or C from them, going to save you lots of work.
If you have not done this before, you should nevertheless consider taking a training.

[Migrated content. Thread originally posted on 24 October 2007]

We are starting non-acu applications using the C$RUN using "appl.exe -options". I would like to use the same control in my acu program to close the application as I did to start it. However, my attempts to destroy the thread and cancel C$RUN have not worked.

If anyone has any ideas, I would appreciate it. If you need more details, I can provide it.

thanks, Mike :confused:
For the CODE-PREFIX problem I was also having the same issue running 6.1.1 runtime. But only when I attemted to execute my code from the acubench. I simply went to Project - Settings - Environment - and added C:\\Windows\\System32 to the CODE-PREFIX here. This solved that problem, and I never had the problem executing my programs outside of acubench from their own icon.

[Migrated content. Thread originally posted on 24 October 2007]

We are starting non-acu applications using the C$RUN using "appl.exe -options". I would like to use the same control in my acu program to close the application as I did to start it. However, my attempts to destroy the thread and cancel C$RUN have not worked.

If anyone has any ideas, I would appreciate it. If you need more details, I can provide it.

thanks, Mike :confused:
For the CODE-PREFIX problem I was also having the same issue running 6.1.1 runtime. But only when I attemted to execute my code from the acubench. I simply went to Project - Settings - Environment - and added C:\\Windows\\System32 to the CODE-PREFIX here. This solved that problem, and I never had the problem executing my programs outside of acubench from their own icon.

[Migrated content. Thread originally posted on 24 October 2007]

We are starting non-acu applications using the C$RUN using "appl.exe -options". I would like to use the same control in my acu program to close the application as I did to start it. However, my attempts to destroy the thread and cancel C$RUN have not worked.

If anyone has any ideas, I would appreciate it. If you need more details, I can provide it.

thanks, Mike :confused:
For the CODE-PREFIX problem I was also having the same issue running 6.1.1 runtime. But only when I attemted to execute my code from the acubench. I simply went to Project - Settings - Environment - and added C:\\Windows\\System32 to the CODE-PREFIX here. This solved that problem, and I never had the problem executing my programs outside of acubench from their own icon.

[Migrated content. Thread originally posted on 24 October 2007]

We are starting non-acu applications using the C$RUN using "appl.exe -options". I would like to use the same control in my acu program to close the application as I did to start it. However, my attempts to destroy the thread and cancel C$RUN have not worked.

If anyone has any ideas, I would appreciate it. If you need more details, I can provide it.

thanks, Mike :confused:
Regarding the CODE-PREFIX issue.

When you run your code externally to acubench, you must be using a config file (using -c on the command prompt)

So, in acubench go to project settings and go into the Runtime Tab
Tick Alternative Configuration filename and point it to the path of your config file.

[Migrated content. Thread originally posted on 24 October 2007]

We are starting non-acu applications using the C$RUN using "appl.exe -options". I would like to use the same control in my acu program to close the application as I did to start it. However, my attempts to destroy the thread and cancel C$RUN have not worked.

If anyone has any ideas, I would appreciate it. If you need more details, I can provide it.

thanks, Mike :confused:
Regarding the CODE-PREFIX issue.

When you run your code externally to acubench, you must be using a config file (using -c on the command prompt)

So, in acubench go to project settings and go into the Runtime Tab
Tick Alternative Configuration filename and point it to the path of your config file.

[Migrated content. Thread originally posted on 24 October 2007]

We are starting non-acu applications using the C$RUN using "appl.exe -options". I would like to use the same control in my acu program to close the application as I did to start it. However, my attempts to destroy the thread and cancel C$RUN have not worked.

If anyone has any ideas, I would appreciate it. If you need more details, I can provide it.

thanks, Mike :confused:
Thanks to everyone for your help. I was finally able to create the com working, but did end up using the Active X control. This was nice becuase then Acu loaded a .def it created as well as an obvious required .def file, acuclass, which might have been much of my problem all along. I thought I'd share will all my solution. If anything it might help some or get suggestions for me on how to improve this...

(again, using the on screen keyboard as noted from the company above)...

Load the active x control from the active x control components list and place on your screen. Add the following code snipits...

* generated by Acu... (only special names is generated)
SPECIAL-NAMES.
*{Bench}activex-def
COPY "mfSoftkeysControl.def".
COPY "Acuclass.Def".
.
*{Bench}end

* only ws fields needed for my example are included...
05 kbd-position pic x(4) comp-n.
05 kbd-active-yn pic x value "N".

SCREEN SECTION.
01 test-screen.
03 kbd-screen, mfSoftkeysControl,
COL 1.00, LINE 1.00, LINES 1.00, SIZE 1.00.

* 1 time in procedure division... I call in my after initdata procedure
move 5 to kbd-position.

display kbd-screen
modify gasctng-kbd
LoadKeyboard("c:\\ssoft800.kbd")
Hide()
Position(kbd-position).

* attach this to your control (mine flips flag on button push)
if kbd-active-yn = "N"
modify gasctng-kbd Show()
move "Y" to kbd-active-yn
else
modify gasctng-kbd Hide()
move "N" to kbd-active-yn.

Any suggestions are welcome...

thanks, Mike

[Migrated content. Thread originally posted on 24 October 2007]

We are starting non-acu applications using the C$RUN using "appl.exe -options". I would like to use the same control in my acu program to close the application as I did to start it. However, my attempts to destroy the thread and cancel C$RUN have not worked.

If anyone has any ideas, I would appreciate it. If you need more details, I can provide it.

thanks, Mike :confused:
Thanks to everyone for your help. I was finally able to create the com working, but did end up using the Active X control. This was nice becuase then Acu loaded a .def it created as well as an obvious required .def file, acuclass, which might have been much of my problem all along. I thought I'd share will all my solution. If anything it might help some or get suggestions for me on how to improve this...

(again, using the on screen keyboard as noted from the company above)...

Load the active x control from the active x control components list and place on your screen. Add the following code snipits...

* generated by Acu... (only special names is generated)
SPECIAL-NAMES.
*{Bench}activex-def
COPY "mfSoftkeysControl.def".
COPY "Acuclass.Def".
.
*{Bench}end

* only ws fields needed for my example are included...
05 kbd-position pic x(4) comp-n.
05 kbd-active-yn pic x value "N".

SCREEN SECTION.
01 test-screen.
03 kbd-screen, mfSoftkeysControl,
COL 1.00, LINE 1.00, LINES 1.00, SIZE 1.00.

* 1 time in procedure division... I call in my after initdata procedure
move 5 to kbd-position.

display kbd-screen
modify gasctng-kbd
LoadKeyboard("c:\\ssoft800.kbd")
Hide()
Position(kbd-position).

* attach this to your control (mine flips flag on button push)
if kbd-active-yn = "N"
modify gasctng-kbd Show()
move "Y" to kbd-active-yn
else
modify gasctng-kbd Hide()
move "N" to kbd-active-yn.

Any suggestions are welcome...

thanks, Mike