How can I properly set the Root Namespace property in a C ++ / CLI application?

I have a C ++ / CLI application in Visual Studio 2008 whose namespace follows the .NET directive CompanyName.TechnologyName[.Feature][.Design]. The problem is that there seems to be no way to set a multi-level namespace in the project's Root Namespace property. I tried both CompanyName.TechnologyName, and CompanyName::TechnologyName.

It seems that I cannot have a Form control inside the namespace that is not the root namespace, as this leads to the resources that it uses cannot be found, so it seems to me impossible to follow their recommendations and fit my applications WITH#.

Is there a way to set this property to use multi-level namespaces, or am I forced to use a root namespace that is just single-level? Or is there a solution I am missing?

Edit:
Functionality added in Visual Studio 2010 to allow multilevel root namespaces. Use the CompanyName.TechnologyNameNOT format CompanyName::TechnologyName. Although the latter works for / create / forms, if your forms require resources, then at compilation Visual Studio tries to save to CompanyName::TechnologyName.resources, which throws an error.

+3
source share
1 answer

, . " ". ++ , . :

namespace Contoso {
  namespace Accounting  {
    namespace PayRoll {
      namespace Employees {

  // class declarations go here

}}}}  // yeah, that sux

.cpp:

using namespace Contoso::Accounting::PayRoll::Employees;

, , . , . ++ IDE . Windows Forms ++/CLI , , .

0

Source: https://habr.com/ru/post/1746457/


All Articles