OLE Objects in a wizard.
Paul Stemper -- tardis@goldengate.net
Monday, April 08, 1996
Environment: Win95 VC 4.1
Has anyone tried to create an OLE object in a property page? My app reads
data from an Excel file (using OLE Automation) and then presents it to the
user so they can pick ranges of data. I am doing all of this in a wizard
(i.e property page). What I want to do, is insert an OLE object (the Excel
sheet), and then let the user highlight the data they want. When they
click the Next button, I will use automation on the object to read the data
they selected.
I can insert the Excel object into a COleDocument class without a problem,
but I am having a problem doing the same for a Property Page (since it is
not derived from COleDocument, I am not surprised..)
Has anyone done anything like this before?
Thanks.
Paul Stemper
tardis@goldengate.net
David W. Gillett -- DGILLETT@expertedge.com
Wednesday, April 10, 1996
> Environment: Win95 VC 4.1
>
> Has anyone tried to create an OLE object in a property page? My
> app reads data from an Excel file (using OLE Automation) and then
> presents it to the user so they can pick ranges of data. I am
> doing all of this in a wizard (i.e property page). What I want to
> do, is insert an OLE object (the Excel sheet), and then let the
> user highlight the data they want. When they click the Next
> button, I will use automation on the object to read the data they
> selected.
>
> I can insert the Excel object into a COleDocument class without a
> problem, but I am having a problem doing the same for a Property
> Page (since it is not derived from COleDocument, I am not
> surprised..)
>
> Has anyone done anything like this before?
A property page shouldn't be a document, but it might sensibly be a
view in a case like this. Ideally, you'd like a CPropertyPage
variant that inherited from CDialogView rather than from CDialog, a
CPropertyPageView.
One of the problems with making that kind of class, though, is that
a CView expects to be the client of a CFrame, and there's no obvious
CFrame that a CPropertyPage is client to. You should, however, be
able to create a CFrame-derived child window on a CPropertyPage
(creating and positioning it at run-time; you probably want your own
derived class for this) and fill it with a CView-derivative bound to a
COleDocument containing the Excel sheet OLE object. (Whew!)
Dave
| Вернуться в корень Архива
|