Skip to main content

[archive] How to detect MSCHART.DLL is present

  • September 19, 2007
  • 11 replies
  • 0 views

[Migrated content. Thread originally posted on 19 September 2007]

I have a program that uses active-x control to produce bar charts or graphs and have used code found in this forum (thread titled: GANTT CHART or MS CHART) that can detect if MSCHART.DLL is registered or not. The active-x control I used is mschrt20.ocx. Unfortunately, I cannot get the code to check the presence even though it is registered on the PC. Would anyone know why it is not able to detect it. Thanks.

extracted code:
*for thin-client connection
CALL "@[DISPLAY]:MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "@[DISPLAY]:MSCHART.dll"
END-CALL
*for windows connection
CALL "MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "MSCHART.dll"
END-CALL

11 replies

[Migrated content. Thread originally posted on 19 September 2007]

I have a program that uses active-x control to produce bar charts or graphs and have used code found in this forum (thread titled: GANTT CHART or MS CHART) that can detect if MSCHART.DLL is registered or not. The active-x control I used is mschrt20.ocx. Unfortunately, I cannot get the code to check the presence even though it is registered on the PC. Would anyone know why it is not able to detect it. Thanks.

extracted code:
*for thin-client connection
CALL "@[DISPLAY]:MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "@[DISPLAY]:MSCHART.dll"
END-CALL
*for windows connection
CALL "MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "MSCHART.dll"
END-CALL
Because CALL is detect only whether file is there or not
This can be your solution,

1- Paste this variables in your working-storage
01 activex-var.
02 activex-source PIC x(30).
02 activex-description PIC x(200).
02 activex-help-file PIC x(200).
02 activex-help-context USAGE IS UNSIGNED-LONG.
2- Open your program_name.cbl
3- Add this paragraph on your Declaratives Section
activex-error section.
use after exception on object.
activex-para.
call "c$excepinfo" using
error-info,
activex-source,
activex-description,
activex-help-file,
activex-help-context
end-call

if ACU-E-CLASSNOTREGISTERED
perform regsvr-run
display your_ocx_screenname
else
display some error message or not
end-if
4- add regsvr-run paragraph to your program_name.evt file (Event paragraph in Acubench)
regsvr-run.
if is-remote
call "c$system" using "regsvr32.exe your.ocx" flags ....
else
call "c$system" using "regsvr32.exe your.ocx" flags ....
end-if

some control's -> if command is successfull otherwise goback etc.....

perform Acu-Init-Res.


5- Save all and run it :)

But i don't know how you can do this when you are using 2 or more ocx in 1 form.

[Migrated content. Thread originally posted on 19 September 2007]

I have a program that uses active-x control to produce bar charts or graphs and have used code found in this forum (thread titled: GANTT CHART or MS CHART) that can detect if MSCHART.DLL is registered or not. The active-x control I used is mschrt20.ocx. Unfortunately, I cannot get the code to check the presence even though it is registered on the PC. Would anyone know why it is not able to detect it. Thanks.

extracted code:
*for thin-client connection
CALL "@[DISPLAY]:MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "@[DISPLAY]:MSCHART.dll"
END-CALL
*for windows connection
CALL "MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "MSCHART.dll"
END-CALL
Because CALL is detect only whether file is there or not
This can be your solution,

1- Paste this variables in your working-storage
01 activex-var.
02 activex-source PIC x(30).
02 activex-description PIC x(200).
02 activex-help-file PIC x(200).
02 activex-help-context USAGE IS UNSIGNED-LONG.
2- Open your program_name.cbl
3- Add this paragraph on your Declaratives Section
activex-error section.
use after exception on object.
activex-para.
call "c$excepinfo" using
error-info,
activex-source,
activex-description,
activex-help-file,
activex-help-context
end-call

if ACU-E-CLASSNOTREGISTERED
perform regsvr-run
display your_ocx_screenname
else
display some error message or not
end-if
4- add regsvr-run paragraph to your program_name.evt file (Event paragraph in Acubench)
regsvr-run.
if is-remote
call "c$system" using "regsvr32.exe your.ocx" flags ....
else
call "c$system" using "regsvr32.exe your.ocx" flags ....
end-if

some control's -> if command is successfull otherwise goback etc.....

perform Acu-Init-Res.


5- Save all and run it :)

But i don't know how you can do this when you are using 2 or more ocx in 1 form.

[Migrated content. Thread originally posted on 19 September 2007]

I have a program that uses active-x control to produce bar charts or graphs and have used code found in this forum (thread titled: GANTT CHART or MS CHART) that can detect if MSCHART.DLL is registered or not. The active-x control I used is mschrt20.ocx. Unfortunately, I cannot get the code to check the presence even though it is registered on the PC. Would anyone know why it is not able to detect it. Thanks.

extracted code:
*for thin-client connection
CALL "@[DISPLAY]:MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "@[DISPLAY]:MSCHART.dll"
END-CALL
*for windows connection
CALL "MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "MSCHART.dll"
END-CALL
In more recent versions of the runtime, C$EXEPINFO includes the handle of the object throwing the exception (shown below as ERR-OBJECT-HANDLE). Of course, it may not work on the initial display of the control because you won't have a handle to compare it to, but it would be useful for other types of exceptions.

CALL "C$EXCEPINFO"
USING ERROR-INFO, ERR-SOURCE, ERR-DESCRIPTION,
ERR-HELP-FILE, ERR-HELP-CONTEXT, ERR-OBJECT-HANDLE,
ERR-CONTROL-ID

[Migrated content. Thread originally posted on 19 September 2007]

I have a program that uses active-x control to produce bar charts or graphs and have used code found in this forum (thread titled: GANTT CHART or MS CHART) that can detect if MSCHART.DLL is registered or not. The active-x control I used is mschrt20.ocx. Unfortunately, I cannot get the code to check the presence even though it is registered on the PC. Would anyone know why it is not able to detect it. Thanks.

extracted code:
*for thin-client connection
CALL "@[DISPLAY]:MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "@[DISPLAY]:MSCHART.dll"
END-CALL
*for windows connection
CALL "MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "MSCHART.dll"
END-CALL
In more recent versions of the runtime, C$EXEPINFO includes the handle of the object throwing the exception (shown below as ERR-OBJECT-HANDLE). Of course, it may not work on the initial display of the control because you won't have a handle to compare it to, but it would be useful for other types of exceptions.

CALL "C$EXCEPINFO"
USING ERROR-INFO, ERR-SOURCE, ERR-DESCRIPTION,
ERR-HELP-FILE, ERR-HELP-CONTEXT, ERR-OBJECT-HANDLE,
ERR-CONTROL-ID

[Migrated content. Thread originally posted on 19 September 2007]

I have a program that uses active-x control to produce bar charts or graphs and have used code found in this forum (thread titled: GANTT CHART or MS CHART) that can detect if MSCHART.DLL is registered or not. The active-x control I used is mschrt20.ocx. Unfortunately, I cannot get the code to check the presence even though it is registered on the PC. Would anyone know why it is not able to detect it. Thanks.

extracted code:
*for thin-client connection
CALL "@[DISPLAY]:MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "@[DISPLAY]:MSCHART.dll"
END-CALL
*for windows connection
CALL "MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "MSCHART.dll"
END-CALL
Thanks guys for the info. Never use Declaratives Section a lot but it makes sense to be able to capture and handle exceptional errors in one area. Will try it out.

At the moment the program only use one ocx control, will worry about that later if there is a requirement to use 2 or more ocx controls.

Thanks again.

[Migrated content. Thread originally posted on 19 September 2007]

I have a program that uses active-x control to produce bar charts or graphs and have used code found in this forum (thread titled: GANTT CHART or MS CHART) that can detect if MSCHART.DLL is registered or not. The active-x control I used is mschrt20.ocx. Unfortunately, I cannot get the code to check the presence even though it is registered on the PC. Would anyone know why it is not able to detect it. Thanks.

extracted code:
*for thin-client connection
CALL "@[DISPLAY]:MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "@[DISPLAY]:MSCHART.dll"
END-CALL
*for windows connection
CALL "MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "MSCHART.dll"
END-CALL
Thanks guys for the info. Never use Declaratives Section a lot but it makes sense to be able to capture and handle exceptional errors in one area. Will try it out.

At the moment the program only use one ocx control, will worry about that later if there is a requirement to use 2 or more ocx controls.

Thanks again.

[Migrated content. Thread originally posted on 19 September 2007]

I have a program that uses active-x control to produce bar charts or graphs and have used code found in this forum (thread titled: GANTT CHART or MS CHART) that can detect if MSCHART.DLL is registered or not. The active-x control I used is mschrt20.ocx. Unfortunately, I cannot get the code to check the presence even though it is registered on the PC. Would anyone know why it is not able to detect it. Thanks.

extracted code:
*for thin-client connection
CALL "@[DISPLAY]:MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "@[DISPLAY]:MSCHART.dll"
END-CALL
*for windows connection
CALL "MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "MSCHART.dll"
END-CALL
Thanks guys for the info. Never use Declaratives Section a lot but it makes sense to be able to capture and handle exceptional errors in one area. Will try it out.

At the moment the program only use one ocx control, will worry about that later if there is a requirement to use 2 or more ocx controls.

Thanks again.

[Migrated content. Thread originally posted on 19 September 2007]

I have a program that uses active-x control to produce bar charts or graphs and have used code found in this forum (thread titled: GANTT CHART or MS CHART) that can detect if MSCHART.DLL is registered or not. The active-x control I used is mschrt20.ocx. Unfortunately, I cannot get the code to check the presence even though it is registered on the PC. Would anyone know why it is not able to detect it. Thanks.

extracted code:
*for thin-client connection
CALL "@[DISPLAY]:MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "@[DISPLAY]:MSCHART.dll"
END-CALL
*for windows connection
CALL "MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "MSCHART.dll"
END-CALL
Hi fellow country man!

See my post relating to mschart.dll earlier.

http://www.acucorp.com/support/supported/customer_forum/showthread.php?t=1092

Hope it helps.

Shaun

[Migrated content. Thread originally posted on 19 September 2007]

I have a program that uses active-x control to produce bar charts or graphs and have used code found in this forum (thread titled: GANTT CHART or MS CHART) that can detect if MSCHART.DLL is registered or not. The active-x control I used is mschrt20.ocx. Unfortunately, I cannot get the code to check the presence even though it is registered on the PC. Would anyone know why it is not able to detect it. Thanks.

extracted code:
*for thin-client connection
CALL "@[DISPLAY]:MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "@[DISPLAY]:MSCHART.dll"
END-CALL
*for windows connection
CALL "MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "MSCHART.dll"
END-CALL
Hi fellow country man!

See my post relating to mschart.dll earlier.

http://www.acucorp.com/support/supported/customer_forum/showthread.php?t=1092

Hope it helps.

Shaun

[Migrated content. Thread originally posted on 19 September 2007]

I have a program that uses active-x control to produce bar charts or graphs and have used code found in this forum (thread titled: GANTT CHART or MS CHART) that can detect if MSCHART.DLL is registered or not. The active-x control I used is mschrt20.ocx. Unfortunately, I cannot get the code to check the presence even though it is registered on the PC. Would anyone know why it is not able to detect it. Thanks.

extracted code:
*for thin-client connection
CALL "@[DISPLAY]:MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "@[DISPLAY]:MSCHART.dll"
END-CALL
*for windows connection
CALL "MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "MSCHART.dll"
END-CALL
Hi Shaun, small world.

Yes, I did read your posting and have used your sample code but couldn't get the program to detect presence of MSCHART.DLL. It goes into the exception clause all the time. However, the other bits of coding does work, ie calling "KERNEL32.DLL" and getting system directory works. Will come in very useful for future developments.

Thanks.

[Migrated content. Thread originally posted on 19 September 2007]

I have a program that uses active-x control to produce bar charts or graphs and have used code found in this forum (thread titled: GANTT CHART or MS CHART) that can detect if MSCHART.DLL is registered or not. The active-x control I used is mschrt20.ocx. Unfortunately, I cannot get the code to check the presence even though it is registered on the PC. Would anyone know why it is not able to detect it. Thanks.

extracted code:
*for thin-client connection
CALL "@[DISPLAY]:MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "@[DISPLAY]:MSCHART.dll"
END-CALL
*for windows connection
CALL "MSCHART.dll@WINAPI"
ON EXCEPTION
SET CONTROL-NOT-OK TO TRUE
NOT ON EXCEPTION
SET CONTROL-OK TO TRUE
CANCEL "MSCHART.dll"
END-CALL
Hi Shaun, small world.

Yes, I did read your posting and have used your sample code but couldn't get the program to detect presence of MSCHART.DLL. It goes into the exception clause all the time. However, the other bits of coding does work, ie calling "KERNEL32.DLL" and getting system directory works. Will come in very useful for future developments.

Thanks.