lucian81
Programmer
- Feb 11, 2008
- 14
Hello,
I want to test when my application starts, if an OCX file is registered. The OCX I am talking about is mschrt20.ocx. I embedded the control in a class (I attached this class), and tried to check is the OCX is registered using the following code:
SET CLASSLIB TO pcAppPath+'Libs\Charts\charttest.vcx' ADDITIVE
STORE .T. TO lChrtOK
TRY
loTest=CREATEOBJECT('MSChart20Lib.MSChart.2')
CATCH
STORE .F. TO lChrtOK
ENDTRY
The problem is that this code returns .F. and the application works just fine, using the OCX file. Why is this happening?
Thank you very much.
All best,
Lucian
I want to test when my application starts, if an OCX file is registered. The OCX I am talking about is mschrt20.ocx. I embedded the control in a class (I attached this class), and tried to check is the OCX is registered using the following code:
SET CLASSLIB TO pcAppPath+'Libs\Charts\charttest.vcx' ADDITIVE
STORE .T. TO lChrtOK
TRY
loTest=CREATEOBJECT('MSChart20Lib.MSChart.2')
CATCH
STORE .F. TO lChrtOK
ENDTRY
The problem is that this code returns .F. and the application works just fine, using the OCX file. Why is this happening?
Thank you very much.
All best,
Lucian