473,480 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem on defining Multiple Level Namespace (Company::Application::Components)

How can I define a multiple level namespace for my class?

I got compilation error using the "::" as separator:

namespace MyCompany::GenericApp::CommComponent
{
public __gc class WordReader
{
..........
}
}

However, I could define MyCompany.GenericApp.CommComponent on C#.
Nov 17 '05 #1
6 1221
On Mon, 26 Jan 2004 12:25:48 -0600, Sai Kit Tong wrote:
How can I define a multiple level namespace for my class? I got compilation error using the "::" as separator: namespace MyCompany::GenericApp::CommComponent
{
public __gc class WordReader
{
..........
}
} However, I could define MyCompany.GenericApp.CommComponent on C#.


Try

namespace MyCompany { namespace GenericApp { namespace CommComponent {
public __gc class WordReader
{
..........
};
}}} // MyCompany::GenericApp::CommComponent

HTH,
Tim
--
To email me, make the snot hot.
Nov 17 '05 #2
Hello Sai Kit,

Thanks for posting in the group.

Based on my understanding, now the issue is: How to define multiple level
namespace in VC.NET programming?

Tim has provided the resolution to it. I tested it on my side and it works
fine. For an example, if I create a C# client, after adding reference to
that DLL and add "using ***", we can call that class as:
MyCompany.GenericApp.CommComponent.Word Reader a = new
MyCompany.GenericApp.CommComponent.Word Reader();

If you have any more concerns on it, please feel free to post here.

By the way, we could send post notify emails to you when there are useful
replies for your post in the newsgroup. If you want to receive it in the
future, please register your no spam email alias at:
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 17 '05 #3
Hello Sai Kit,

How are things going? If you have any questions or concerns on implementing
muliple level namespace, please don't hesitate to let me know. I am happy
to be of assistance.

Thanks for participating the community.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 17 '05 #4
I also have tried this and failed but I have a further problems.

My .NET control will no longer open in the Design window if I have more
that one level of namespace as you suggested
(CompanyName::Technology::ComponentGrouping) .
It gives the error: "The designer could not be shown for this file
because none of the classes within it can be designed."

Why does it complain - the code is legal C++? Is this a known problem?
It doesn't appear on the knowledge base.

I have found a workaround using a preprocessor macro to collapse the
namespaces for the designer but that causes a flow-on hassle, the
control ends up with the wrong full name in the toolbox. Oh well.

Based on my understanding, now the issue is: How to define multiple level
namespace in VC.NET programming?

Tim has provided the resolution to it. I tested it on my side and it works
fine. For an example, if I create a C# client, after adding reference to
that DLL and add "using ***", we can call that class as:
MyCompany.GenericApp.CommComponent.Word Reader a = new
MyCompany.GenericApp.CommComponent.Word Reader();


Nov 17 '05 #5
Hi Peter,

This may be related to another bug we have in this area (that we fail if you
try to put the control in the global namespace). I'll add this to that bug
so we can track this for the Whidbey release.

Ronald Laeremans
Visual C++ team

"Peter Bromley" <pb******@adi.co.nz> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I also have tried this and failed but I have a further problems.

My .NET control will no longer open in the Design window if I have more
that one level of namespace as you suggested
(CompanyName::Technology::ComponentGrouping) .
It gives the error: "The designer could not be shown for this file
because none of the classes within it can be designed."

Why does it complain - the code is legal C++? Is this a known problem?
It doesn't appear on the knowledge base.

I have found a workaround using a preprocessor macro to collapse the
namespaces for the designer but that causes a flow-on hassle, the
control ends up with the wrong full name in the toolbox. Oh well.

Based on my understanding, now the issue is: How to define multiple level namespace in VC.NET programming?

Tim has provided the resolution to it. I tested it on my side and it works fine. For an example, if I create a C# client, after adding reference to
that DLL and add "using ***", we can call that class as:
MyCompany.GenericApp.CommComponent.Word Reader a = new
MyCompany.GenericApp.CommComponent.Word Reader();

Nov 17 '05 #6
Cheers, and thanks

This may be related to another bug we have in this area (that we fail if you
try to put the control in the global namespace). I'll add this to that bug
so we can track this for the Whidbey release.

--
If you whish to reply to me directly, my addres is spam proofed as:

pbromley at adi dot co dot nz

Or if you prefer - no****@nowhere.com :-)
Nov 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
4567
by: mountain man | last post by:
Greetings to all database professionals and laymen, Let us make a bold assumption that we have developed a software tool for the SQL Server environment which simply acts as an interface between...
4
1939
by: Shawn Brock | last post by:
This is a wildly broad question, so apologies in advance. I developed a very traditional app architecture in Visual Studio 5-6. The basic structure looked like this: GUI >> MTS >> Database The...
3
2332
by: Steven Fox | last post by:
============================================================ About DB2 Administration Tools Environment ============================================================ DB2 administration tools level:...
1
1346
by: John Ortt | last post by:
Hi Everyone, I have a database which manages part vendors. I am trying to create a main navigation form which has three levels. The top level is simply a combo box with the entire list of part...
10
2481
by: paulw | last post by:
Hi Please give problems that "HAS TO" to use recursion (recursive calls to itself.) Preferrably real world examples, not knights tour. I'm thinking about eliminating the use of stack... ...
6
1416
by: Jared Turley | last post by:
I am currently having an issue with an ASP.NET page not finding the class library located in the application's /bin directory. The page recognizes the compiled .dll class when running on my...
10
2284
by: Tim Mulholland | last post by:
My company is about to begin working on an ASP.NET application. There are going to be two primary developers working on this project. It will be a fairly deep project (lots of lines of code) but...
4
5704
by: BookerW | last post by:
I am not sure which forum I should post this on, but here is the problem. I have a front end web application(VB) on asp,net 1.1 framework. Inside of the code, I have the following lines to...
9
5224
by: Coward 9 | last post by:
HI, I created the simplest "ASP .NET Web Service" by using VS 2005 and Visual C#( File | New | Web Site). However, when I tried to access the service from IE 7.0 ...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7043
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7081
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5336
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2984
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.