An Exception of type System.Exception was thrown when I am trying to open an already created window form in designer mode. This problem is coming when I am trying to open any window form which I have already created, in designer mode. I don't know why this error is coming. I need to edit my forms but I am not able to do so.. Please help me.......
This is the call Stack output in designer mode.....
at VSLangProj.Reference.get_Path() at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_FileName() at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.GetMatchIndex(String typeName) at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchNormalEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, Boolean fastSearch) at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreCase, Assembly& assembly, ReferenceType refType) at Microsoft.VisualStudio.Design.VSTypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, ReferenceType refType) at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase) at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name) at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.GetType(String typeName) at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager) at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager) at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager) at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
Below is one of the form's header file and its C++ file code.....
WelcomeWindow.h
#ifndef WELCOMEWINDOW_H
#define WELCOMEWINDOW_H
#pragma once
#include "test_open.h"
namespace open_image {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
public ref class WelcomeWindow : public System::Windows::Forms::Form
{
public:
WelcomeWindow(void);
protected:
~WelcomeWindow();
private: System::Windows::Forms::Label^ label1;
protected:
private: System::Windows::Forms::Button^ continue_btn;
private: System::Windows::Forms::Button^ exit_btn;
private:
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(WelcomeWindow::typeid));
this->label1 = (gcnew System::Windows::Forms::Label());
this->continue_btn = (gcnew System::Windows::Forms::Button());
this->exit_btn = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
this->label1->AutoSize = true;
this->label1->BackColor = System::Drawing::SystemColors::GrayText;
this->label1->Font = (gcnew System::Drawing::Font(L"Monotype Corsiva", 21.75F, static_cast<System::Drawing::FontStyle>((System::Drawing::FontStyle::Bold | System::Drawing::FontStyle::Italic)),
System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0)));
this->label1->Location = System::Drawing::Point(0, 0);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(136, 36);
this->label1->TabIndex = 0;
this->label1->Text = L"Welcome...";
this->continue_btn->BackColor = System::Drawing::SystemColors::GrayText;
this->continue_btn->Font = (gcnew System::Drawing::Font(L"Bookman Old Style", 9, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->continue_btn->Location = System::Drawing::Point(479, 402);
this->continue_btn->Name = L"continue_btn";
this->continue_btn->Size = System::Drawing::Size(81, 32);
this->continue_btn->TabIndex = 1;
this->continue_btn->Text = L"Continue";
this->continue_btn->UseVisualStyleBackColor = false;
this->continue_btn->Click += gcnew System::EventHandler(this, &WelcomeWindow::continue_btn_Click);
this->exit_btn->BackColor = System::Drawing::SystemColors::GrayText;
this->exit_btn->Font = (gcnew System::Drawing::Font(L"Bookman Old Style", 9, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->exit_btn->Location = System::Drawing::Point(560, 402);
this->exit_btn->Name = L"exit_btn";
this->exit_btn->Size = System::Drawing::Size(65, 32);
this->exit_btn->TabIndex = 2;
this->exit_btn->Text = L"Exit";
this->exit_btn->UseVisualStyleBackColor = false;
this->exit_btn->Click += gcnew System::EventHandler(this, &WelcomeWindow::exit_btn_Click);
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(630, 441);
this->Controls->Add(this->exit_btn);
this->Controls->Add(this->continue_btn);
this->Controls->Add(this->label1);
this->Name = L"WelcomeWindow";
this->Text = L"WelcomeWindow";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void exit_btn_Click(System::Object^ sender, System::EventArgs^ e);
private: System::Void continue_btn_Click(System::Object^ sender, System::EventArgs^ e);
};
}
#endif
WelcomeWindow.cpp
#include "stdafx.h"
#include "WelcomeWindow.h"
#include "test_open.h"
namespace open_image
{
WelcomeWindow::WelcomeWindow(void)
{
InitializeComponent();
}
WelcomeWindow::~WelcomeWindow()
{
if (components)
{
delete components;
}
}
public ref class container
{
public:
static test_open^ t = gcnew test_open();
};
System::Void WelcomeWindow::exit_btn_Click(System::Object^ sender, System::EventArgs^ e) {
this->Close();
exit(1);
}
System::Void WelcomeWindow::continue_btn_Click(System::Object^ sender, System::EventArgs^ e) {
this->Hide();
container::t->Show();
}
}