如何在MFC中显式调用OnCreate(LPCREATESTRUCT LPCS) [英] How to call OnCreate(LPCREATESTRUCT LPCS) IN MFC EXPLICITLY

查看:113
本文介绍了如何在MFC中显式调用OnCreate(LPCREATESTRUCT LPCS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮我打电话给OnCreate(LPCREATESTRUCT LPCS)功能。



由于未能填写LPCREATESTRUCT结构,我无法继续进行。

任何人都可以帮我吗?





谢谢,

Sarath。

Please help me in calling OnCreate(LPCREATESTRUCT LPCS) FUNCTION PRAGMATICALLY.

I am unable to proceed further because of failing in filling LPCREATESTRUCT structure.
Can any one help me on this?


Thanks,
Sarath.

推荐答案

您不调用OnXYZ类型函数,它们在接收消息时由框架调用。这些函数称为消息处理程序,因为它们处理特定类型的Windows事件的消息。



有关更多信息,请检查有关消息处理程序的文档 [ ^ ]



在旁注中,OnCreate不应该填写传递结构 - 它由框架提供,框架从创建新窗口的函数中获取所有参数,例如: G。 CreateWindow() [ ^ ]
You don't call OnXYZ type functions, they are called by the framework upon receiving messages. These functions are called message handlers, because they handle messages for specific types of windows events.

For more info check the documentation on Message Handlers[^]

On a sidenote, OnCreate isn't supposed to fill in the passed struct - it is provided by the framework, who got all the parameters from the function that created the new window, e. g. CreateWindow()[^]


int CMyView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
   if (CFormView::OnCreate(lpCreateStruct) == -1)
      return -1;

   // TODO:  Add your specialized creation code here

   return 0;
}


你好,你不会以编程方式调用OnCreate,OnCreate是由MFC框架调用的。



如果您在创建主窗口时遇到问题,我相信这里的解决方案可以帮到您: VC ++ MFC中的文档视图体系结构 [ ^ ]
Hello, you would not call OnCreate programatically, OnCreate is called by MFC framework.

If you are having trouble creating you main window, I believe the solution here will help you: Document View Architecture in VC++ MFC[^]


这篇关于如何在MFC中显式调用OnCreate(LPCREATESTRUCT LPCS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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