Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Forms to work like ActiveX Controls
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00886615
Message ID:
00887001
Views:
13
Russell,

You need to make your form top-level by setting the forms ShowWindow property to 2 and you also need to issue a READ EVENTS so that the form responds to events.
DEFINE CLASS MyAuto AS CUSTOM OLEPUBLIC
FirstName = "Russell"

PROCEDURE MyForm
oForm = CREATEOBJECT("testform")
oForm.Caption = "My Automation Server"
oForm.Visible = .T.

*!* >> Start event processing <<
READ EVENTS

RETURN "Form " + oForm.Caption && This works. ie form is still active.
ENDPROC 

ENDDEFINE 


define Class testform as Form

ShowWindow = 2

   add object cmdClose AS commandbutton WITH ;
      Top      = 213, ;
      Left     = 283, ;
      Height   = 27,  ;
      Width    = 84,  ;
      FontName = "Tahoma", ;
      FontSize = 8, ;
      Caption  = "\<Close", ;
      Name     = "cmdClose"


   procedure cmdClose.Click

      *!*
      *!* StartMode->2 = VFP started as an out-of-process EXE
      *!*                automation server.
      *!*
      wait window _VFP.StartMode

      CLEAR EVENTS
	
   endproc 

enddefine
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform