Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OApp - it's all gone horribly wrong
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00086235
Message ID:
00086881
Views:
26
Thanks for your replies. I'm going to change to modeless forms and change to using read events. Time to get brave and get truely oop'ed. It's also been suggested I stop clApp from being a custom class and get it into a container. Much R&D to be done. Sarah :)

>I haven't really played with an oApp, because I don't have much global stuff, but I think that most examples (such as TASTRADE) involving the oApp in controlling forms assume modeless forms, which I think is a more customary design. In general, if you use all modal forms, your oApp and its methods will look very different. I have been advised here to switch to modeless forms. I think I originally did so in order to get menus to work. I seem to remember that my forms became easier to control when I did so.
>
>>Hi, Sarah. I had a rocky time getting my app object working, too, but it finally is and was worth the pain :-). I have some questions though about your posting.
>>
>>Does OnStart.prg do a form?
>>
>>When the form releases, it sets the oApp.NextTask to a form name? If so, in which method?
>>
>>Are your forms SCXs or classes? If classes, where do you createObject?
>>
>>Is DO (oApp.NextTask) a prg? or a form? I assume prg...Your syntax works for me for forms...i.e. DO FORM (CFORM)
>>
>>At what line/method do you get the error about instantiating the class? From your example, the only class I see is clApp...
>>
>>
>>>My app is a series of modal forms which are released when another form is called. My main program pretty much looks like this:
>>>
>>>set classlib to 'bkclass'
>>>oApp = createobject('clApp')
>>>DO onstart &&other procedures for startup, separate program file
>>>DO WHILE oApp.NextTask != 'QUIT'
>>> m.lctask = oApp.NextTask
>>> *do (oApp.NextTask) && how to use macro substitution here?
>>> suspend
>>> &lctask
>>>ENDDO
>>>
>>>I just discovered oApp and that's the only change I've made to my program. I tested each bit I added to my custom class by going into my initial form and they are all fine - UNTIL I try to move from that form to another form. Then I get an error instantiating object. last time I got this I had a typo lurking but I can't find any. For a while yesterday the problem was intermittent but couldn't find what changed!
>>
>>...snip
Sarah King
pcpropertymanager.com
Previous
Reply
Map
View

Click here to load this message in the networking platform