MFC 创建新项目

原文链接:http://www.cnblogs.com/chenximcm/p/6285164.html

本文主要介绍如何是使用vc++创建MFC项目,并简单介绍整个项目的基本框架。文件–>新建,会弹出以下新建文件(项目)类型的界面,如下
这里写图片描述
按上图的步骤u,创建一个MFC工程。其中步骤3中的CardDevices是要我们输入的工程名。点击确定后,会弹出以下界面:
这里写图片描述
默认的是“多重文档”,这个地方我们改成基本对话框。后面的就选择默认。点击完成后,工程的创建已经完成。工程创建完成后会编辑器的现实如下:
这里写图片描述
其中图中1是默认创建的窗口。“2”是在窗口中默认添加的两个按钮,“3”是默认添加的文档对象,“4”是控件工具栏,我们可以选中其中的控件,然后往界面上拖放。“5”,“6”是我们的整个项目所有资源的菜单栏。其中左下角的“6”有三种选择显示方式:分别是代码目录,界面资源目录,整个工程的文件目录。如下图
这里写图片描述
“1”表示帮助界面,就是运行项目后,弹出一个主界面,点击左上角的图标,会弹出这个关于界面。“2”是整个程序的框架部分,“3”是整个工程的主界面相关类代码。“4”是关于界面的UI部分,“5”是主界面的UI。
其中“C工程名App”可以理解为整个应用程序的主体框架,由她去启动我们的主对话框“C工程名Dlg”。“CAboutDlg”是帮助对话框,运行程序后弹出主对话框,点击主对话框左上角小图标会弹出一个下拉菜单,点击“关于….”后弹出的对话框即是帮助对话框的内容。这里需要指出的是,MFC的编程惯例是类名都以C开头(ClassView视图查看类信息),而该类相关的头文件、源文件(FileView视图查看文件信息)文件名则以去掉C之后的部分命名。编译,运行后会弹出如下图的界面:
这里写图片描述
到这里我们已经成功地创建了要给工程。后面我们可以往界面上添加各种控件,并给按钮等控件添加响应事件。

转载于:https://www.cnblogs.com/chenximcm/p/6285164.html

展开阅读全文
博主设置当前文章不允许评论。

Eclipse+pydev不能创建新项目??

10-10

安装了Eclispse SDK 3.4.1版本,然后安装了pydev,想尝试一下做为python的IDE.但是都设置好了以后,打开一个pydev的perspective,rn却没有办法新建一个pydev project,什么反应都没有.然后查看了log文件,发现下面的问题:rnrn!ENTRY org.eclipse.ui 4 0 2008-10-10 15:32:12.187rn!MESSAGE Unhandled event loop exceptionrn!STACK 0rnjava.lang.NoSuchFieldError: WizardNewProjectCreationPage_projectContentsLabelrn at org.python.pydev.ui.wizards.project.CopiedWizardNewProjectNameAndLocationPage.createProjectLocationGroup(CopiedWizardNewProjectNameAndLocationPage.java:194)rn at org.python.pydev.ui.wizards.project.CopiedWizardNewProjectNameAndLocationPage.createControl(CopiedWizardNewProjectNameAndLocationPage.java:140)rn at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1147)rn at org.eclipse.jface.wizard.WizardDialog.access$2(WizardDialog.java:1139)rn at org.eclipse.jface.wizard.WizardDialog$4.run(WizardDialog.java:1128)rn at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)rn at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1126)rn at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:820)rn at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:369)rn at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)rn at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)rn at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)rn at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)rn at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)rn at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)rn at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)rn at org.eclipse.jface.window.Window.open(Window.java:801)rn at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:117)rn at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)rn at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)rn at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)rn at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)rn at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)rn at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)rn at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)rn at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)rn at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)rn at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)rn at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)rn at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)rn at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)rn at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)rn at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)rn at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)rn at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)rn at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)rn at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)rn at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)rn at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)rn at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)rn at org.eclipse.equinox.launcher.Main.run(Main.java:1236)rnrn这下晕了,不知道哪里出现了问题.请大家赐教.rn 论坛

没有更多推荐了,返回首页