pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

C++ paste-bin - collaborative debugging tool View Help


Posted by rand0m on Wed 20th Dec 06:18
download | new post

  1. // tests.cpp : main project file.
  2. #include "stdafx.h"
  3. #include <iostream>
  4. using namespace std;
  5. #pragma comment( lib, "User32.lib" )
  6. #include "Windows.h"
  7.  
  8. #include "Form1.h"
  9. #include "form2.h"
  10.  
  11.  
  12.  
  13.  
  14. using namespace tests;
  15.  
  16. [STAThreadAttribute]
  17. int main(array<System::String ^> ^args)
  18. {
  19.         // Enabling Windows XP visual effects before any controls are created
  20.         Application::EnableVisualStyles();
  21.         Application::SetCompatibleTextRenderingDefault(false);
  22.  
  23.         // Create the main window and run it
  24.         Application::Run(gcnew Form1());
  25.  
  26.         /*     
  27.         bool done=0; Form1 f; f.Show();
  28.         while(!done){ if((bool)GetAsyncKeyState(VK_ESCAPE)){ MessageBox::Show("Click!"); done=true; } }
  29.         */
  30.  
  31.         return 0;
  32. }
  33. ///// Form1.h
  34.  
  35.  
  36. #include "form2.h"
  37. namespace tests {
  38.  
  39.         using namespace System;
  40.         using namespace System::ComponentModel;
  41.         using namespace System::Collections;
  42.         using namespace System::Windows::Forms;
  43.         using namespace System::Data;
  44.         using namespace System::Drawing;
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.         /// <summary>
  53.         /// Summary for Form1
  54.         ///
  55.         /// WARNING: If you change the name of this class, you will need to change the
  56.         ///          'Resource File Name' property for the managed resource compiler tool
  57.         ///          associated with all .resx files this class depends on.  Otherwise,
  58.         ///          the designers will not be able to interact properly with localized
  59.         ///          resources associated with this form.
  60.         /// </summary>
  61.         public ref class Form1 : public System::Windows::Forms::Form
  62.         {
  63.         public:
  64.                 Form1(void)
  65.                 {
  66.                         InitializeComponent();
  67.                         //
  68.                         //TODO: Add the constructor code here
  69.                         //
  70.                 }
  71.  
  72.         protected:
  73.                 /// <summary>
  74.                 /// Clean up any resources being used.
  75.                 /// </summary>
  76.                 ~Form1()
  77.                 {
  78.                         if (components)
  79.                         {
  80.                                 delete components;
  81.                         }
  82.                 }
  83.         private: System::Windows::Forms::Button^  button1;
  84.         private: System::Windows::Forms::PictureBox^  pictureBox1;
  85.         protected:
  86.  
  87.         private:
  88.                 /// <summary>
  89.                 /// Required designer variable.
  90.                 /// </summary>
  91.                 System::ComponentModel::Container ^components;
  92.  
  93. #pragma region Windows Form Designer generated code
  94.                 /// <summary>
  95.                 /// Required method for Designer support - do not modify
  96.                 /// the contents of this method with the code editor.
  97.                 /// </summary>
  98.                 void InitializeComponent(void)
  99.                 {
  100.                         this->button1 = (gcnew System::Windows::Forms::Button());
  101.                         this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
  102.                         (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox1))->BeginInit();
  103.                         this->SuspendLayout();
  104.                         //
  105.                         // button1
  106.                         //
  107.                         this->button1->Location = System::Drawing::Point(12, 448);
  108.                         this->button1->Name = L"button1";
  109.                         this->button1->Size = System::Drawing::Size(128, 59);
  110.                         this->button1->TabIndex = 0;
  111.                         this->button1->Text = L"screenshot";
  112.                         this->button1->UseVisualStyleBackColor = true;
  113.                         this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
  114.                         //
  115.                         // pictureBox1
  116.                         //
  117.                         this->pictureBox1->ImageLocation = L"System.Drawing.screenshot";
  118.                         this->pictureBox1->Location = System::Drawing::Point(12, 12);
  119.                         this->pictureBox1->Name = L"pictureBox1";
  120.                         this->pictureBox1->Size = System::Drawing::Size(568, 430);
  121.                         this->pictureBox1->TabIndex = 1;
  122.                         this->pictureBox1->TabStop = false;
  123.                         this->pictureBox1->Click += gcnew System::EventHandler(this, &Form1::pictureBox1_Click);
  124.                         //
  125.                         // Form1
  126.                         //
  127.                         this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  128.                         this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  129.                         this->ClientSize = System::Drawing::Size(592, 519);
  130.                         this->Controls->Add(this->pictureBox1);
  131.                         this->Controls->Add(this->button1);
  132.                         this->Name = L"Form1";
  133.                         this->Text = L"Form1";
  134.                         this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
  135.                         (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox1))->EndInit();
  136.                         this->ResumeLayout(false);
  137.  
  138.                 } 
  139.  
  140. #pragma endregion
  141.         private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
  142.  
  143.                                  tests::form2 f;   f.Show();
  144.  
  145.                          }
  146.         private: System::Void pictureBox1_Click(System::Object^  sender, System::EventArgs^  e) {
  147.                          }
  148.         private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
  149.                          }
  150. };
  151. }
  152.  
  153. /// form2.h is same as Form1.h

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@


Remember my settings