2 Replies - 1827 Views - Last Post: 03 October 2007 - 04:24 PM

#1 pspfreak101   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-July 07

Why wont this copy!

Post icon  Posted 03 October 2007 - 04:02 PM

Just started with C++ got sick of the .net framework for C# so decided to port my program to C++ any ways I found the example on the online help and it doesn't work :angry: heres my code

#pragma once
#using <mscorlib.dll>
namespace EasyInstaller {
	
	using namespace System;
	using namespace System::IO;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// <summary>
	/// Summary for Form1
	///
	/// WARNING: If you change the name of this class, you will need to change the
	///		  'Resource File Name' property for the managed resource compiler tool
	///		  associated with all .resx files this class depends on.  Otherwise,
	///		  the designers will not be able to interact properly with localized
	///		  resources associated with this form.
	/// </summary>
	public ref class Form1 : public System::Windows::Forms::Form
	{
	public:
		Form1(void)
		{ 
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			//
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~Form1()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::Button^  Exit;
	private: System::Windows::Forms::Button^  Install;
	private: System::Windows::Forms::RadioButton^  radioButton1;
	private: System::Windows::Forms::CheckBox^  checkBox1;
	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::Label^  label2;
	private: System::Windows::Forms::Label^  label3;
	private: System::Windows::Forms::RadioButton^  radioButton2;
	protected: 
  

	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->Exit = (gcnew System::Windows::Forms::Button());
			this->Install = (gcnew System::Windows::Forms::Button());
			this->radioButton1 = (gcnew System::Windows::Forms::RadioButton());
			this->checkBox1 = (gcnew System::Windows::Forms::CheckBox());
			this->label1 = (gcnew System::Windows::Forms::Label());
			this->label2 = (gcnew System::Windows::Forms::Label());
			this->label3 = (gcnew System::Windows::Forms::Label());
			this->radioButton2 = (gcnew System::Windows::Forms::RadioButton());
			this->SuspendLayout();
			// 
			// Exit
			// 
			this->Exit->Location = System::Drawing::Point(163, 463);
			this->Exit->Name = L"Exit";
			this->Exit->Size = System::Drawing::Size(75, 23);
			this->Exit->TabIndex = 0;
			this->Exit->Text = L"Exit";
			this->Exit->UseVisualStyleBackColor = true;
			this->Exit->Click += gcnew System::EventHandler(this, &Form1::Exit_Click);
			// 
			// Install
			// 
			this->Install->Location = System::Drawing::Point(56, 463);
			this->Install->Name = L"Install";
			this->Install->Size = System::Drawing::Size(75, 23);
			this->Install->TabIndex = 1;
			this->Install->Text = L"Install";
			this->Install->UseVisualStyleBackColor = true;
			this->Install->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
			// 
			// radioButton1
			// 
			this->radioButton1->AutoSize = true;
			this->radioButton1->Location = System::Drawing::Point(46, 217);
			this->radioButton1->Name = L"radioButton1";
			this->radioButton1->Size = System::Drawing::Size(85, 17);
			this->radioButton1->TabIndex = 2;
			this->radioButton1->TabStop = true;
			this->radioButton1->Text = L"3.52 M33 - 4";
			this->radioButton1->UseVisualStyleBackColor = true;
			// 
			// checkBox1
			// 
			this->checkBox1->AutoSize = true;
			this->checkBox1->Location = System::Drawing::Point(46, 143);
			this->checkBox1->Name = L"checkBox1";
			this->checkBox1->Size = System::Drawing::Size(88, 17);
			this->checkBox1->TabIndex = 3;
			this->checkBox1->Text = L"Fw 3.71 M33";
			this->checkBox1->UseVisualStyleBackColor = true;
			// 
			// label1
			// 
			this->label1->AutoSize = true;
			this->label1->Location = System::Drawing::Point(12, 115);
			this->label1->Name = L"label1";
			this->label1->Size = System::Drawing::Size(79, 13);
			this->label1->TabIndex = 4;
			this->label1->Text = L"Install Firmware";
			// 
			// label2
			// 
			this->label2->AutoSize = true;
			this->label2->Location = System::Drawing::Point(12, 189);
			this->label2->Name = L"label2";
			this->label2->Size = System::Drawing::Size(74, 13);
			this->label2->TabIndex = 5;
			this->label2->Text = L"Your Firmware";
			// 
			// label3
			// 
			this->label3->AutoSize = true;
			this->label3->Location = System::Drawing::Point(15, 273);
			this->label3->Name = L"label3";
			this->label3->Size = System::Drawing::Size(103, 13);
			this->label3->TabIndex = 6;
			this->label3->Text = L"Install M33 update 4";
			// 
			// radioButton2
			// 
			this->radioButton2->AutoSize = true;
			this->radioButton2->Location = System::Drawing::Point(46, 306);
			this->radioButton2->Name = L"radioButton2";
			this->radioButton2->Size = System::Drawing::Size(93, 17);
			this->radioButton2->TabIndex = 7;
			this->radioButton2->TabStop = true;
			this->radioButton2->Text = L"M33 Update 4";
			this->radioButton2->UseVisualStyleBackColor = true;
			// 
			// Form1
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(293, 503);
			this->Controls->Add(this->radioButton2);
			this->Controls->Add(this->label3);
			this->Controls->Add(this->label2);
			this->Controls->Add(this->label1);
			this->Controls->Add(this->checkBox1);
			this->Controls->Add(this->radioButton1);
			this->Controls->Add(this->Install);
			this->Controls->Add(this->Exit);
			this->Name = L"Form1";
			this->Text = L"M33 Easy installer";
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
	private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
				
				 if (this->checkBox1->Checked)
			 {
				  String* path = S"EBOOT.PBP";
				  String* path1 =  S"C:\EBOOT.PBP";

				   File::Copy(path, path1);

				 MessageBox::Show("Install Complete", "Complete", MessageBoxButtons::oK, MessageBoxIcon::Exclamation);
			 }
		 
				if (this->radioButton1->Checked)
				{
					MessageBox::Show("You selected Fw 3.52");
				}
			 };
			 
	
			 
	private: System::Void Exit_Click(System::Object^  sender, System::EventArgs^  e) {
			 Close();
			 }
	};
}

This post has been edited by pspfreak101: 03 October 2007 - 04:04 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Why wont this copy!

#2 jjhaag   User is offline

  • me editor am smartastic
  • member icon

Reputation: 48
  • View blog
  • Posts: 1,789
  • Joined: 18-September 07

Re: Why wont this copy!

Posted 03 October 2007 - 04:13 PM

exactly what is the problem? the help will probably be more useful and more plentiful if you are more specific with your issues.

-jjh
Was This Post Helpful? 0
  • +
  • -

#3 pspfreak101   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-July 07

Re: Why wont this copy!

Posted 03 October 2007 - 04:24 PM

Well It doesn't even run I get an error
1>------ Build started: Project: Easy Installer, Configuration: Debug Win32 ------
1>Compiling...
1>Easy Installer.cpp
1>c:\users\roberts\desktop\project\easy installer\easy installer\Form1.h(181) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
1>		When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
1>c:\users\roberts\desktop\project\easy installer\easy installer\Form1.h(182) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
1>		When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
1>c:\users\roberts\desktop\project\easy installer\easy installer\Form1.h(182) : warning C4129: 'E' : unrecognized character escape sequence
1>c:\users\roberts\desktop\project\easy installer\easy installer\Form1.h(181) : error C3699: '*' : cannot use this indirection on type 'System::String'
1>		compiler replacing '*' with '^' to continue parsing
1>c:\users\roberts\desktop\project\easy installer\easy installer\Form1.h(182) : error C3699: '*' : cannot use this indirection on type 'System::String'
1>		compiler replacing '*' with '^' to continue parsing
1>Build log was saved at "file://c:\Users\Roberts\Desktop\project\Easy Installer\Easy Installer\Debug\BuildLog.htm"
1>Easy Installer - 4 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1