473,320 Members | 1,870 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,320 software developers and data experts.

fatal error CVT1100: duplicate resource. type:ICON, name:1, langua

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 can do the following:
1) Create a test Visual C++ MFC Application Project with the default
configuration settings.
2) On the main menu, go to Project\Add New Item, then select Resource File
(.rc), name it something like MyResourceFile.
3) A file named Resource1.h is automatically created as the associated
header to MyResourceFile.rc, open this file and change
_APS_NEXT_RESOURCE_VALUE 101 value to 1001 to make any new resource ID's
unique.
3) In the Resource View, add an icon resource to MyResourceFile and just
save the blank icon.
4) Now rebuild the project and BOOM.

Thanks for any input,
Danny Pressley

Jul 21 '05 #1
11 13034
Hi Denny,
..., Any ideas why this error is occuring?

To generate the issue real quick, you can do the following:
...


I am unable to repro that fatal error with the above repro steps unless I
insert a new icon resource in the original resource file(AppName.rc), so
the exact problem here is that you have mutilple .rc files in your project
and each has a same type resource(note, I mean the same type resource, not
the same resource ID, in your case it is the icon type resource).

This could be verified this by removing the icon resource in one of your
rc files and inserting a new version resource to your second .rc file,
then you will get the same error with the duplicate resource. type:VERSION).

So while including mutilple resource files in the project, it is better to
avoid inserting a certain type of resource into more than one resource
files.
Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 21 '05 #2
Hi Gary,
So while including mutilple resource files in the project, it is better to
avoid inserting a certain type of resource into more than one resource
files.


I also have the same issue with a version block and string table. I just
mentioned only the icon in my explanation.

This is very puzzling why this is not possible with only some of the
resource types and not all. So to me this seems to be a bug in the Visual C++
compiler.

I have searched and searched the documentation and cannot find any
description of this not being supported. Would you please point me to the
documentation on why this is not allowed?

Regards,
Danny

P.S. here is the exact steps I use to generate a test app to generate the bug
1) Use VS.NET 2003
2) Create a new project: File\New Project\Visual C++ Projects\MFC\MFC
Application
3) Name the project Test1 and press "Ok"
4) When the app wizard pops up just press "Finish"
5) Create a new resource file: Projects\Add New Item\Visual C++\Resource
File (.rc)
6) Name the resource MyResourceFile and press "Open"
7) Go to the Solution Explorer and open Resource1.h
8) Change the values 101 to 1001, 40001 to 50001, 1001 to 10001, and 101 to
1001
9) Save the changes in Resource1.h
10) Go to the Resource View and highlight MyResourceFile.rc
11) Right click and select "Add Resource" and add an icon
12) Rebuild the project and BOOM
Jul 21 '05 #3
>I have searched and searched the documentation and cannot find any
description of this not being supported. Would you please point me to the
documentation on why this is not allowed?


yes Denny, there is no public documentation about this problem, I have also
consulted it with our product development guys to confirm this issue, I
will update when I got any results.
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 21 '05 #4
> yes Denny, there is no public documentation about this problem, I have also
consulted it with our product development guys to confirm this issue, I
will update when I got any results.


Thanks Gary. I hope you find out something soon, as I am getting close to
having to make a descision on the development path for the product. My goal
was to have independent modules that consist of a view/frame/doc with each
module having its own resource file that contains the modules respective
icon, menu, toolbar, and ... .

Best Regards,
Danny

Jul 21 '05 #5
Hi Deeny,

I got it, we will update you as soon as possible.
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 21 '05 #6
Hi Danny,

Sorry for the late response, these days we are contacting our product
develop team to investigate this issue, it appear such behavior is by
design in our VS.NET's resource compiler, now they are looking for some
workarounds on this problem, I will reply you with more information in a
few days.

Thanks for your patience!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 21 '05 #7
Hi Danny,

Now I got the confirmation from our product team, this is really a resource
compiler/OS limitation. Currently the linker doesn't support multiple rc
files - and for the icon resource specificly, it should be because of an
RT_GROUP_ICON created for each icon and these conflict across multiple rc
files.
..., My goal was to have independent modules that consist of
a view/frame/doc with each module having its own resource
file that contains the modules respective icon, menu, toolbar, and ...


So with current VC resource compiler, I am afraid there is no way to do
this, but our product team members will fix it in the future. We are
looking at continual improvement, and it's this kind of feedback that let's
us know what things you're trying to do, that we haven't yet exposed for
you.

Thanks for your understanding and patience!
Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 21 '05 #8
Bummer! Didn't want to hear that. It was going to be a very clean way to
isolate a doc/view/frame module for plug and play into an MDI framework app.

So I take it the engineers did not have any suggestions for a work around?

Regards,
Danny

Jul 21 '05 #9
Hi Danny,

Thanks for coming back to this issue!

The following is more detail info on the root cause of this problem:
"Basically what's happening is that Icon resources are composed of two
different Win32 resource types ¨C RT_GROUP_ICON and RT_ICON. You can think
of RT_GROUP_ICON as a directory of RT_ICON resources. The RT_ICON
resources are the actual icon images.

The VC resource editor tries to simplify this for you in a single icon
resource entity and under the hood handles some things like creation and ID
naming of the individual RT_ICON resources (the #1 you're seeing in this
case). The VC resource editor was also created back in the day when it was
only possible to have a single .rc file in a given .exe or .dll. Changes
have since been made in the command line tools to allow use of multiple .rc
files to contribute to a given .exe or .dll but I don¡¯t believe the
resource editor implementation was ever revisited with this new possibility
in mind, at least from the standpoint of the way it handles icons.

So with the current VC++ compiler,the only thing that can be done in this
case if you want to have multiple resource files is to keep all icon (and
cursor) resources in a single .rc file. That will let the VC resource
editor keep all the RT_ICON identifiers unique."

Wish this helps and thanks for your understanding!
Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 21 '05 #10
Thanks for the in-depth description Gary. Yes fixing this issue in the future
would be beneficial. Seems like the only need is to add a new tag that can be
used in the projects main .rc file that identifies the ICON group (or other
resource types) as the primary set, that way the resource compiler will know
which resources are for the apps default set and just append any other
resources from other resource files to the directory.

I found a simply work around for now. Please let me know if you or the
development team see an issue with doing this because in my opinion its just
tricking the resource compiler into doing what I want. It seems to work just
fine, but I am worried that something may bite me in the behind sometime down
the road when I least expect it (like VC8 or ...).

1) Go to Solution Explorer.
2) Right click MyResourceFile.rc and select Properties.
3) Change "Exclude From Build" to Yes.
4) Open your projects .rc2 file for text editing.
5) Add #include "..\MyResourceFile.rc".
6) Rebuild all and now things work (or seem to).

I am able to use the icon's in the second resource file now
(MyResourceFile.rc). But as I stated, I am worried since normally VC doesn't
allow two resource files with icons in each to compile legally.

My next step is to try some tests to move the second resource file to a DLL
along with the source for the doc/view/frame and dynamically at runtime,
actually load the doc/view/frame and its associated resources (icon, menu,
toolbars, formview, ...). If you or the development team have any opinion on
doing this, I would like to hear them, otherwse, wish me luck.

Regards,
Danny

Jul 21 '05 #11
Hi Danny,

Glad to see you're making progress!
1) Go to Solution Explorer.
2) Right click MyResourceFile.rc and select Properties.
3) Change "Exclude From Build" to Yes.
4) Open your projects .rc2 file for text editing.
5) Add #include "..\MyResourceFile.rc".
6) Rebuild all and now things work (or seem to).

I am able to use the icon's in the second resource file now
(MyResourceFile.rc). But as I stated, I am worried since normally VC doesn'tallow two resource files with icons in each to compile legally.
From the workaround above, I think you don't need to worry about it--- you
just inclde/merge your second resource file into your project's original
resouce file, so in this scenario, your project only has the original
resouce file to compile.

My next step is to try some tests to move the second resource file to a DLLalong with the source for the doc/view/frame and dynamically at runtime,
actually load the doc/view/frame and its associated resources (icon, menu,
toolbars, formview, ...).


It would be OK, you can create a resouce-only DLL to add your second
resource file, and the application could call LoadLibrary to explicitly
link to that DLL. Then the application would call the generic functions
FindResource and LoadResource to access the resources at run-time, please
refer to the following MSDN doc for more detailed info:

Create a Resource-Only DLL
http://msdn.microsoft.com/library/de...us/vccore98/HT
ML/_core_create_a_resource.2d.only_dll.asp

I hope the above information helps, if you have any questions or concerns,
please do not hesitate to let me know. I am standing by to help you.
Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 21 '05 #12

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

Similar topics

0
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...
2
by: Rogerio Jun | last post by:
Can i add a embedded resource icon in my application in run time ? Rogerio
3
by: Tom wilson | last post by:
Resources 'Beneficiary.aspx.resx' and 'OveraAge.aspx.resx' have the same manifest resource name 'Enroll.Beneficiary.resources'. Umm... what's this mean? The first two are aspx page resource...
11
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...
2
by: news | last post by:
I just upgraded to PHP 4.4.2 on my Slackware 10.2 system. And Apache/mySQL/PHP all work great through a browser. No errors. But when I try to run a PHP script through the command line, which I...
0
by: Johan P | last post by:
Having just compiled DBG 2.15.1 and trying to use it with PHP (cli) give some some problem. Verions: DBG 2.15.1 PHP 4.4.4 (cli) It works fine compiled with the Apache module but when I try...
2
by: =?Utf-8?B?R3JlZw==?= | last post by:
I've added some ICO Images to some buttons on my forms. I added them by selecting an Image via the "Select Resource" window. Anyway, all of my images are working just fine, I am getting a WARNING...
1
by: suthakar | last post by:
Hai whenever i connect the coaxial cable(phone wire) in my pc for my internet Connection it shows a warning A system Error, Duplicate name exists on the network, due to this network problems,...
1
by: mohanprasadgutta | last post by:
hello, I am trying to add a new resource name to a ms project task. but the newly added resource name is reflecting for all the mpp file. If i want to make it appear only for that particular...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.