Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OleMonthView disabling my exit button
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00533264
Message ID:
00536902
Views:
9
Mike,

A form or any other object cannot be released if there are still any active refereces to it. See http://www.geocities.com/ResearchTriangle/9834/qoop017.htm for detailed explanation.
I think that your user defined property of Form_Calendar that tells oleCalendar where to put the date is such reference to Form_App or object on it. Cleare it before you exit Form_Calendar and it should fix your problem.



>We have an application where its necessary to enter in dates. In an issue of FoxPro Advisor (nov 2000) we learned of an easy way to make a pop up calendar using activeX. It is the first time I've used ActiveX but I managed to get the calendar to work. As customers can be lazy, I wanted to allow for the popup calendar to exit (this.parent.release) when they clicked off of the calendar (lostfocus event) or when they hit the escape key. In FPA nov 2000, Mark Miller handles all this save for the fact that the oleMonthView (renamed oleCalendar) is made into a class and another class (a modified command button) is used to initalize and call the oleCalendar. Problem is this class is modal, and thus one can't click off and invoke the LostFocus event.
>
>We tried to change the property of show(1) to show(2) but that didn't work. Finally, I came to the conclusion that being a class was causing it to act funny, so I just kept the oleCalendar as a form. Everything worked fine except, when I went to close the oleCalendar (either through exiting or inputting the date) I could no longer close the form that had called the oleCalendar.
>
>Form_App has a cmd button that when clicked opens up a Form_Calendar (which is invis but has oleCalendar on it). oleCalendar is modeless, and has a keystroke even that accepts the esc key to exit or the enter key to input the current date selected into the text control oleCalendar is linked to (user defined property tells oleCalendar where to put the date). Additionally, as its modeless when it goes out of focus, it is set to exit. After being called and Form_Calendar is closed, Form_App will not exit. I have a cmdbutton that should exit from Form_App and this button worked before I call Form_Calendar, but not afterwards. I have other forms on Form_App and no problems with them, which leads me to think that this is an ActiveX based problem.
>
>Anyone know of possible reasons that as to why Form_App's exit cmd button doesn't want to work after form_calendar (containing an oleMonthView activeX control)?
>
>Form_App's exit button is part of a class and its actives on a click event and executes the following:
>
>* --
>* Tool_Close
>* --
>if tool::OkToMove()
> * --
> if thisform.Local_Close
> _screen.ActiveForm.Close()
> endif
> * --
> * --
> flush
> _screen.ActiveForm.release()
> * --
>endif
>* --
>
>when oleCalendar exits it uses this.parent.release() to close Form_Calendar (and in doing so itself...)
>
>Any help?
>
>matt
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform