mfc

error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' afxwin.h

元气小坏坏 提交于 2020-12-11 08:06:23
问题 I'm trying to make class responsible for putting some text on grey bg: Score.h #pragma once class Score { public: Score(); ~Score(); void UpdateScore(int points); void UpdateLives(int lives); int GetScore(){ return m_iScore; } int GetLives(){ return m_iLives; } void GetScoreText();//CString void GetLivesText(); CRect GetArea(){ return m_Area; } void SetArea(int MaxWidth, int MaxHeight, int Width); void DrawScore(CDC* pDC); CPoint GetText1Area(){ return m_ptText1; } CPoint GetText2Area(){

MFC MessageBox Not Showing at Top Of All Windows

别说谁变了你拦得住时间么 提交于 2020-12-11 02:51:09
问题 i have created an Application in VC++, the Problem is that if an Error Occurs i display the MessageBox. but that MessageBox doesn't show at front. i have to press ALT key to become in-front of that application. My Application becomes in-active until i press ALT. and Press OK on the MessageBox. Here is the Code Attached. MessageBox(NULL,"Invalid File, Parsing is going to be terminate"); AfxMessageBox("Win32 MessageMessage",MB_OK | MB_ICONEXCLAMATION | MB_TOPMOST); i wil very grateful if

How should I change the IMAGE(doesn't matter the type) of the button in the toolbar in MFC applications?

感情迁移 提交于 2020-12-06 15:51:30
问题 I know that this is stupid problem but I am stuck with it for the past 4 days. Why it is so complicated to just modify the toolbar in the MFC apps? I create New Visual studio MFC application that is dialog based . I create new Toolbar resource . And then how should I set images(png, bitmap, jpeg...) or whatever type to be used in my toolbar? I have set size to w50 and h50 and I can draw inside the buttons. But I cant find way to use image. Instead this 2 buttons that I have just tried if its

How should I change the IMAGE(doesn't matter the type) of the button in the toolbar in MFC applications?

丶灬走出姿态 提交于 2020-12-06 15:50:44
问题 I know that this is stupid problem but I am stuck with it for the past 4 days. Why it is so complicated to just modify the toolbar in the MFC apps? I create New Visual studio MFC application that is dialog based . I create new Toolbar resource . And then how should I set images(png, bitmap, jpeg...) or whatever type to be used in my toolbar? I have set size to w50 and h50 and I can draw inside the buttons. But I cant find way to use image. Instead this 2 buttons that I have just tried if its

How should I change the IMAGE(doesn't matter the type) of the button in the toolbar in MFC applications?

亡梦爱人 提交于 2020-12-06 15:50:26
问题 I know that this is stupid problem but I am stuck with it for the past 4 days. Why it is so complicated to just modify the toolbar in the MFC apps? I create New Visual studio MFC application that is dialog based . I create new Toolbar resource . And then how should I set images(png, bitmap, jpeg...) or whatever type to be used in my toolbar? I have set size to w50 and h50 and I can draw inside the buttons. But I cant find way to use image. Instead this 2 buttons that I have just tried if its

how to set default file name extension in CMFCEditBrowseCtrl::EnableFileBrowseButton?

大城市里の小女人 提交于 2020-12-03 14:26:10
问题 how to give default file name extension in CMFCEditBrowseCtrl::EnableFileBrowseButton? How the arguments should be passed? I tried like following code. CMFCEditBrowseCtrl py_file_path; py_file_path.EnableFileBrowseButton(_T"PY",_T"*.py"); But it is not displaying the .py files. It says "no items matches". I guess there is some problem with the lpszDefExt and lpszFilter values i use. Could anyone tell me what is the value of those arguments to list all .py files? 回答1: You need to set it like

how to set default file name extension in CMFCEditBrowseCtrl::EnableFileBrowseButton?

Deadly 提交于 2020-12-03 14:21:32
问题 how to give default file name extension in CMFCEditBrowseCtrl::EnableFileBrowseButton? How the arguments should be passed? I tried like following code. CMFCEditBrowseCtrl py_file_path; py_file_path.EnableFileBrowseButton(_T"PY",_T"*.py"); But it is not displaying the .py files. It says "no items matches". I guess there is some problem with the lpszDefExt and lpszFilter values i use. Could anyone tell me what is the value of those arguments to list all .py files? 回答1: You need to set it like

MFC 多文档menu切换

不想你离开。 提交于 2020-11-27 05:22:27
作为一个MFC新手可能不知道怎样切换menu。在网上也很难找到相关资料。 当应用程序向导生成的 SDI 或 MDI 应用程序时,它创建了菜单资源 (使用 IDR_MAINFRAME 作为其资源 id。 此菜单显示在所有时间 SDI 应用程序,并且仅在 MDI 应用程序中没有活动文档时。 对于 MDI 应用程序中,应用程序向导还会生成菜单资源为一个 multidoc 模板创建使用 IDR_xxxxTYPE 作为其资源 id。 附加的菜单资源可供其使用资源编辑器创建和使用另一台 multidoc 模板关联在一起 (见 CMultiDocTemplate)。 该框架将显示与每个 multidoc 模板自动关联的菜单资源。 此方法将限制每个文档模板的一个菜单。 若要避开此限制,可以重写 CDocument::GetDefaultMenu(),并执行一些调用以显示菜单。 MFC 使用 CMDIChildWnd::m_hMenuShared 和 CFrameWnd::m_hMenuDefault 数据成员来确定要显示的菜单。 在 MDI 应用程序,其中每个文档模板关联的菜单资源文档模板构造期间加载并复制到 CMDIChildWnd::m_hMenuShared。 然后在 CMDIChildWnd::OnUpdateFrameMenu() 中使用此菜单时没有活动的 MDI 子窗口设置 MDI