Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX control subclass problem??? 1

Status
Not open for further replies.

wigwug

Programmer
Feb 13, 2005
35
US
I have a container class with an activex control along with some native foxpro controls. The activex control is the DBI grid control. When I add the container control to a form and attempt to change properties of the grid and native controls the properties for the grid are lost when I save the form? The native VFP controls keep the changed formatting but the grid goes back to the original setup in the class library. What the $%#* am I doing wrong?

Thanks
 
This is one of the most unintuitive things about inheritence in Fox. Drew Speedie wrote about this in the February 1998 issue of FoxPro Advisor. The article was titled "Dangers of Composite Classes in Development" I couldn't find the article on line. I am afraid it is too old, but it is well worth a read or two. I had to read it a half dozen times before I got it.

Basically, when you put a control in a container or on a form you are creating an instance, not a subclass. When you load up your form in the designer, VFP goes to the place where the container with the activeX control is defined and loads a fresh instance. You will either have to make your changes in the container class itself or make them in code in your form at runtime.

pamela
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top