15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


putting a CGridCtrl in a static CSplitterWnd

Danny Lauwers -- dlauwers@innet.be
Monday, July 08, 1996

NT4.0b2 / VC++4.1 / MFC4

Hello,

I am trying to put a CGridCtrl table object into my first pane of my static
CSplitterWnd class. I can create a CSplitter with createstatic that has to
panes (1,2) and can create two CWnd objects in pane 0 (0,0) and pane 1 (0,1). 
The splitter displays these empty CWnd objects, and the splitter works. 

When I then want to replace the CWnd in the CreateView with a CGridCtrl
(Microsoft Grid object included with the ad component OLE) I get an ASSERT
when the CreateView is checking DlgCtrlID and the PanID on almost the last
line of code. (internal code MFC).

I then tried to just make the first pane a CWnd and gave this pointer as
parent parameter for the create of my CGridCtrl object. So the object is
create outside of the createview process but by saying that the parent is
the first pane CWnd, it (seems) to have te same effect that the table is
living in the first pane. ofcourse I have an extra CWnd object. I don't know
if I could subclass things here ??

Is there some extra initialisation I must do before I directly can include a
CGridCtrl or other OCX Object in a CSplitterWnd pane. Or do I always have to
make an extra CWnd as parent ?

I have read the Knowledge base Q151032 SAMPLE Gensplit: Putting a generic
CWnd in a Splitter, and the Technote 29 of CSplitterWnd but I think there is
something else atwork here!!!

Any Idea's
Thanks
Danny Lauwers



==========================================================
Ing. Danny Lauwers (dlauwers@innet.be)
Intersoft Electronics
Lammerdries 27
2250 Olen Belgium Europe
Tel: +32 14 231811
Fax: +32 14 231944
----------------------------------------------------------
 Radar verification Hard- & software
 Fotofinish and timing of sportevents
 Footscan applications
 and more ...
==========================================================




Alberto Massari -- alby@belva.laboratorium.dist.unige.it
Monday, July 15, 1996

At 21.52 08/07/96 +0200, you wrote:
>I am trying to put a CGridCtrl table object into my first pane of my static
>CSplitterWnd class. I can create a CSplitter with createstatic that has to
>panes (1,2) and can create two CWnd objects in pane 0 (0,0) and pane 1 (0,1). 
>The splitter displays these empty CWnd objects, and the splitter works. 
>
>When I then want to replace the CWnd in the CreateView with a CGridCtrl
>(Microsoft Grid object included with the ad component OLE) I get an ASSERT
>when the CreateView is checking DlgCtrlID and the PanID on almost the last
>line of code. (internal code MFC).

I had the same problem when creating an OLE server with a multisplitter
document. So I had to redefine some MFC methods because they have hardcoded
the value AFX_IDW_PANE_FIRST in some OLE functions. I had to derive my own
OLE class to use a particular value given by CSplitterWnd::IdFromRowCol.

        Alberto
-----------------------------------------------------------------------
Alby@MusArt.dist.unige.it is: 	Alberto Massari

Computer Music Lab
Universy of Genoa	-ITALY-     http://MusArt.dist.unige.it/~alby/
-----------------------------------------------------------------------





| Вернуться в корень Архива |