Hey guys, I have just convert my coding from vb to c++. However when i paste the codings inside another new project, it could be debugged but the designer view shows me error.

"C++ CodeDOM parser error: Internal Error
Hide

at Microsoft.VisualC.CppCodeParser.OnMethodPopulateStatements(Object sender, EventArgs e)
at System.CodeDom.CodeMemberMethod.get_Statements()
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)"

What should i do? =(

Attachments
#pragma once

//INSTANT C++ NOTE: Formerly VB.NET project-level imports:
using namespace System;
using namespace System::Collections;
using namespace System::Collections::Generic;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Diagnostics;
using namespace System::Windows::Forms;

namespace AAA
{
	public ref class Form1 : System::Windows::Forms::Form
	{
	#pragma region  Windows Form Designer generated code 
	public:
		Form1() : System::Windows::Forms::Form()
		{

			// This call is required by the Windows Form Designer.
			InitializeComponent();

			// Disable the Play, the Pause, and the Stop buttons.
			PlayButton->Enabled = false;
			PauseButton->Enabled = false;
			StopButton->Enabled = false;

			// Hide the Media Player.
			WindowsMediaPlayer->Visible = true;

			// Add any initialization after the InitializeComponent() call.

		}

		//Form overrides dispose to clean up the component list.
		public:
		~Form1()
		{
			this->DisposeObject(true);
		}

		private protected:
		!Form1()
		{
			this->DisposeObject(false);
		}

	private:
		[System::Diagnostics::DebuggerNonUserCode()]
		void DisposeObject(bool disposing)
		{
			if (disposing && components != nullptr)
			{
				delete components;
			}
//INSTANT C++ NOTE: There is no call to the base class's Dispose method in C++/CLI:
//			__super.Dispose(disposing)
		}

		//Required by the Windows Form Designer
		System::ComponentModel::IContainer ^components;

		//NOTE: The following procedure is required by the Windows Form Designer
		//It can be modified using the Windows Form Designer.  
		//Do not modify it using the code editor.


		[System::Diagnostics::DebuggerStepThrough()]
		void InitializeComponent()
		{
			System::ComponentModel::ComponentResourceManager ^resources = gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid);
			this->WindowsMediaPlayer = gcnew AxMediaPlayer::AxMediaPlayer();
			this->LoadButton = gcnew System::Windows::Forms::Button();
			this->PlayButton = gcnew System::Windows::Forms::Button();
			this->PauseButton = gcnew System::Windows::Forms::Button();
			this->StopButton = gcnew System::Windows::Forms::Button();
			this->OpenFileDialog1 = gcnew System::Windows::Forms::OpenFileDialog();
			this->CloseButton = gcnew System::Windows::Forms::Button();
			this->MinimizeButton = gcnew System::Windows::Forms::Button();
			(safe_cast<System::ComponentModel::ISupportInitialize^>(this->WindowsMediaPlayer))->BeginInit();
			this->SuspendLayout();
			//
			//WindowsMediaPlayer
			//
			this->WindowsMediaPlayer->Location = System::Drawing::Point(0, 22);
			this->WindowsMediaPlayer->Name = "WindowsMediaPlayer";
			this->WindowsMediaPlayer->OcxState = safe_cast<System::Windows::Forms::AxHost::State^>(resources->GetObject("WindowsMediaPlayer.OcxState"));
			this->WindowsMediaPlayer->Size = System::Drawing::Size(445, 296);
			this->WindowsMediaPlayer->TabIndex = 0;
			//
			//LoadButton
			//
			this->LoadButton->Image = safe_cast<System::Drawing::Image^>(resources->GetObject("LoadButton.Image"));
			this->LoadButton->Location = System::Drawing::Point(25, 324);
			this->LoadButton->Name = "LoadButton";
			this->LoadButton->Size = System::Drawing::Size(56, 23);
			this->LoadButton->TabIndex = 1;
			this->LoadButton->UseVisualStyleBackColor = true;
			//
			//PlayButton
			//
			this->PlayButton->Image = safe_cast<System::Drawing::Image^>(resources->GetObject("PlayButton.Image"));
			this->PlayButton->Location = System::Drawing::Point(144, 324);
			this->PlayButton->Name = "PlayButton";
			this->PlayButton->Size = System::Drawing::Size(58, 23);
			this->PlayButton->TabIndex = 2;
			this->PlayButton->UseVisualStyleBackColor = true;
			//
			//PauseButton
			//
			this->PauseButton->Image = safe_cast<System::Drawing::Image^>(resources->GetObject("PauseButton.Image"));
			this->PauseButton->Location = System::Drawing::Point(263, 324);
			this->PauseButton->Name = "PauseButton";
			this->PauseButton->Size = System::Drawing::Size(53, 23);
			this->PauseButton->TabIndex = 3;
			this->PauseButton->UseVisualStyleBackColor = true;
			//
			//StopButton
			//
			this->StopButton->Font = gcnew System::Drawing::Font("Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, System::Convert::ToByte(0));
			this->StopButton->Image = safe_cast<System::Drawing::Image^>(resources->GetObject("StopButton.Image"));
			this->StopButton->Location = System::Drawing::Point(373, 324);
			this->StopButton->Name = "StopButton";
			this->StopButton->Size = System::Drawing::Size(45, 23);
			this->StopButton->TabIndex = 4;
			this->StopButton->UseVisualStyleBackColor = true;
			//
			//OpenFileDialog1
			//
			this->OpenFileDialog1->FileName = "OpenFileDialog1";
			//
			//CloseButton
			//
			this->CloseButton->Font = gcnew System::Drawing::Font("Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, System::Convert::ToByte(0));
			this->CloseButton->Image = safe_cast<System::Drawing::Image^>(resources->GetObject("CloseButton.Image"));
			this->CloseButton->Location = System::Drawing::Point(0, 1);
			this->CloseButton->Name = "CloseButton";
			this->CloseButton->Size = System::Drawing::Size(23, 23);
			this->CloseButton->TabIndex = 5;
			this->CloseButton->TextAlign = System::Drawing::ContentAlignment::TopLeft;
			this->CloseButton->UseVisualStyleBackColor = true;
			//
			//MinimizeButton
			//
			this->MinimizeButton->Font = gcnew System::Drawing::Font("Microsoft Sans Serif", 9.0F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, System::Convert::ToByte(0));
			this->MinimizeButton->ForeColor = System::Drawing::SystemColors::Control;
			this->MinimizeButton->Image = safe_cast<System::Drawing::Image^>(resources->GetObject("MinimizeButton.Image"));
			this->MinimizeButton->ImageAlign = System::Drawing::ContentAlignment::BottomCenter;
			this->MinimizeButton->Location = System::Drawing::Point(25, 1);
			this->MinimizeButton->Name = "MinimizeButton";
			this->MinimizeButton->Size = System::Drawing::Size(22, 23);
			this->MinimizeButton->TabIndex = 6;
			this->MinimizeButton->Text = "_";
			this->MinimizeButton->TextAlign = System::Drawing::ContentAlignment::TopLeft;
			this->MinimizeButton->UseVisualStyleBackColor = true;
			//
			//Form1
			//
			this->AutoScaleDimensions = System::Drawing::SizeF(safe_cast<float>(6.0), safe_cast<float>(13.0));
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->BackColor = System::Drawing::Color::Black;
			this->ClientSize = System::Drawing::Size(442, 357);
			this->Controls->Add(this->CloseButton);
			this->Controls->Add(this->MinimizeButton);
			this->Controls->Add(this->StopButton);
			this->Controls->Add(this->PauseButton);
			this->Controls->Add(this->PlayButton);
			this->Controls->Add(this->LoadButton);
			this->Controls->Add(this->WindowsMediaPlayer);
			this->ForeColor = System::Drawing::SystemColors::Control;
			this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
			this->Name = "Form1";
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
			this->Text = "Windows Media Player";
			(safe_cast<System::ComponentModel::ISupportInitialize^>(this->WindowsMediaPlayer))->EndInit();
			this->ResumeLayout(false);

			//INSTANT C++ NOTE: Converted event handlers:
			LoadButton->Click += gcnew System::EventHandler(this, &Form1::LoadButton_Click);
			PlayButton->Click += gcnew System::EventHandler(this, &Form1::PlayButton_Click);
			PauseButton->Click += gcnew System::EventHandler(this, &Form1::PauseButton_Click);
			StopButton->Click += gcnew System::EventHandler(this, &Form1::StopButton_Click);
			CloseButton->Click += gcnew System::EventHandler(this, &Form1::CloseButton_Click);
			MinimizeButton->Click += gcnew System::EventHandler(this, &Form1::MinimizeButton_Click);

		}
	#pragma endregion


	internal:
		AxMediaPlayer::AxMediaPlayer ^WindowsMediaPlayer;
		System::Windows::Forms::Button ^LoadButton;
		System::Windows::Forms::Button ^PlayButton;
		System::Windows::Forms::Button ^PauseButton;
		System::Windows::Forms::Button ^StopButton;
		System::Windows::Forms::OpenFileDialog ^OpenFileDialog1;

	private:
		void LoadButton_Click(System::Object ^sender, System::EventArgs ^e)
		{
			// Reset the file names for the Open dialog box and for the Media Player.
			OpenFileDialog1->FileName = "";
			WindowsMediaPlayer->FileName = "";
			// Display the Open File dialog box.
			OpenFileDialog1->ShowDialog();
			// Verify that Cancel was not clicked.
			if (! (OpenFileDialog1->FileName == ""))
			{
				// Disable the Load button.
				LoadButton->Enabled = false;
				// Prevent the Media Player from automatically playing loaded files.
				WindowsMediaPlayer->AutoStart = false;
				// Set the Media Player audio file.
				WindowsMediaPlayer->FileName = OpenFileDialog1->FileName;
				MessageBox::Show(WindowsMediaPlayer->FileName);
				// Enable the Play button.
				PlayButton->Enabled = true;
			}
			else
			{
				// Disable the Play button.
				PlayButton->Enabled = false;
			}
		}


		void PlayButton_Click(System::Object ^sender, System::EventArgs ^e)
		{
			// Disable the Load and the Play buttons.
			LoadButton->Enabled = false;
			PlayButton->Enabled = false;
			// Play the audio file.
			WindowsMediaPlayer->Play();
			// Enable the Pause and the Stop buttons.
			PauseButton->Enabled = true;
			StopButton->Enabled = true;
		}

		void PauseButton_Click(System::Object ^sender, System::EventArgs ^e)
		{
			// Disable the Pause button.
			PauseButton->Enabled = false;
			// Pause the audio file.
			WindowsMediaPlayer->Pause();
			// Enable the Play button.
			PlayButton->Enabled = true;
		}

		void StopButton_Click(System::Object ^sender, System::EventArgs ^e)
		{
			// Disable the Pause and the Stop buttons.
			PauseButton->Enabled = false;
			StopButton->Enabled = false;
			// Stop playing the audio file

What kind of C++ project did you create?

Because that looks like Microsoft's managed C++ and not regular C++ which can be compiled with any C++ compiler.

What kind of C++ project did you create?

Because that looks like Microsoft's managed C++ and not regular C++ which can be compiled with any C++ compiler.

Erm.. Im using visual studio 2005 and i create a windows forms application.. Ya.. After that, i paste the codings inside.. It could be debugged but the designer view gives me error.

The code you have posted is not C++ , it looks like C#.
Did you mean that you copied VB code and expecting it to work with a VC++ compiler ?

The code you have posted is not C++ , it looks like C#.
Did you mean that you copied VB code and expecting it to work with a VC++ compiler ?

Erm.. i converted the vb codings into c++ first.. After that i create a VC++ windows form application and paste it in..

This article has been dead for over six months. Start a new discussion instead.