473,765 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Resource in a dll

Hi,

I have an application that works fine when compiled as an executable.

But it is designed to be a plugin also at the same time, by compiling it
as a dll. I have a problem with resources when compiled as DLL. The
error always says there is no resource file named
"TESTNS.Toolbar .resources" - but it is definetly there. Is there a huge
difference in the linker producing a dll or an executable concerning
resources?? I assume it is something about the namespace, is this possible?

Thanks for your help,

Martin
Nov 17 '05 #1
10 1303
Hi Martin,
I have a problem with resources when compiled as DLL. The error always says there is no resource file named "TESTNS.Toolbar .resources" - but it is
definetly there.


Is the "TESTNS.Toolbar .resources" an assembly resource file?
Do you mean it is still listed in the project's solution explorer window?

If so, how about remove it firstly then add it again(by using "Adding
Existed Items...")?
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #2
Hi Gary,
Is the "TESTNS.Toolbar .resources" an assembly resource file?
Do you mean it is still listed in the project's solution explorer window? No, it is a .resx-File(containing icons) which resides in the VC.NET
project.
By error I meant an exception is thrown, when the application is loaded
as a plugin inside the plughost. There is no error if executed and
compiled as an exe-file. The exception even occures if I explicitely
link the resource-file into the project, and at this point I got
completely confused, about what is going on...

Is the problem maybe in one of this lines??

System::Globali zation::Culture Info* ci =
System::Threadi ng::Thread::Cur rentThread->CurrentCulture ;

//this is the point where the application crashes when compiled as dll
System::Resourc es::ResourceMan ager *tbMan =
new System::Resourc es::ResourceMan ager(S"TESTNS.T oolbar", asmTESTNS);

//This happens 18 times for all the Icons included
imgLToolBar->Images->Add(static_cas t<System::Drawi ng::Icon*>(tbMa n->GetObject(S"Pe ople")));
If so, how about remove it firstly then add it again(by using "Adding
Existed Items...")?

Already tried this one. I'm working with VS for 6 yrs. - I'm used to
quiet some freaky behaviour....
Nov 17 '05 #3
Hi Martin,

Thanks for your detail information, we will perform some investigation on
this problem and reply you as soon as possible.
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #4
Hi Martin,

In order to isolate your problem effectively, would you please upload a
small self-alone project(zipped) to us if possible?(you can send it as an
attchment with reply this message or just email to me, juse remove the
"online" phase of my emaill address)
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #5
Hi Gary,

Sorry, I forgot to post a final reply.

I created a new project and inserted everything manually - afterwards it
worked fine. I don't really understand what the difference is since all
the settings are the same...

Thanks alot for your support. Have a look at the "using Forms in a DLL"
thread, I posted couple things in there.

It seems like the resource file was included in the manifest, but the
images where empty. One of the problems might have been the
$(SafeInputName )-Macro, but I'm not sure at all. If I experience this
type of behaviour again, I will email it to you. Further I will check
whether I can extract a copy from the nightly backup, if I can do so I
will email the whole project to you.

Regards,

Martin

Gary Chang wrote:
Hi Martin,

In order to isolate your problem effectively, would you please upload a
small self-alone project(zipped) to us if possible?(you can send it as an
attchment with reply this message or just email to me, juse remove the
"online" phase of my emaill address)
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #6
Got mine to work. Really friggin weird.

The name of the project MUST MATCH the name of your root namespace. In my case, my project name was MAP, and the root namespace I was using was ROFMap. The form was ROFMap::frmView Map. The manifest root (looking in the dll) was MAP. The second exe (that was inheriting from the first) was looking for MAP.frmViewMap. resource. I ended up changing the name of the project from MAP to ROFMap and recompiled. Everything works fine now....

I guess the moral of the story is don't change what MS puts in the form at all ;)
Ok, really. The project name and the namespace root must match inorder for everything to work well. Give it a try.

GE

PS> I created two little test programs to try this. If this is EXACTLY your problem, I'll upload them so they can look at it..

"mphanke" wrote:
Hi Gary,

Sorry, I forgot to post a final reply.

I created a new project and inserted everything manually - afterwards it
worked fine. I don't really understand what the difference is since all
the settings are the same...

Thanks alot for your support. Have a look at the "using Forms in a DLL"
thread, I posted couple things in there.

It seems like the resource file was included in the manifest, but the
images where empty. One of the problems might have been the
$(SafeInputName )-Macro, but I'm not sure at all. If I experience this
type of behaviour again, I will email it to you. Further I will check
whether I can extract a copy from the nightly backup, if I can do so I
will email the whole project to you.

Regards,

Martin

Gary Chang wrote:
Hi Martin,

In order to isolate your problem effectively, would you please upload a
small self-alone project(zipped) to us if possible?(you can send it as an
attchment with reply this message or just email to me, juse remove the
"online" phase of my emaill address)
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #7

I finally got mine to work (After amonth of fiddle with is). My project name was MAP, and the root namespace I was using was ROFMap (Important). So the form in question was ROFMap::frmView Map. The second EXE (Which was inheriting from frmViewMap) was actually looking for RootNamespace.F ormName.resourc es (ROFMAP.frmView Map.resources). It couldn't find this, because the rootnamespace is taken from the projectname (MAP). So my second project was looking for MAP.frmViewMap. resources.

I went back and renamed my initial DLL project to ROFMap, and recompiled. Everything came up the first time (Well, after the thunderstorm messed with my puters).

For your project to work, your project name has to be TESTNS. I would change this to your project name and try again.

GE

PS> If you look in the dll, the manifest will not show exactly what resources are in it.

"mphanke" wrote:
Hi Gary,

Sorry, I forgot to post a final reply.

I created a new project and inserted everything manually - afterwards it
worked fine. I don't really understand what the difference is since all
the settings are the same...

Thanks alot for your support. Have a look at the "using Forms in a DLL"
thread, I posted couple things in there.

It seems like the resource file was included in the manifest, but the
images where empty. One of the problems might have been the
$(SafeInputName )-Macro, but I'm not sure at all. If I experience this
type of behaviour again, I will email it to you. Further I will check
whether I can extract a copy from the nightly backup, if I can do so I
will email the whole project to you.

Regards,

Martin

Gary Chang wrote:
Hi Martin,

In order to isolate your problem effectively, would you please upload a
small self-alone project(zipped) to us if possible?(you can send it as an
attchment with reply this message or just email to me, juse remove the
"online" phase of my emaill address)
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #8

SOrry if this posts 3 times. I kept getting an error trying to post (Not in IE, but as a reply from microsoft).
I finally got mine to work (After amonth of fiddle with is). My project name was MAP, and the root namespace I was using was ROFMap (Important). So the form in question was ROFMap::frmView Map. The second EXE (Which was inheriting from frmViewMap) was actually looking for RootNamespace.F ormName.resourc es (ROFMAP.frmView Map.resources). It couldn't find this, because the rootnamespace is taken from the projectname (MAP). So my second project was looking for MAP.frmViewMap. resources.

I went back and renamed my initial DLL project to ROFMap, and recompiled. Everything came up the first time (Well, after the thunderstorm messed with my puters).

For your project to work, your project name has to be TESTNS. I would change this to your project name and try again.

GE

PS> If you look in the dll, the manifest will not show exactly what resources are in it.

"mphanke" wrote:
Hi Gary,

Sorry, I forgot to post a final reply.

I created a new project and inserted everything manually - afterwards it
worked fine. I don't really understand what the difference is since all
the settings are the same...

Thanks alot for your support. Have a look at the "using Forms in a DLL"
thread, I posted couple things in there.

It seems like the resource file was included in the manifest, but the
images where empty. One of the problems might have been the
$(SafeInputName )-Macro, but I'm not sure at all. If I experience this
type of behaviour again, I will email it to you. Further I will check
whether I can extract a copy from the nightly backup, if I can do so I
will email the whole project to you.

Regards,

Martin

Gary Chang wrote:
Hi Martin,

In order to isolate your problem effectively, would you please upload a
small self-alone project(zipped) to us if possible?(you can send it as an
attchment with reply this message or just email to me, juse remove the
"online" phase of my emaill address)
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

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

Nov 17 '05 #9
Sorry for the multi post. When I hit post, it said it encountered an error and couldn't post. So I retried 2 more times.. I love technology!!!

GE

"mphanke" wrote:
Hi,

I have an application that works fine when compiled as an executable.

But it is designed to be a plugin also at the same time, by compiling it
as a dll. I have a problem with resources when compiled as DLL. The
error always says there is no resource file named
"TESTNS.Toolbar .resources" - but it is definetly there. Is there a huge
difference in the linker producing a dll or an executable concerning
resources?? I assume it is something about the namespace, is this possible?

Thanks for your help,

Martin

Nov 17 '05 #10

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

Similar topics

11
13168
by: Danny Pressley | last post by:
I have a VS.NET 2003 Visual C++ MFC Application Project in which I added a new resource file, I then added an icon to this new resource file and did a rebuild and got the following error: "fatal error CVT1100: duplicate resource. type:ICON, name:1, language:0x0409". But the resource ID is unique and only located in the new Resource1.h and MyResourceFile.rc files. Any ideas why this error is occuring? To generate the issue real quick, you...
5
1732
by: John Perks and Sarah Mount | last post by:
When handling resources in Python, where the scope of the resource is known, there seem to be two schools of thought: (1) Explicit: f = open(fname) try: # ... finally: f.close()
5
8230
by: Drew | last post by:
Assembly asm = Assembly.GetExecutingAssembly(); me = new Bitmap(asm.GetManifestResourceStream("me.gif")); I have used this before without any problem, but now I get: An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dll Additional information: 'null' is not a valid value for 'stream'.
0
2198
by: Johann Blake | last post by:
I'm having trouble grasping how ASP.NET correctly locates resources. There is plenty of documentation on this subject but some things are not clear at all. In my ASP.NET application, I have multiple web forms. When you compile the application, it creates a DLL. If you view this DLL using ILDASM (the manifest), it shows info about the resources stored in the DLL. There is essentially an embedded resource "section" for each web form. The...
7
2107
by: craig | last post by:
....quick question for anyone who might have some experience with .net resource files in VS 2003. I have an application that is not localized, but I would still like to be able to place all of the images that are used for icons across all of the forms in all of the assemblies in a single resource file so that swaping out an image in the resource file affects all localtions that it appears in the app. Is there a way to create a single...
13
3559
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains some javascript code that calls window.open. I pass the resource url of page B to Page A's window.open call. Page B is then loaded and executed but none of the server-side code is rendered. If I view the source of the page, the code (and page...
2
10751
by: WT | last post by:
Hello, Could we use 'Embedded resources' with resx files that contain text resources used in aspx pages with the syntaxe: Text="<%$ Resources:ResourcesMy,KEY1 %>" I tryed removing the App_GlobalResources folder, and after verifying thta my resources were correctly embedded in my dll, I get errors as if asp.net was
21
6791
by: DiAvOl | last post by:
Hello, I am using a simple php server that I wrote and have some questions related to the resource id's. When a new client connects to the server or the server opens a file the Resource id number increases normally, but when the server closes the socket and the file and then a new client connects or file opens, the Resource id still increases without reseting to the previous closed id's. For example:
12
5278
by: TS | last post by:
i have a need to possibly enable mutli language support. What benefit do i get by using a resource file instead of a custom xml solution? thanks!
0
1505
by: CSharper | last post by:
Just curious, When you are in IDE, you are able to add a resource to the project through resource tab. Later this resource can be accessed using the resource manager. One good thing about this approach is that, the resource file is build into the exe and using resource manager you can later get already added resource file back. Now is it possible to do that through programatically? I want to add a resource to the default resource (if I use...
0
10168
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
10008
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...
1
9959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6651
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
5279
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
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
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

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.