The following are the steps to make such a project:
- Go in the menu bar: File => New => Project, to get a list of project templates.
- Select in the tree to the left go: Templates => Visual C++. Select on the right of the of the window of the templates list : Empty Project (Visual C++) .
- There will be in the "Solution Explorer" a new tree of files which belong to your new project. Expand it. Let's say you got a new project named "Project1". You'll get on the top of the tree "Solution Project1 (1 project)" . After expanding the tree, You should get on the top of the expansion something called "Project1" right under "Solution Project1 (1 project)" . Right-click "Project1". Select "Add New Item" from the right-click menu.
- In "Add New Item" from, in the tree to the left , go : Visual C++ => UI => Windows Forms. click save. You'll get the question "You are adding a CLR component to a native project. The project will be converted to have Common Language Runtime support. Do you want to continue?" . Click "Yes" . Again, one more time, right-click "Project1" and go "Properties".
- On the tree to left, go : Configuration Properties => Linker => System. And to the right of the properties window set "SubSystem" as "Windows (/SUBSYSTEM:WINDOWS)" .
- Also go: Configuration Properties => Linker => Advanced . And to the right of the properties window, set "Entry Point" to "main". If you cannot not see "Entry Point", just re-open the properties window again. This is the function "main" given below. this is where you're application will start running from.
- Finally, Double-click the form designer and move the cursor to the bottom of the code just right before the closing brace of "namespace Project1". Paste the following code. Please remember to rename the variables of this code according to your project needs to get it working with the empty form.
[STAThread] void main(array<String^>^ arg) { Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); MyForm form; Application::Run(%form); }
怎麼搞的這麼難用,阿明明就在為啥不直接秀出來就好XD
沒有留言:
張貼留言