Web Browser in Visual C++

importing a var. into the URL

Page 1 of 1

8 Replies - 5250 Views - Last Post: 05 April 2010 - 06:46 AM

#1 shaunarman   User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 64
  • Joined: 21-January 10

Web Browser in Visual C++

Posted 04 April 2010 - 09:34 PM

I am working on a project where you find the lat. and long. points. I would like the result of this to be entered into the URL for my web browser. I have tried many different thing, the one that has gotten me the closest is in my code below. I am still getting errors but I can't figure out what to do from here.
#pragma once


namespace LATLONGProgram {

	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 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::NumericUpDown^  numlatdeg1;
	private: System::Windows::Forms::NumericUpDown^  numlatmin1;
	private: System::Windows::Forms::NumericUpDown^  numlatsec1;
	protected: 

	protected: 




	private: System::Windows::Forms::NumericUpDown^  numlongdeg1;
	private: System::Windows::Forms::NumericUpDown^  numlongmin1;
	private: System::Windows::Forms::NumericUpDown^  numlongsec1;



	private: System::Windows::Forms::NumericUpDown^  numlatdeg2;
	private: System::Windows::Forms::NumericUpDown^  numlatmin2;
	private: System::Windows::Forms::NumericUpDown^  numlatsec2;



	private: System::Windows::Forms::NumericUpDown^  numlongdeg2;
	private: System::Windows::Forms::NumericUpDown^  numlongmin2;
	private: System::Windows::Forms::NumericUpDown^  numlongsec2;





	protected: 

	protected: 











	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::Label^  label2;
	private: System::Windows::Forms::Label^  label3;
	private: System::Windows::Forms::Label^  label4;
	private: System::Windows::Forms::Button^  btncompute;

	private: System::Windows::Forms::Label^  label5;
	private: System::Windows::Forms::Label^  label6;
	private: System::Windows::Forms::Label^  label7;
	private: System::Windows::Forms::Label^  label8;
	private: System::Windows::Forms::Label^  label9;

	private:
		/// <summary>
		/// Required designer variable.

		Double Latlongtotal,Dlat,Dlong,Cosval,
		       latdeg1,latmin1,latsec1,
               latdeg2,latmin2,latsec2,
			   longdeg1,longmin1,longsec1,
               longdeg2,longmin2,longsec2,
			   degT1,latT1,longT1,
			   degT2,latT2,longT2;

	private: System::Windows::Forms::ToolTip^  toolTip1;
	private: System::Windows::Forms::ImageList^  img1;
	private: System::Windows::Forms::Button^  btnexit;
	private: System::Windows::Forms::Label^  label10;
	private: System::Windows::Forms::Label^  label11;
	private: System::Windows::Forms::Label^  label12;
	private: System::Windows::Forms::NotifyIcon^  notifyIcon1;
	private: System::Windows::Forms::WebBrowser^  web;


	private: System::ComponentModel::IContainer^  components;
			 /// </summary>


#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());
		System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
		this->numlatdeg1 = (gcnew System::Windows::Forms::NumericUpDown());
		this->numlatmin1 = (gcnew System::Windows::Forms::NumericUpDown());
		this->numlatsec1 = (gcnew System::Windows::Forms::NumericUpDown());
		this->numlongdeg1 = (gcnew System::Windows::Forms::NumericUpDown());
		this->numlongmin1 = (gcnew System::Windows::Forms::NumericUpDown());
		this->numlongsec1 = (gcnew System::Windows::Forms::NumericUpDown());
		this->numlatdeg2 = (gcnew System::Windows::Forms::NumericUpDown());
		this->numlatmin2 = (gcnew System::Windows::Forms::NumericUpDown());
		this->numlatsec2 = (gcnew System::Windows::Forms::NumericUpDown());
		this->numlongdeg2 = (gcnew System::Windows::Forms::NumericUpDown());
		this->numlongmin2 = (gcnew System::Windows::Forms::NumericUpDown());
		this->numlongsec2 = (gcnew System::Windows::Forms::NumericUpDown());
		this->label1 = (gcnew System::Windows::Forms::Label());
		this->label2 = (gcnew System::Windows::Forms::Label());
		this->label3 = (gcnew System::Windows::Forms::Label());
		this->label4 = (gcnew System::Windows::Forms::Label());
		this->btncompute = (gcnew System::Windows::Forms::Button());
		this->label5 = (gcnew System::Windows::Forms::Label());
		this->label6 = (gcnew System::Windows::Forms::Label());
		this->label7 = (gcnew System::Windows::Forms::Label());
		this->label8 = (gcnew System::Windows::Forms::Label());
		this->label9 = (gcnew System::Windows::Forms::Label());
		this->toolTip1 = (gcnew System::Windows::Forms::ToolTip(this->components));
		this->img1 = (gcnew System::Windows::Forms::ImageList(this->components));
		this->btnexit = (gcnew System::Windows::Forms::Button());
		this->label10 = (gcnew System::Windows::Forms::Label());
		this->label11 = (gcnew System::Windows::Forms::Label());
		this->label12 = (gcnew System::Windows::Forms::Label());
		this->notifyIcon1 = (gcnew System::Windows::Forms::NotifyIcon(this->components));
		this->web = (gcnew System::Windows::Forms::WebBrowser());
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlatdeg1))->BeginInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlatmin1))->BeginInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlatsec1))->BeginInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlongdeg1))->BeginInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlongmin1))->BeginInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlongsec1))->BeginInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlatdeg2))->BeginInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlatmin2))->BeginInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlatsec2))->BeginInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlongdeg2))->BeginInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlongmin2))->BeginInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlongsec2))->BeginInit();
		this->SuspendLayout();
		// 
		// numlatdeg1
		// 
		this->numlatdeg1->Location = System::Drawing::Point(58, 35);
		this->numlatdeg1->Margin = System::Windows::Forms::Padding(2);
		this->numlatdeg1->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {90, 0, 0, 0});
		this->numlatdeg1->Name = L"numlatdeg1";
		this->numlatdeg1->Size = System::Drawing::Size(40, 20);
		this->numlatdeg1->TabIndex = 0;
		this->toolTip1->SetToolTip(this->numlatdeg1, L"<-90,90>");
		// 
		// numlatmin1
		// 
		this->numlatmin1->Location = System::Drawing::Point(103, 35);
		this->numlatmin1->Margin = System::Windows::Forms::Padding(2);
		this->numlatmin1->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60, 0, 0, 0});
		this->numlatmin1->Name = L"numlatmin1";
		this->numlatmin1->Size = System::Drawing::Size(39, 20);
		this->numlatmin1->TabIndex = 1;
		this->toolTip1->SetToolTip(this->numlatmin1, L"<0,60>");
		// 
		// numlatsec1
		// 
		this->numlatsec1->Location = System::Drawing::Point(147, 35);
		this->numlatsec1->Margin = System::Windows::Forms::Padding(2);
		this->numlatsec1->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60, 0, 0, 0});
		this->numlatsec1->Name = L"numlatsec1";
		this->numlatsec1->Size = System::Drawing::Size(37, 20);
		this->numlatsec1->TabIndex = 2;
		this->toolTip1->SetToolTip(this->numlatsec1, L"<0,60>");
		// 
		// numlongdeg1
		// 
		this->numlongdeg1->Location = System::Drawing::Point(58, 85);
		this->numlongdeg1->Margin = System::Windows::Forms::Padding(2);
		this->numlongdeg1->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {360, 0, 0, 0});
		this->numlongdeg1->Name = L"numlongdeg1";
		this->numlongdeg1->Size = System::Drawing::Size(40, 20);
		this->numlongdeg1->TabIndex = 3;
		this->toolTip1->SetToolTip(this->numlongdeg1, L"<-180,180>");
		// 
		// numlongmin1
		// 
		this->numlongmin1->Location = System::Drawing::Point(103, 85);
		this->numlongmin1->Margin = System::Windows::Forms::Padding(2);
		this->numlongmin1->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60, 0, 0, 0});
		this->numlongmin1->Name = L"numlongmin1";
		this->numlongmin1->Size = System::Drawing::Size(39, 20);
		this->numlongmin1->TabIndex = 4;
		this->toolTip1->SetToolTip(this->numlongmin1, L"<0,60>");
		// 
		// numlongsec1
		// 
		this->numlongsec1->Location = System::Drawing::Point(147, 85);
		this->numlongsec1->Margin = System::Windows::Forms::Padding(2);
		this->numlongsec1->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60, 0, 0, 0});
		this->numlongsec1->Name = L"numlongsec1";
		this->numlongsec1->Size = System::Drawing::Size(37, 20);
		this->numlongsec1->TabIndex = 5;
		this->toolTip1->SetToolTip(this->numlongsec1, L"<0,60>");
		// 
		// numlatdeg2
		// 
		this->numlatdeg2->Location = System::Drawing::Point(235, 37);
		this->numlatdeg2->Margin = System::Windows::Forms::Padding(2);
		this->numlatdeg2->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {90, 0, 0, 0});
		this->numlatdeg2->Name = L"numlatdeg2";
		this->numlatdeg2->Size = System::Drawing::Size(40, 20);
		this->numlatdeg2->TabIndex = 6;
		this->toolTip1->SetToolTip(this->numlatdeg2, L"<-90,90>");
		// 
		// numlatmin2
		// 
		this->numlatmin2->Location = System::Drawing::Point(280, 37);
		this->numlatmin2->Margin = System::Windows::Forms::Padding(2);
		this->numlatmin2->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60, 0, 0, 0});
		this->numlatmin2->Name = L"numlatmin2";
		this->numlatmin2->Size = System::Drawing::Size(39, 20);
		this->numlatmin2->TabIndex = 7;
		this->toolTip1->SetToolTip(this->numlatmin2, L"<0,60>");
		// 
		// numlatsec2
		// 
		this->numlatsec2->Location = System::Drawing::Point(324, 36);
		this->numlatsec2->Margin = System::Windows::Forms::Padding(2);
		this->numlatsec2->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60, 0, 0, 0});
		this->numlatsec2->Name = L"numlatsec2";
		this->numlatsec2->Size = System::Drawing::Size(37, 20);
		this->numlatsec2->TabIndex = 8;
		this->toolTip1->SetToolTip(this->numlatsec2, L"<0,60>");
		// 
		// numlongdeg2
		// 
		this->numlongdeg2->Location = System::Drawing::Point(235, 84);
		this->numlongdeg2->Margin = System::Windows::Forms::Padding(2);
		this->numlongdeg2->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {360, 0, 0, 0});
		this->numlongdeg2->Name = L"numlongdeg2";
		this->numlongdeg2->Size = System::Drawing::Size(40, 20);
		this->numlongdeg2->TabIndex = 9;
		this->toolTip1->SetToolTip(this->numlongdeg2, L"<-180,180>");
		// 
		// numlongmin2
		// 
		this->numlongmin2->Location = System::Drawing::Point(280, 84);
		this->numlongmin2->Margin = System::Windows::Forms::Padding(2);
		this->numlongmin2->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60, 0, 0, 0});
		this->numlongmin2->Name = L"numlongmin2";
		this->numlongmin2->Size = System::Drawing::Size(39, 20);
		this->numlongmin2->TabIndex = 10;
		this->toolTip1->SetToolTip(this->numlongmin2, L"<0,60>");
		// 
		// numlongsec2
		// 
		this->numlongsec2->Location = System::Drawing::Point(324, 84);
		this->numlongsec2->Margin = System::Windows::Forms::Padding(2);
		this->numlongsec2->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {60, 0, 0, 0});
		this->numlongsec2->Name = L"numlongsec2";
		this->numlongsec2->Size = System::Drawing::Size(37, 20);
		this->numlongsec2->TabIndex = 11;
		this->toolTip1->SetToolTip(this->numlongsec2, L"<0,60>");
		// 
		// label1
		// 
		this->label1->AutoSize = true;
		this->label1->BackColor = System::Drawing::SystemColors::ActiveCaptionText;
		this->label1->ForeColor = System::Drawing::Color::Lime;
		this->label1->Location = System::Drawing::Point(12, 37);
		this->label1->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
		this->label1->Name = L"label1";
		this->label1->Size = System::Drawing::Size(27, 13);
		this->label1->TabIndex = 12;
		this->label1->Text = L"LAT";
		// 
		// label2
		// 
		this->label2->AutoSize = true;
		this->label2->BackColor = System::Drawing::SystemColors::ActiveCaptionText;
		this->label2->ForeColor = System::Drawing::Color::Lime;
		this->label2->Location = System::Drawing::Point(12, 87);
		this->label2->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
		this->label2->Name = L"label2";
		this->label2->Size = System::Drawing::Size(37, 13);
		this->label2->TabIndex = 13;
		this->label2->Text = L"LONG";
		// 
		// label3
		// 
		this->label3->AutoSize = true;
		this->label3->BackColor = System::Drawing::SystemColors::ActiveCaptionText;
		this->label3->ForeColor = System::Drawing::Color::Lime;
		this->label3->Location = System::Drawing::Point(192, 37);
		this->label3->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
		this->label3->Name = L"label3";
		this->label3->Size = System::Drawing::Size(27, 13);
		this->label3->TabIndex = 14;
		this->label3->Text = L"LAT";
		// 
		// label4
		// 
		this->label4->AutoSize = true;
		this->label4->BackColor = System::Drawing::Color::Black;
		this->label4->ForeColor = System::Drawing::Color::Lime;
		this->label4->Location = System::Drawing::Point(192, 85);
		this->label4->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
		this->label4->Name = L"label4";
		this->label4->Size = System::Drawing::Size(37, 13);
		this->label4->TabIndex = 15;
		this->label4->Text = L"LONG";
		// 
		// btncompute
		// 
		this->btncompute->BackColor = System::Drawing::Color::DeepPink;
		this->btncompute->Location = System::Drawing::Point(280, 331);
		this->btncompute->Margin = System::Windows::Forms::Padding(2);
		this->btncompute->Name = L"btncompute";
		this->btncompute->Size = System::Drawing::Size(80, 32);
		this->btncompute->TabIndex = 16;
		this->btncompute->Text = L"COMPUTE";
		this->toolTip1->SetToolTip(this->btncompute, L"DISTANCE BETWEEN POINTS:");
		this->btncompute->UseVisualStyleBackColor = false;
		this->btncompute->Click += gcnew System::EventHandler(this, &Form1::btncompute_Click);
		// 
		// label5
		// 
		this->label5->AutoSize = true;
		this->label5->BackColor = System::Drawing::SystemColors::ControlLightLight;
		this->label5->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10.2F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
			static_cast<System::Byte>(0)));
		this->label5->Location = System::Drawing::Point(73, 10);
		this->label5->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
		this->label5->Name = L"label5";
		this->label5->Size = System::Drawing::Size(85, 17);
		this->label5->TabIndex = 17;
		this->label5->Text = L"Start Point";
		// 
		// label6
		// 
		this->label6->AutoSize = true;
		this->label6->BackColor = System::Drawing::SystemColors::ControlLightLight;
		this->label6->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10.2F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
			static_cast<System::Byte>(0)));
		this->label6->Location = System::Drawing::Point(250, 10);
		this->label6->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
		this->label6->Name = L"label6";
		this->label6->Size = System::Drawing::Size(90, 17);
		this->label6->TabIndex = 18;
		this->label6->Text = L"Destination";
		// 
		// label7
		// 
		this->label7->AutoSize = true;
		this->label7->BackColor = System::Drawing::Color::Chartreuse;
		this->label7->Location = System::Drawing::Point(60, 64);
		this->label7->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
		this->label7->Name = L"label7";
		this->label7->Size = System::Drawing::Size(30, 13);
		this->label7->TabIndex = 19;
		this->label7->Text = L"DEG";
		// 
		// label8
		// 
		this->label8->AutoSize = true;
		this->label8->BackColor = System::Drawing::Color::Chartreuse;
		this->label8->Location = System::Drawing::Point(108, 64);
		this->label8->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
		this->label8->Name = L"label8";
		this->label8->Size = System::Drawing::Size(27, 13);
		this->label8->TabIndex = 20;
		this->label8->Text = L"MIN";
		// 
		// label9
		// 
		this->label9->AutoSize = true;
		this->label9->BackColor = System::Drawing::Color::Chartreuse;
		this->label9->Location = System::Drawing::Point(151, 63);
		this->label9->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
		this->label9->Name = L"label9";
		this->label9->Size = System::Drawing::Size(28, 13);
		this->label9->TabIndex = 21;
		this->label9->Text = L"SEC";
		// 
		// img1
		// 
		this->img1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"img1.ImageStream")));
		this->img1->TransparentColor = System::Drawing::Color::Transparent;
		this->img1->Images->SetKeyName(0, L"latlong2.gif");
		this->img1->Images->SetKeyName(1, L"latlong2.gif");
		// 
		// btnexit
		// 
		this->btnexit->BackColor = System::Drawing::Color::White;
		this->btnexit->Location = System::Drawing::Point(11, 336);
		this->btnexit->Margin = System::Windows::Forms::Padding(2);
		this->btnexit->Name = L"btnexit";
		this->btnexit->Size = System::Drawing::Size(39, 23);
		this->btnexit->TabIndex = 22;
		this->btnexit->Text = L"EXIT";
		this->btnexit->UseVisualStyleBackColor = false;
		this->btnexit->Click += gcnew System::EventHandler(this, &Form1::btnexit_Click);
		// 
		// label10
		// 
		this->label10->AutoSize = true;
		this->label10->BackColor = System::Drawing::Color::Chartreuse;
		this->label10->Location = System::Drawing::Point(328, 64);
		this->label10->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
		this->label10->Name = L"label10";
		this->label10->Size = System::Drawing::Size(28, 13);
		this->label10->TabIndex = 25;
		this->label10->Text = L"SEC";
		// 
		// label11
		// 
		this->label11->AutoSize = true;
		this->label11->BackColor = System::Drawing::Color::Chartreuse;
		this->label11->Location = System::Drawing::Point(285, 65);
		this->label11->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
		this->label11->Name = L"label11";
		this->label11->Size = System::Drawing::Size(27, 13);
		this->label11->TabIndex = 24;
		this->label11->Text = L"MIN";
		// 
		// label12
		// 
		this->label12->AutoSize = true;
		this->label12->BackColor = System::Drawing::Color::Chartreuse;
		this->label12->Location = System::Drawing::Point(237, 65);
		this->label12->Margin = System::Windows::Forms::Padding(2, 0, 2, 0);
		this->label12->Name = L"label12";
		this->label12->Size = System::Drawing::Size(30, 13);
		this->label12->TabIndex = 23;
		this->label12->Text = L"DEG";
		// 
		// notifyIcon1
		// 
		this->notifyIcon1->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"notifyIcon1.Icon")));
		this->notifyIcon1->Text = L"notifyIcon1";
		this->notifyIcon1->Visible = true;
		this->notifyIcon1->MouseDoubleClick += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::notifyIcon1_MouseDoubleClick);
		// 
		// web
		// 
		this->web->Location = System::Drawing::Point(0, 137);
		this->web->MinimumSize = System::Drawing::Size(20, 20);
		this->web->Name = L"web";
		this->web->Size = System::Drawing::Size(370, 174);
		this->web->TabIndex = 26;
		this->web->Url = (gcnew System::Uri(L"", System::UriKind::Relative));
		this->web->DocumentCompleted += gcnew System::Windows::Forms::WebBrowserDocumentCompletedEventHandler(this, &Form1::web_DocumentCompleted);
		// 
		// Form1
		// 
		this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
		this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
		this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"$this.BackgroundImage")));
		this->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Stretch;
		this->ClientSize = System::Drawing::Size(371, 370);
		this->Controls->Add(this->web);
		this->Controls->Add(this->label10);
		this->Controls->Add(this->label11);
		this->Controls->Add(this->label12);
		this->Controls->Add(this->btnexit);
		this->Controls->Add(this->label9);
		this->Controls->Add(this->label8);
		this->Controls->Add(this->label7);
		this->Controls->Add(this->label6);
		this->Controls->Add(this->label5);
		this->Controls->Add(this->btncompute);
		this->Controls->Add(this->label4);
		this->Controls->Add(this->label3);
		this->Controls->Add(this->label2);
		this->Controls->Add(this->label1);
		this->Controls->Add(this->numlongsec2);
		this->Controls->Add(this->numlongmin2);
		this->Controls->Add(this->numlongdeg2);
		this->Controls->Add(this->numlatsec2);
		this->Controls->Add(this->numlatmin2);
		this->Controls->Add(this->numlatdeg2);
		this->Controls->Add(this->numlongsec1);
		this->Controls->Add(this->numlongmin1);
		this->Controls->Add(this->numlongdeg1);
		this->Controls->Add(this->numlatsec1);
		this->Controls->Add(this->numlatmin1);
		this->Controls->Add(this->numlatdeg1);
		this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
		this->Margin = System::Windows::Forms::Padding(2);
		this->MaximizeBox = false;
		this->MinimizeBox = false;
		this->Name = L"Form1";
		this->SizeGripStyle = System::Windows::Forms::SizeGripStyle::Hide;
		this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
		this->Text = L"LAT LONG DISTANCE";
		this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlatdeg1))->EndInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlatmin1))->EndInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlatsec1))->EndInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlongdeg1))->EndInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlongmin1))->EndInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlongsec1))->EndInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlatdeg2))->EndInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlatmin2))->EndInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlatsec2))->EndInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlongdeg2))->EndInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlongmin2))->EndInit();
		(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->numlongsec2))->EndInit();
		this->ResumeLayout(false);
		this->PerformLayout();

			}
#pragma endregion
	
		

private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) 
		 {
		 //Play song at program load
		 //String to contain a .wav file
		 String^ strCarmin = gcnew String("C:\\Users\\Shaun\\Documents\\Visual Studio 2008\\Projects\\LAT LONG Program\\LAT LONG Program\\Where in the world.wav");
		 //Create an instance of the SoundPlayer
		 System::Media::SoundPlayer sndPlayer(strCarmin);
		 //Play the .wav file
		 sndPlayer.Play();
			 }
           //EXTRA POINTS tooltips,exit button,image change, audio intro, notify icon
private: System::Void btncompute_Click(System::Object^  sender, System::EventArgs^  e) 
		 
  {
	  this->BackgroundImage = img1->Images[1];
		   //DEGREE CONVERT TO HOURS

               latdeg1 = (Convert::ToDouble(numlatdeg1->Value));              
               latdeg2 = (Convert::ToDouble(numlatdeg2->Value));              
               longdeg1 = (Convert::ToDouble(numlongdeg1->Value));               
               longdeg2 = (Convert::ToDouble(numlongdeg2->Value));

	      //DEGREE CONVERT TO MINUTES

               latmin1 = (Convert::ToDouble(numlatmin1->Value)) / 60;	       
               latmin2 = (Convert::ToDouble(numlatmin2->Value)) / 60;	        
		       longmin1 =(Convert::ToDouble(numlongmin1->Value)) / 60;                
               longmin2 =(Convert::ToDouble(numlongmin2->Value)) / 60;                      

          //DEGREE CONVERT TO SECONDS

               latsec1 = (Convert::ToDouble(numlatsec1->Value)) / 3600;
               latsec2 = (Convert::ToDouble(numlatsec2->Value)) / 3600;			 
               longsec1 = (Convert::ToDouble(numlongsec1->Value)) / 3600;		  
		       longsec2 = (Convert::ToDouble(numlongsec2->Value)) / 3600;			  

          //CALCULATE DEG,MIN,SEC FROM DEGREE ENTERED

              latT1 = (latdeg1) + (latmin1) + (latsec1);
              latT2 = (latdeg2) + (latmin2) + (latsec2);
              longT1 = (longdeg1) + (longmin1) + (longsec1);			   
              longT2 = (longdeg2) + (longmin2) + (longsec2);

          //CALCULATE LATITUDE

			   if   (latT1 > 0);             
			   else (latT1 = (latdeg1) - (latmin1) - (latsec1));             
			   if   (latT2 > 0);			   
			   else (latT2 = (latdeg2) - (latmin2) - (latsec2));
               
		  //CALCULATE LONGITUDE

               if   (longT1 > 0);
     		   else (longT1 = (longdeg1) - (longmin1) - (longsec1));
               if   (longT2 > 0);
     		   else (longT2 = (longdeg2) - (longmin2) - (longsec2));             

          //COMBINE N/S/E/W TO STRING
          
			//POINT 1
              if ((latT1 > 0)&&(longT1 > 0))
               MessageBox::Show(String::Concat("POINT 1 DEGREE IS ( ",latT1.ToString()," N , ",longT1.ToString()," E )"));
              if ((latT1 > 0)&&(longT1 < 0))
               MessageBox::Show(String::Concat("POINT 1 DEGREE IS ( ",latT1.ToString()," N , ",longT1.ToString()," W )"));
              if ((latT1 < 0)&&(longT1 > 0))
                MessageBox::Show(String::Concat("POINT 1 DEGREE IS ( ",latT1.ToString()," S , ",longT1.ToString()," E )"));
			  if ((latT1 < 0)&&(longT1 < 0))
                MessageBox::Show(String::Concat("POINT 1 DEGREE IS ( ",latT1.ToString()," S , ",longT1.ToString()," W )"));

           //POINT 2
		      if ((latT2 > 0)&&(longT2 > 0))
               MessageBox::Show(String::Concat("POINT 2 DEGREE IS ( ",latT2.ToString()," N , ",longT2.ToString()," E )"));
              if ((latT2 > 0)&&(longT2 < 0))
               MessageBox::Show(String::Concat("POINT 2 DEGREE IS ( ",latT2.ToString()," N , ",longT2.ToString()," W )"));
              if ((latT2 < 0)&&(longT2 > 0))
                MessageBox::Show(String::Concat("POINT 2 DEGREE IS ( ",latT2.ToString()," S , ",longT2.ToString()," E )"));
			  if ((latT2 < 0)&&(longT2 < 0))
                MessageBox::Show(String::Concat("POINT 2 DEGREE IS ( ",latT2.ToString()," S , ",longT2.ToString()," W )"));		      		  
			  
		  //CONVERT 4 (LAT) DISTANCE:

                 Dlat = (latT2 - latT1) * 69.1;          
               Cosval = (latT1 / 57.3);         
			   Cosval =  System::Math::Cos(Cosval);          

         //CONVERT 4 (LONG) DISTANCE:

			    Dlong = 69.1 * (longT2 - longT1) * Cosval;
		                      
         //CONVERT 4 (LAT + LONG) TOTAL DISTANCE:

		      Latlongtotal =   Dlat * Dlat + Dlong * Dlong;
              Latlongtotal =  (System::Math::Sqrt(Latlongtotal));
			  //int Latlongtotal = Latlongtotal;
         
			 
         MessageBox::Show(String::Concat(Latlongtotal.ToString(),"  DISTANCE/MILES"));
            


            //MessageBox::Show(String::Concat(Dlong.ToString()," DEGREES LONG"));

		    //MessageBox::Show(String::Concat(Cosval.ToString(),"  COS"));
		   
			//MessageBox::Show(String::Concat(Dlat.ToString(),"  DEGREES LAT"));

       

		    
  }

private: System::Void btnexit_Click(System::Object^  sender, System::EventArgs^  e) 
		 {
			 this->Close();
		 }
private: System::Void notifyIcon1_MouseDoubleClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) 
			 {
			 Close();
			 }
private: System::Void web_DocumentCompleted(System::Object^  sender, System::Windows::Forms::WebBrowserDocumentCompletedEventArgs^  e) 
			 {			 
			 this->web->Url = (gcnew System::Uri(L"http://mapserver.mytopo.com/homepage/index.cfm?lat=",latT2.ToString(),"&",longT2.ToString(),"&scale=25000&type=1&zoom=100&bpid=MAP0060030900&latlontype=DMS&searchscope=dom&CFID=4774130&CFTOKE", System::UriKind::Absolute));
			 }
};
}




Is This A Good Question/Topic? 0
  • +

Replies To: Web Browser in Visual C++

#2 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Web Browser in Visual C++

Posted 04 April 2010 - 09:44 PM

First and foremost what are the errors this code is producing, this will help those who are trying to help dicide which direction to take :)
Was This Post Helpful? 0
  • +
  • -

#3 shaunarman   User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 64
  • Joined: 21-January 10

Re: Web Browser in Visual C++

Posted 04 April 2010 - 10:05 PM

View PostPsychoCoder, on 04 April 2010 - 08:44 PM, said:

First and foremost what are the errors this code is producing, this will help those who are trying to help dicide which direction to take :)

I have changed this line of code to
private: System::Void web_DocumentCompleted(System::Object^  sender, System::Windows::Forms::WebBrowserDocumentCompletedEventArgs^  e) 
			 {			 
			 this->web->Url = (gcnew System::Uri(L"http://mapserver.mytopo.com/homepage/index.cfm?lat=",Convert::ToDouble(latT2),"&",Convert::ToDouble(longT2),"&scale=25000&type=1&zoom=100&bpid=MAP0060030900&latlontype=DMS&searchscope=dom&CFID=4774130&CFTOKE", System::UriKind::Absolute));
			 }

This is the error I get

error C2661: 'System::Uri::Uri' : no overloaded function takes 5 arguments
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: Web Browser in Visual C++

Posted 05 April 2010 - 05:33 AM

Is this
L"http://mapserver.mytopo.com/homepage/index.cfm?lat=",Convert::ToDouble(latT2),"&",Convert::ToDouble(longT2),"&scale=25000&type=1&zoom=100&bpid=MAP0060030900&latlontype=DMS&searchscope=dom&CFID=4774130&CFTOKE"
how you concatenate a String in C++?
Was This Post Helpful? 0
  • +
  • -

#5 shaunarman   User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 64
  • Joined: 21-January 10

Re: Web Browser in Visual C++

Posted 05 April 2010 - 05:51 AM

View PostJackOfAllTrades, on 05 April 2010 - 04:33 AM, said:

Is this
L"http://mapserver.mytopo.com/homepage/index.cfm?lat=",Convert::ToDouble(latT2),"&",Convert::ToDouble(longT2),"&scale=25000&type=1&zoom=100&bpid=MAP0060030900&latlontype=DMS&searchscope=dom&CFID=4774130&CFTOKE"
how you concatenate a String in C++?

I tried it like that but still got an error, somthing like I need a ")" before Convert::To....
Was This Post Helpful? 0
  • +
  • -

#6 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: Web Browser in Visual C++

Posted 05 April 2010 - 06:18 AM

I asked you is that how you put strings together in C++? With commas? If you're not sure, you need to figure out how to do that.
Was This Post Helpful? 0
  • +
  • -

#7 shaunarman   User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 64
  • Joined: 21-January 10

Re: Web Browser in Visual C++

Posted 05 April 2010 - 06:36 AM

You put a string by saying
 Convert::ToString(0;
,latT2->Text,
latT2.ToString


I cant get anything to work.
Was This Post Helpful? 0
  • +
  • -

#8 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: Web Browser in Visual C++

Posted 05 April 2010 - 06:40 AM

Then go read.
Was This Post Helpful? 0
  • +
  • -

#9 shaunarman   User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 64
  • Joined: 21-January 10

Re: Web Browser in Visual C++

Posted 05 April 2010 - 06:46 AM

You know you could say that i am close or way off, some kind of help.
And I have been trying to read up on the topic, but most everything I find is in C++ not VIsuial C++
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1