- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我尝试在表单“For_Student_Details.h”中使用#include“CFIS_Main.h”语句时,它不接受...任何人都可以指出我的错误吗?感谢您的帮助..
MyProject.cpp
// MyProject.cpp : main project file.
#include "stdafx.h"
#ifndef CFIS_Main_h
#define CFIS_Main_h
#include "CFIS_Main.h"
#endif
using namespace MyProject;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// Create the main window and run it
Application::Run(gcnew CFIS_Main());
return 0;
}
//CFIS_Main.h IsMdiContainer = True
#include "For_Student_Detials"
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
For_Student_Detials^ MyStudentDet= For_Student_Detials::GetForm(true,this);
MyStudentDet->MdiParent=this;
MyStudentDet->FormBorderStyle=System::Windows::Forms::FormBorderStyle::None;
MyStudentDet->Dock=DockStyle::Fill;
MyStudentDet->Show();
}
#include "CFIS_Main.h" Why Not included...?????
public: static For_Student_Details^ For_Student_Details::_instance = nullptr;
public: static For_Student_Details^ For_Student_Details::GetForm(bool^ IsMDIChild, CFIS_Main^ MyInstFrm) {
if (_instance == nullptr)
_instance = gcnew For_Student_Details();
if (_instance->IsDisposed)
_instance = gcnew For_Student_Details();
if (IsMDIChild)
_instance->MdiParent = MyInstFrm;
return _instance;
}
收到以下错误
error C2061: syntax error : identifier 'CFIS_Main'
error C2065: 'MyInstFrm' : undeclared identifier
error C2660: 'CashFlow_InformationsSystem::For_Loan_Details::GetForm' : function does not take 2 arguments
从上面的代码来看,它不包括 CFIS_Main,我无法确定我的错误,有人可以指点我吗?感谢您的帮助
最佳答案
你有一个循环标题引用:
您需要解决这种循环依赖。
最简单的方法是在“CFIS_Main.h”中只保留 button1_Click()
的函数声明,并移动定义 进入“MyProject.cpp”,其中还包含“For_Student_Details”。
您还必须定义(或包含正确的 header )For_Student_Details::GetForm()
中引用的类型 CFIS_Main
(一旦您修复循环包含问题)
此外,将 include guard 放在头文件中,而不是 .cpp 文件中
关于c++ - Windows 窗体 - 单实例 - 包含语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11001904/
对于一个科学实验,我写了一个turtle.py ,它会打开一个 800x480 的窗口并绘制一个缓慢增长的黑点。 turtle.py以 C:\Users\kaza>python C:\Users\ka
我开发了一个 swing 应用程序,但每次运行应用程序时都会打开一个新窗口。我希望如果一个窗口已经打开,则其他窗口不允许打开。 最佳答案 Here是一个 Java 单一应用实例的例子: A singl
有没有办法检测主进程中 Electron 的结构? process.platform 似乎也在 x64 机器上返回 win32,我没有在文档中找到任何获取架构的选项。 最佳答案 你试过 process
public short[] HanningWindow(short[] signal_in ,int pos ,int size) { for (int i= pos; i < pos+si
我有一个具有这些属性的 Electron 窗口: mainWindow = new BrowserWindow({ width: 800, height: 600, title: "Aqu
我有一个 Ubuntu 工作站,我正在尝试引导一个 Windows 节点。 Windows 节点在端口 2222 上打开了 ssh。我一直在关注 http://docs.opscode.com/plu
我是一名优秀的程序员,十分优秀!