我可以将Windows 32应用程序转换为Windows窗体应用程序吗?

问题描述:

我正在使用的程序在使用Windows窗体时非常复杂。在大多数在线教程中,您可以双击一个按钮,例如,它会打开一个简单的.cpp文件来处理按钮及其属性。我刚刚添加了一个windows
组合框,双击时我会弹出一个显示Add Class的弹出窗口。我不想通过给出一个特殊属性来搞砸整个项目,这些属性会混淆其他属性。

The program I am using has really complicated things when working with Windows Forms. In most tutorials online you can double-click a button for example and it opens up a simple .cpp file to work with the button and its properties. I just added a windows combo box and when double-clicking I get a pop-up window that says Add Class. I don't want to screw up the entire project by giving one dialog box special properties which messes up the other ones.

现在我使用复杂的代码和LRESULT CALLBACK来处理对话框。以下是将鼠标悬停在图形上时更改简单文本的示例代码:

Right now I use complicated code and LRESULT CALLBACK to deal with dialog boxes. Here's the code for example for changing simple text when hovering over a graphic:

int element = checkEventInfo(id);
if (element != -1) {
SetWindowText(GetDlgItem(hWID[7], IDC_ENEMYNAME), getEventInfoText(element).c_str());
}

在Visual Studio文档中(我使用VS 2015顺便说一句),它说使用以下代码将字符串添加到组合框:

In the Visual Studio documentation (Im using VS 2015 btw) it says use to following code to add a string to a combobox:

comboBox1->Items->Add("Tokyo");  

但是,我不知道在代码中插入的位置,或者甚至可以使用。在我的组合框中,右上角没有小箭头,我可以右键单击并选择添加项目。即使属性框中的Data属性也显示为灰色,因此
我无法手动添加项目。为什么我的项目如此复杂?我必须为所有事情做另一步。

However, I have no clue where to insert that in the code, or if that will even work. In my combo box there is no little arrow in the top-right corner where I can right-click and select Add Items. Even the Data property in the property box is grayed out so I can't manually add items. Why is my project so complicated? I have to do another step for everything.

你感到沮丧和困惑,感到恐慌,没有意义。您甚至没有告诉我们该程序是什么语言。我假设它是C ++。你没有告诉我们其他任何事情来帮助我们理解你拥有的东西。所以请冷静下来。
我们必须确定的是程序是否使用MFC。你能在解决方案资源管理器中截取项目的截图吗?如果你能证明这一点,这可能会有所帮助。有stdafx.h文件吗?如果有,你可以显示其中有什么,那么
帮助。它不是Windows窗体程序,因此无济于事。
You are frustrated and confused and are panicking and not making sense. You did not even tell us what language the program is. I assume it is C++. You don't tell us much of anything else to help us understand what you have. So please calm down. Something we must determine is if the program uses MFC. Can you take a screenshot of the project in Solution Explorer? That would probably help if you can show that. Is there a stdafx.h file? If there is and you can show what that has in it then that would help. It is not a Windows Forms program so that does not help.