You are currently browsing the Boolog posts tagged: Visual Studio


Visual Studio’s resource editor fails to open a Form because the class is not the first class in the header file (C++/CLI)

Suppose you have a following header file and tries to open it in the resource editor of Visual Studio.

namespace Ambiesoft {
	using namespace System;
 
	ref class EncComboItem;
	ref class CSearchURL;
 
	ref class AddHttpDicDialog : public System::Windows::Forms::Form
	{
		...
	}
}

You might have an error like this.

The forward references (ref class) causes this. To fix this, separate them into another files.

In headerref.h (newly created)

#pragma once
namespace Ambiesoft {
	ref class EncComboItem;
	ref class CSearchURL;
}

In the original header,

#include "headerref.h"
 
namespace Ambiesoft {
	using namespace System;
 
	ref class AddHttpDicDialog : public System::Windows::Forms::Form
	{
		...
	}
}

Differences of Command prompt of Visual Studio

There are many kind of shortcuts of command prompt of Visual Studio. Basically the differences are the setting of Host and Target. Host refers to the compiler or linker of which 64bit or 32bit is chosen. Target refers to the resultant exe or dll which is targeted 64bit or 32bit.

Developer Command Prompt for VS 2017 (default)

Host:32bit
Target:32bit

x64 Native Tools Command Prompt for VS 2017

Host:64bit
Target:64bit

x64_x86 Cross Tools Command Prompt for VS 2017

Host:64bit
Target:32bit

x86 Native Tools Command Prompt for VS 2017

Same as the default.

x86_x64 Cross Tools Command Prompt for VS 2017

Host:32bit
Target:64bit