A Problem I Solved Last Night

As we know,the frame of MFC use the patten of observe.When we create a single document application,it create an application class,a frame window class a view window class and a document class.The view window is a child of the frame.

  As I know little about the observer patten,and Many detail of it are strange to me,a problem occure last night,and cost me hours to solve it.I try to add a view window to the frame,so I create a class who derive from CFormView.The class of CFormView is require a dialog to associate with it.The dialog who associate with CFormView class must have the style of CHILD.But I don't know of this.A error dialog was show when I run my program,and it was terminated when I clicked the ignore button.I didn't know what had happen.The debug programe show the line where the error occured,this line was just a function-call code,and I didn't clear about the function.

  I went into the code of this function and traced the path the programe go with.Many time I try,and no result come out.Painful I was.In the processe of the trace,I learn useful things, such as MAKEINTERSOURCE. MAKEINTERSOURCE is macro which change an integer Id which identify a source into a string which also identity a source. Finaly I found in a funtion that the resource of the dialog which accociate with the CFormView lack the sytle of CHILD.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值