473,804 Members | 3,855 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing default namespace in assembly

In the explanation to the ToolboxBitmapAt tribute 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 2624
"Edward Diener" <ed******@tropi csoft.com> wrote in
news:Oa******** ******@TK2MSFTN GP14.phx.gbl:
In the explanation to the ToolboxBitmapAt tribute 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.filen ame.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 /ASSEMBLYREFERNC E:filename.bmp to the
linker (this is a property on the linker section of the project
property pages). ToolboxBitmapAt tribute("filena me.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******@tropi csoft.com> wrote in
news:Oa******** ******@TK2MSFTN GP14.phx.gbl:
In the explanation to the ToolboxBitmapAt tribute 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.filen ame.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 /ASSEMBLYREFERNC E:filename.bmp to the
linker (this is a property on the linker section of the project
property pages). ToolboxBitmapAt tribute("filena me.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******@tropi csoft.com> wrote in
news:uH******** ******@tk2msftn gp13.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
/ASSEMBLYREFEREN CE 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
1362
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 from the windows application to the class library. All the classes from the both projects are arranged by the same namespace.
3
7132
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. assembly.GetManifestResourceStream("MyNS.Test.Rtf"); I do not want to hardcode it. I wish to have something like this: assembly.GetManifestResourceStream(GetDefaultNameSpace()+".Test.Rtf");
4
1876
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 ok though... The error message is... "The located assembly's manifest definition with name 'HudsonNash.Utils.Security' does not match the assembly reference"
1
2061
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 XYZ.AProject but when I build the DLL project and open the resulting DLL up in ILDASM, the Namespace has been *translated* to "XYZ.Aproject".
2
1975
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 project's root namespace). However, the project also includes a couple of source files whose contents will live in an entirely different namespace, let's say the "Special"
4
7311
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 to get the default namesace? Thank you, jj
1
6916
by: =?Utf-8?B?U2hhcm9u?= | last post by:
How can I get the default namespace of my executable assembly at runtime? -- Thanks Sharon
8
4093
by: puzzlecracker | last post by:
/*1 not specified*/class { /*2 not specified*/ void Foo(){} } Will they, like in c++, default to private? Thanks
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9577
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10569
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10325
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6847
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5519
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
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 we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.