如何在MFC CSplitterWnd中显示两个OLEControl [英] How do I display two OLEControls in a MFC CSplitterWnd

查看:221
本文介绍了如何在MFC CSplitterWnd中显示两个OLEControl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个人早上好,



rigth现在我正在开展一个项目,我必须使用GDPicture来显示图像。

这个GDP图片库包括一些olecontrols为我做这件事,现在它很简单,但我必须扩展我们的程序,添加一个thumbnailviewer到我们构建的这个视图。



为了做到这一点,我认为使用CSplitterWnd并不是那么难,只需在左侧放置缩略图查看器的olecontrol和观察者身边。



我尝试了一些对话框和CFrameView类,但是当我覆盖create方法并在这个CFrameView中放置带有CreateControl的控件时,我总是会显示一条断言消息此时:



(winsplit.cpp第318行,CreateView)

 ASSERT(( int )_ AfxGetDlgCtrlID(pWnd-> m_hWnd)== IdFromRowCol(row,col)); 





基本上我只是这样做



(CThumbnailChild是CFormView的孩子)

 BOOL CThumbnailChild :: Create(LPCTSTR lpszClassName,LPCTSTR lpszWindowName,DWORD dwStyle, const  RECT& rect,CWnd * pParentWnd,UINT nID,CCreateContext * pContext)
{
return CreateControl(GdPicture_NET_9 :: CLSID_GdViewer,lpszWindowName,dwStyle,rect,pParentWnd,nID);
}





对话框设置为:

边框:无

风格:儿童

控制:true





休息时默认设置适用





长话短说我只需要在CSplitterWnd中放置两个olecontrols,thumbnailviewer和图片查看器。




greetings

解决方案

< blockquote>一种可能的解决方案是将函数的MFC代码复制到项目中并修改它运行。


Good Morning every one,

rigth now I'm working on a project where I have to use GDPicture to display images.
This GDPicture lib includes some olecontrols to do this stuff for me and rigth now it is very simple but I have to extend our program an add a thumbnailviewer to this view we build.

In order to do that I thougth it couldn't be so hard to use a CSplitterWnd and just place on the left side the olecontrol for the thumbnail viewer and on the rigth side the viewer.

I tried a bit with dialogs and CFrameView classes but when I override the create method and place the controle with "CreateControl" in this CFrameView I always get an assert message displayed at this point:

(winsplit.cpp line 318,CreateView)

ASSERT((int)_AfxGetDlgCtrlID(pWnd->m_hWnd) == IdFromRowCol(row, col));



Basically I just do this

(CThumbnailChild is a child of CFormView)

BOOL CThumbnailChild::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
 return CreateControl(GdPicture_NET_9::CLSID_GdViewer, lpszWindowName, dwStyle, rect, pParentWnd, nID);
}



The Dialog Settings are:
Border: NONE
Style: Child
Control: true


At rest the default settings apply


Long story short I just need to place two olecontrols , thumbnailviewer and the picture viewer in a CSplitterWnd.

Many thanks for your help, I hope you understand my problem

greetings

解决方案

A possible solution is to copy the MFC code of the function into your project and modify that it runs.


这篇关于如何在MFC CSplitterWnd中显示两个OLEControl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆