Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object References
Message
From
18/10/1997 21:10:23
 
 
To
17/10/1997 09:52:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00054889
Message ID:
00055303
Views:
27
>Hi Greg,
>
>I too am using Codebook. I started out by simply dropping ctextboxes on a cToolBar and found out that the text boxes were not able to receive focus properly. You could tab (or click) thru them when they first came up, but then you could not back tab (or click) to get back into them once they had lost focus. So, after posting this problem and much debate. I finally took a suggestion from Jim Booth to add code to the textbox controls that will basically force them to receive focus. I then discovered that in order to accomplish this, each control would need references to the 'next' and 'prev' object on the toolbar (or in the container). So....I added code to the container (which held the textboxes and was then dropped onto the ctoolbar) that would store references to all objects it contained and then set the 'onext' and 'oprev' property on each control. I added code to the Destroy method of the textboxes to set it's oNext and oPrev property to .NULL. I also added code to the Destroy
>method of the container to set the array to .F. (Whew.....)
>
>If I missed something somewhere and the Codebook toolbar class is able to handle this, I would be greatly relieved.

I see your textbox needs in the toolbar weremuch greater than mine. I didn't have a reason to worry about focus at all. One thing I'm learning with codebook is to always call an objects release method first. Then set the properties to storing the object to .NULL. It seems you're dealing with three of the worse codebook and VFP features. SetFocus(), toolbars, and GPF's from ill-referenced pointers.
I'll think about it a little bit more and if I come up with something I'll make sure and write it up here.

BTW, have you figured out a robust error handler for keeping users from getting locked up by GOAPP not found messages? For me, certain conditions make it so it is virtually impossible to get a user out of a blown up VFP application; particularly when using codebook. Table update conflicts, GOAPP not found, and object reference errors almost always keep an application from exiting. I finally made a button that makes a call to a WIN32 API that will shut down the application at the windows level. At least this keeps them from having to ctrl-alt-delete. I wish VFP had a funtion like KILLAPP() that would just close out everything no matter what. Maybe we can share some ideas on this.
Previous
Reply
Map
View

Click here to load this message in the networking platform