If you are trying to define a class in a method, this technique is not permitted. You must define the class external to the form like this:
set procedure to myclassprg.prg additive
this.newobject('myObject','myClass')
...
And you must have an external definition like:
define class myClass as SomeBaseClass
,,,
enddefine
Glenn
>Hi everybody!
>When I run a form and I would like add an object from the class that is defined programmatically with codes following:
>
>DEFINE CLASS oleExcelObject as OLEControl
> OleClass ="Excel.Sheet" && Server name
> DocumentFile = "test.xls" && This file must exist
>ENDDEFINE
>thisform.AddObject("Excel", "oleExcelObject ")
>
>
>I set these codes in init method or another method , I get an error.
>How to add object from define class when the form runtime?
>Please help me.
>Thanks
>Canh