Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with VFPCOM.DLL utility
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00296470
Message ID:
00296544
Views:
23
>I am creating classes to work with ADO(soon it will publish them.). Use VFPCOM.DLL to be able to catch the events that ADO fire, until here there is no problem until drop the class in a form, and it is not possible to close it without emitting CLEAR ALL...
>

This is a simple test that load a form with a 'Exit' button and a class that instantiate a vfpcom.comutil object. This work without problem.
Is your code similar to this?
*-- Code start
PUBLIC oform

oform=CreateObject("Testform")
oform.Show
Read Events

RETURN
*--
DEFINE CLASS Testform AS form
  Caption = "TestForm"
  Name = "TestForm"

  ADD OBJECT ExitForm AS commandbutton WITH ;
    Top = 10, ;
    Left = 10, ;
    Height = 30, ;
    Width = 75, ;
    Caption = "Exit", ;
    Name = "ExitForm"

  ADD OBJECT myclass1 AS myclass WITH ;
    Name = "Myclass1"

  PROCEDURE ExitForm.Click
    Release Thisform
      Clear Events
  ENDPROC

ENDDEFINE
*--
DEFINE CLASS myclass AS custom
  ovfpcom = .NULL.
  ors = .NULL.
  orsclass = .NULL.
  Name = "myclass"

  PROCEDURE Destroy
    this.ovfpcom.UnBindEvents(this.oRS, this.orsclass)
    this.oRS = .NULL.
    this.orsclass = .NULL.
    this.ovfpcom = .NULL.
  ENDPROC

  PROCEDURE Init
    this.ovfpcom = CreateObject("vfpcom.comutil")
    this.orsclass = CreateObject("RecorsetClass")
    this.oRS = CreateObject("ADODB.Recordset")
    this.ovfpcom.BindEvents(this.oRS, this.orsclass)
  ENDPROC

ENDDEFINE
*--
DEFINE CLASS recorsetclass AS custom
  Name = "recorsetclass"

ENDDEFINE
*--
*-- Code end

Just an opinion... Not a fact.
Previous
Reply
Map
View

Click here to load this message in the networking platform