473,396 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Changing default namespace in assembly

In the explanation to the ToolboxBitmapAttribute it is mentioned that new
bitmaps added to an assembly by Visual Studio .NET get the name of the
default namespace prepened to the name of the bitmap, and that the default
namespace is the assembly name. It then mentions that one can change the
default namespace through a project property, but there is no project
property to change this in VC++ .NET projects. Is there a way to chaneg the
default namespace in VC++ .NET IDE projects ?
Nov 17 '05 #1
3 2596
"Edward Diener" <ed******@tropicsoft.com> wrote in
news:Oa**************@TK2MSFTNGP14.phx.gbl:
In the explanation to the ToolboxBitmapAttribute it is mentioned
that new bitmaps added to an assembly by Visual Studio .NET get
the name of the default namespace prepened to the name of the
bitmap, and that the default namespace is the assembly name. It
then mentions that one can change the default namespace through
a project property, but there is no project property to change
this in VC++ .NET projects. Is there a way to chaneg the default
namespace in VC++ .NET IDE projects ?


This behavior is only for VB and C#. When you select "embed" for
bitmap files in C# or VB, the build system automatically creates a
namespace.filename.bmp file for you and embeds that as a resource
in the final assembly. This is different for C++. The
documentation you were reading is incomplete. Can you point me to
the documentaiton you were referring to so that I can make sure
that gets fixed.

For C++, to embed a resource, you need to add the bitmap file to
your project then pass a /ASSEMBLYREFERNCE:filename.bmp to the
linker (this is a property on the linker section of the project
property pages). ToolboxBitmapAttribute("filename.bmp") would just
work then.

Thanks,
--
Tarek Madkour, Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers
no rights.
Nov 17 '05 #2
Tarek Madkour [MSFT] wrote:
"Edward Diener" <ed******@tropicsoft.com> wrote in
news:Oa**************@TK2MSFTNGP14.phx.gbl:
In the explanation to the ToolboxBitmapAttribute it is mentioned
that new bitmaps added to an assembly by Visual Studio .NET get
the name of the default namespace prepened to the name of the
bitmap, and that the default namespace is the assembly name. It
then mentions that one can change the default namespace through
a project property, but there is no project property to change
this in VC++ .NET projects. Is there a way to chaneg the default
namespace in VC++ .NET IDE projects ?
This behavior is only for VB and C#. When you select "embed" for
bitmap files in C# or VB, the build system automatically creates a
namespace.filename.bmp file for you and embeds that as a resource
in the final assembly. This is different for C++. The
documentation you were reading is incomplete. Can you point me to
the documentaiton you were referring to so that I can make sure
that gets fixed.


The documentation on the web for MSDN, at
http://msdn.microsoft.com/library/de...ctortopic2.asp
does have "[C#]" for the explanation while my own local documentation, which
is an earlier version of the library, did not. Therefore I consider this my
error for not checking the online documentation first.

For C++, to embed a resource, you need to add the bitmap file to
your project then pass a /ASSEMBLYREFERNCE:filename.bmp to the
linker (this is a property on the linker section of the project
property pages). ToolboxBitmapAttribute("filename.bmp") would just
work then.


Thanks for the explanation. It needs to be in the official documentation. I
assume that the bitmap file needs to be added as a managed resource. This is
another area where I do not believe there is any explanation of how to add a
managed resource to a C++ project in the VS Studio IDE.
Nov 17 '05 #3
"Edward Diener" <ed******@tropicsoft.com> wrote in
news:uH**************@tk2msftngp13.phx.gbl:
Thanks for the explanation. It needs to be in the official
documentation.
Yes. I'm forwarding this to our writers.
I assume that the bitmap file needs to be added as a managed
resource. This is another area where I do not believe there is
any explanation of how to add a managed resource to a C++
project in the VS Studio IDE.


You either need to pass the .bmp file to the linker using the
/ASSEMBLYREFERENCE argument or you can create a .resx file and
have it link to the .bmp file.

VS2005 makes managing managed resources using .resx files a lot
simpler.

Thanks,
--
Tarek Madkour, Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers
no rights.
Nov 17 '05 #4

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

Similar topics

0
by: Robert-Paul | last post by:
Hi there. I have a problem after changing the assembly name of a class library. I have two projects in one solution: - a Windows application (.exe) - Class Library. There is a references...
3
by: Tank | last post by:
How do I get the default namespace of the project programatically ? For example, the following code loads the embedded resource in the assembly and "MyNS" is the default namespace. ...
4
by: dhnriverside | last post by:
HI guys I've just written my first independent namespace for my library (yay me!). However, on trying to add it to my website project, it causes an error when I look at the website. It compiles...
1
by: Phill. W | last post by:
Having changed a VB.Net(2003) DLL project, I'm getting Type Loading problems in other code that uses my DLL. In my source code, I have a Namespace Statement something like this: Namespace...
2
by: Jeff Brown | last post by:
Hi, I suspect that this isn't possible, but I figured I'd ask. My project has a root namespace, let's say it's "Root", that applies to almost every source file (which is why I've set it as the...
4
by: jj | last post by:
I have an Assembly object that I need to get a resource stream from. The name of the resource is of course based upon the default namespace, not the assembly name. Is there a way to use reflection...
1
by: =?Utf-8?B?U2hhcm9u?= | last post by:
How can I get the default namespace of my executable assembly at runtime? -- Thanks Sharon
8
by: puzzlecracker | last post by:
/*1 not specified*/class { /*2 not specified*/ void Foo(){} } Will they, like in c++, default to private? Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.