Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB Ocx and VFP Events.
Message
From
20/05/1999 11:50:08
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
VB Ocx and VFP Events.
Miscellaneous
Thread ID:
00220882
Message ID:
00220882
Views:
55
I am having a serious problem and I'm sure there is a simple solution to it. My problem stems from the fact that foxpro has no native controls that will let me bind ado recordsets. I am resigned to creating ocxs in vb and using foxpro as a container for these ocxs.

My problem is this:

I have an ocx that consists of a vb datalist control. When the user selects an item in the listbox, I need a local vfp event to fire. I tried creating a custom event in vb that I call from the datalist_clickevent. I then override this custom event in vfp but
the code never gets called.

Since this would not work, I tried something different. I created a custom public property on the vb ocx called parentform. I assigned this property to be the thisform vfp object. In the datalist_clickevent i put code that looks something like this:

me.parentform.dosomthing()

This WORKS!!!!!!!!!!!!!!!!!
Happy Happy Joy Joy!!!! Life is great!!!!!!!!!

Well, almost great...
Now when I release the form, the classlib will not release from memory. Even if I issue a clear class all or set classlib to command.
Somehow the vb ocx is still storing a reference to my now unloaded form. This does not make sense because the ole container is no longer in memory. How could the contained ocx be in memory?
I even issued a SET me.parentform = nothing in the vb code before I unloaded the ocx.


If only vfp could natively bind ado recoredsets!
Life would be so much simpler!

Any help is greatly appreciated
Thanks,
Dave Mihalik
dmihalik@stansleygroup.com
Next
Reply
Map
View

Click here to load this message in the networking platform