Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programatically subclassing OleControl class...
Message
From
29/05/1998 19:57:02
Ryan Hirschey
Federal Reserve Bank of New York
New York City, New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00102736
Message ID:
00103281
Views:
32
>>Not an answer, but a suggestion. Next time you do this in the form designer why not save it as a class, open it (or the form for that matter) in the class browser and see the code that would create that form with the ole control added.
>
>Hey Dore,
>
>I see we think alike, that's the first thing I tried (just opening up the form). It wasn't much help though. I saw where fox was setting up the normal properties (Top, Left, Width, Height) but beyond that there were just some columns in the form called Ole and Ole2. I can't seem to find a reference to them in the online docs or the Developers Guide so i'm kinda stuck.
>
>Thanks for looking out for me though :)
>
>-- Dave

As far as I can tell, Ole2 is used to specify the location and name of the ole control. I'm guessing because the data in the memo field looks encrypted, but Ole looks like it might hold the property values that can be set in the ole control's property page.

According to VFP docs, you can set something called the oleclass property when you programmatically create an ole control:

oleclass
Returns the named class ID of an OLE object. Read-only at design time and run time for an existing object, but can be set for an object when creating it.
Syntax
Control.OLEClass[ = cName]

Settings

cName The named class ID of the object. This is the registered name of the application that was used to create the object or will be invoked if the object is activated.

Remarks

You set OLEClass property of an OLE container object using the Insert Object dialog box when you initially add an OLE container to a form, or in code when creating an OLE object as part of a class definition. This property is also set when you create OLE objects using the APPEND GENERAL command.
The OLEClass property of an object specifies the application that is used to create or edit the OLE object. To specify the actual contents of the object, set its DocumentFile property.

OLEClass Property Example

The following example adds an OLE Container control to a form, and uses the OleClass and DocumentFile properties to specify Excel as the OLE server and an Excel worksheet as the file to edit.

Define class foo as form
add object oleXLSheet1 as oleXLSheet
EndDefine

Define class oleXLSheet as OLECONTROL
oleclass = "Excel.Sheet"
documentfile="C:\msoffice\Excel\mysheet.xls"
oletypeallowed = 1 && Embedded
EndDefine

Applies To
OLE Bound Control, OLE Container Control
Ryan Hirschey
Previous
Reply
Map
View

Click here to load this message in the networking platform