Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I create a new VCX of subclasses programatically
Message
From
06/10/1998 15:41:09
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
04/10/1998 16:32:23
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00142974
Message ID:
00144343
Views:
34
>>>x=createobject("yourclass")
>>>x.saveasclass("classname","classlib")
>>>release x
>>
>>That almost works. The problem is that the INIT event fires for the class. It seems to me I remember there being some way to create an object WITHOUT firing the INIT event. You wouldn't happen to know how to do that, would you?
>
>This seems contradictory to the purpose of CREATEOBJECT... init is any object's constructor event. If it doesn't run, the object isn't created. Why don't you want the init to run? If the init performs something that you don't want done, modify the class to accept .F. as a parameter and if this parameter is passed, bypass the behavior you don't want.

I've developed a healthy habit of reading the replies first and then answering the original question - else I would have said the same :). Though, I had this problem only a few times, and I think I solved it by deciding if the thingy instantiates in runtime or in development - but the principle is the same.

Now I had to rollback to remember what did I do when I had that problem. I think I've done the thing's Init in a way which doesn't do any harm while instantiating at development time. A bit defensive where it maybe needn't be, but saved me some nerves later.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform