Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to subclass an OCX control?
Message
From
08/06/2004 16:12:20
 
 
To
08/06/2004 14:51:27
Larry Long
ProgRes (Programming Resources)
Georgia, United States
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00911164
Message ID:
00911362
Views:
21
Look the VFP8 Help File, DEFINE CLASS there example
   PUBLIC frmOLETest
   frmOLETest = CREATEOBJECT('Form')
   frmOLETest.Visible = .T.
   
   frmOLETest.ADDOBJECT('OCXTest', 'BlueOLEControl', ;
      'MSOutl.Outline')
   frmOLETest.OCXTest.AddItem('Item One')
   frmOLETest.OCXTest.AddItem('Item Two')
   
   DEFINE CLASS BlueOLEControl AS OLEControl
   
      * Set a property of the ActiveX control
      .Object.Backcolor = 16776960
      
      * Set properties of the OLE Container Control
      Visible = .T.
      Height = 100
      Width = 200
   ENDDEFINE
>When I use mscomctllib.listviewctrl.2 (per your example) it does the same thing.
>
>Can you verify?
>
>This is what I have
>
>*AMADDON.PRG
>DEFINE CLASS myListView as olecontrol
> OleClass = 'mscomctllib.listviewctrl.2'
>ENDDEFINE
>
>Create a form and drop a command button on it.
>In the click method, I have
>
>thisform.NewObject('test','myListView','amaddon.fxp')
>
>
>>DId you verify OleClass value for this control?
>>
>>>When I issue "this.NewObject('objectname','classname','procname')" in the form's init, the Activex dialog pops up prompting me to select a control.
>>>
>>>Any idea as to what is happening?
>>>
>>>>
>>>>What error do you get? Try to drop ActiveX on a form and read OLECLASS property.
>>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform