MFC中Windows位置问题 [英] Problem with windows position in mfc

查看:99
本文介绍了MFC中Windows位置问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个sdi项目.我试图通过创建一个单独的(CLine)类来画一条线.我的基类是CScrollView.从scrollview我通过创建一个对象来调用CLine类的成员函数.我在运行时遇到断言错误,并且在调整大小时行也超出了窗口.我的问题是CLIne的基类是什么,以及如何使用视图管理行位置,请问有谁可以帮我...

Hai all,

I have a sdi project.In that i am trying to draw a line by creating a seperate (CLine)class.My base class is CScrollView.From the scrollview i am calling the member function of CLine class by creating an object.But i am getting assertion error while running and also line is going out of the window when i resize it.My question is what should be the base class of CLIne and how to mange with line position with view,Pls can any one help me...

推荐答案

我想这样做的逻辑方法是,使CLine称为Line(C标准适用于MFC类,并且是dumb),并具有没有基类.您的窗口应保留Line对象的集合,并在Paint事件中对其进行迭代并绘制线条.就目前而言,这听起来像是您正在创建子窗口,如果您希望这些行存在于SDI窗口中并附加到它上,那是不明智的.
I would imagine the logical way to do this, would be to make CLine called Line ( the C standard is for MFC classes, and is dumb ), and to have no base class. Your window should keep a collection of Line objects, and iterate over it in your Paint event and draw the lines. As it stands, it sounds like you''re creating child windows, which is not wise, if you want the lines to exist inside your SDI window and be attached to it.


这篇关于MFC中Windows位置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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