I am new to visual studio and windows programming. I have watched a bunch of videos and read quite a bit online. I downloaded Visual Studio Community Edition with almost all the bells and whistles. I created a project with a main .cpp and .h file. I am trying
to create my first windows program for my wife's side business. I followed all the instructions but I am getting the following errors:
WarningMSB3243No way to resolve conflict between "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". Choosing "System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.FirstAttemptC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets2106
I am getting over 1000 warnings. I am at a loss. This is my .cpp file:
#include "Mainform.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThreadAttribute]
void Main(array<String^>^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
//WinformCDemo is your project name
FirstAttempt::Mainform form;
Application::Run(% form);
}
And here is my .h file
#pragma once
namespace FirstAttempt {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for Mainform
/// </summary>
public ref class Mainform : public System::Windows::Forms::Form
{
public:
Mainform(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Mainform()
{
if (components)
{
delete components;
}
}
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->components = gcnew System::ComponentModel::Container();
this->Size = System::Drawing::Size(300,300);
this->Text = L"Mainform";
this->Padding = System::Windows::Forms::Padding(0);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
}
#pragma endregion
};
}
Both files say " No issues found"