Hi,
Thank a lot for your advise.
I actually use the visual class designer to do it. But I still
encountered problem in using the class. Please advise and help
as I am green in this area.
I created a class name test with 02 method like opendevice and closedevice,
subclass from form.
On the form of my class, I placed 02 ActiveX control, giving name of
oleInput and oleOutput. The oleinput and oleoutput had their own methods
and properties like opendevice and closedevice
So, on my class form, I add the following code in my class form method
as show below
Test.OpenDevice Method PROCEDURE
WITH THIS.PARENT
.oleInput.OpenDevice
.oleOutput.OpenDeice
ENDWITH
ENDPROC
On my application, with a form and a command button, I had the following code
PUBLIC odevice = CREATEOBJECT('test')
Exit.Click Procedure
test.OpenDevice()
EndProc
On clicking the button, it give error of 'PARENT is not a object'.
I am confused, what is wrong, please advise and help. Thank a lot
>>Hi,
>>
>>I like to learn more about creating class library for my application use.
>>However, I often encountered the problems of not know whether which
>>control especially ActiveX which I am using can be sub-class from.
>>
>>For example, I am creating a new class, to include a timer and 02 ActiveX
>>controls, since it can simplify my coding. However, I do not
>>know to sub-class from form, custom or control ? Please advise
>>and help. Thank you
>
>Virusim,
>I do like this :
>Create a test form and put controls on it.
>Add code to controls till I get the effect I want and add some form props-methods as necessary.
>In controls' code instead of saying thisform I say this.parent (or this.parent.parent) and use with...endwith to possible extent.
>When I'm satisfied with behaviour I select the controls and Saveasclass (selected controls). This creates a 'container' based class.
>I modify the saved class to copy&paste properties-methods formerly added to the form (either visually or by hacking the .vcx).
>
>Last step sounds to be cumbersome but since it reduces testing phase (as a form) it's something I can live with (IMHO better than directly creating container and adding it to form for testing).
>
>As another final step I put the class to a new test form and test.
>Cetin
Best Regards
Virusim