Question

resrc1.h file creation

Asked by: SteH

A dialog based app created using the app wizard contains as resource the res subdirectory and appname.rc and resource.h. But since while VS is creating resrc1.h (VC++ 6.0 SP5). I modified resource.h to assure unique IDs for all different (sub)dialogs to allow creating tooltips with string resource numbers identical to the control IDs. I don't know if this is the origin for creating resrc1.h in addition to resource.h. appname.rc is modified accordingly but all other source files which need resources have to include resource.h and resrc1.h from then on. And assuring unique IDs over 2 files seems more difficult than scanning a single file.

Does anyone know under which conditions this file gets created? Or better how to remove its necessity?

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-08-23 at 02:43:05ID21103387
Topic

Windows MFC Programming

Participating Experts
2
Points
500
Comments
27

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Resource.h File
    Hi, I have a dialog based app that has a four page property sheet and a lots of controls on it. I have just copied and pasted a couple of dialog boxes from another app into my dialog based app and now it is crashing. I am fairly certain that my code is right. I did stumble ac...
  2. ADO bug in VC++ 6 SP5 + Processor Pack
    I have recently installed both SP5 and the Processor Pack to visual C++ 6 and I am having the following problem. When an exception occurs inside a try catch block inside a function that calls ado methods the function crashes (in the debug build) on return. The following code ...
  3. Creation of INI files in VC++
    Dear Sir/Madam, How can I create my own ini file by VC++ code?I want create ny 1 own ini file and then write certain information in that.So how can I doi this?Which class and functions are there in VC++ for this purpose? Thank you in advance. ...
  4. VB and VC++
    Hi, What are the main differences between VB and VC++ ? Thanks.

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: AndyAinscowPosted on 2004-08-23 at 05:15:36ID: 11869408

I have VC 6 SP5, that still uses resource.h and haven't met this resrc1.h before.  (With the 1 in the name this sounds like an intermediate file - what happens if you disable your anti-virus software - is it norton?)

 

by: jaime_olivaresPosted on 2004-08-23 at 06:27:13ID: 11869993

Dont have found any mention to this file in the Microsoft documentation, but you can #include it inside your app.h file or even in the project's stdafx file.

 

by: SteHPosted on 2004-08-23 at 06:48:54ID: 11870223

I have just written a simple utility to sort/rearrange control IDs for subdialogs which
assures unique IDs
can manipulate tab order
observer command ranges
Then I would need what can still go into resource.h and what needs to be put in resrc1.h since latter seems to be a continuation of resource.h which is still needed. The idea adding resrc1.h (and resource.h) to stdafx.h file would at least eliminate the need to include them into every projects source file has the drawback that a complete recompile is necessary for every change of dialogs resources. Latter could be a big increase in delelopment time.

 

by: jaime_olivaresPosted on 2004-08-23 at 07:00:44ID: 11870338

I use to put manual resources or IDs in the res\myapp.rc2 file, never touch the resource.h file (unless the first time when migrating resource from other project). I assume the resrc1.h has the same mission.

 

by: SteHPosted on 2004-08-23 at 07:06:10ID: 11870389

Unfortunatly when adding string resources of copying controls from one (sub)dialog to another some control IDs got duplicated. How do you get them back to unique ones. I was left with duplicated ones even within a dialog resource. I wonder why the app still worked. And when you copy something from another app I see even more problems using cut and paste. The app wizard/class wizard is not very smart in that direction. Thats why I want to manipulate the resource.h file. Manual resource can be added to rc2 file no problem.

 

by: AndyAinscowPosted on 2004-08-23 at 07:33:41ID: 11870680

copy/cut & paste is a nuisance.  I usually check/modify resource.h by hand (save changes first else your manual changes can be overwritten).

This resrc1.h.  Are you creating it yourself?  I thought you had found it had been created automatically and wanted to know why and what its purpose was.

 

by: SteHPosted on 2004-08-23 at 07:52:14ID: 11870883

It is created automatically when adding (modifying?) resource IDs. It contains none or a single newly created resouce and the numbers to use for the next IDs to create. Those are in synch with resource.h and the additions from that file.

The purpose is not unclear. I want to know why it is created instead of using/continuing to use resource.h or if there is a hidden purpose for it.

 

by: AndyAinscowPosted on 2004-08-23 at 07:56:13ID: 11870932

Back to my first comment - it could be an intermediate file.  Do you still get it if you have you anti virus software disabled?

 

by: SteHPosted on 2004-08-23 at 07:59:15ID: 11870971

Yes. Virus scan was disabled and a string resource added and removed from project. This creates and almost empty resrc1.h file as posted above.

 

by: SteHPosted on 2004-08-23 at 08:35:56ID: 11871424

I think I found the problem. Some parts of appname.rc got removed. Those contained the TEXTINCLUDE defines thus resource.h and afxres.h where not found/parsed correctly. Restored this part from version control and now resource.h gets used as before.

So now I need to find out how that part is used. I had to change all resource by hand to be english (US). How can I make this default for an obviously located VC++ version. (XP and VC++ are english version but either might be localized back to english from swiss (german).

 

by: jaime_olivaresPosted on 2004-08-23 at 08:41:49ID: 11871502

About localizing: That will explain why you have duplicated resources (really them are not duplicated since have different languages).
When you create an application with appwizard, you specify default language.
I think you can change in your Project -> Settings -> Resource tab -> Language combo

 

by: SteHPosted on 2004-08-23 at 09:09:03ID: 11871865

I set all to english (US) but still some parts are in the appname.rc file of the home language model. No idea why I can't remove this since I don't want anything here. But the reason for creating resrc1.h was that the part

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE DISCARDABLE
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED
got mixed up. After I removed all parts referring to resrc1.h it said it could not save to resource.h invalid directory. Correction this from an old version solved this part. What I am left with is that I have an empty part with default language resources for the country the PC is standing in.

 

by: jaime_olivaresPosted on 2004-08-23 at 09:15:29ID: 11871962

Maybe starting a new project again and carefully setting proper language, before inserting your resources. Sometimes it is better to start with a clean project and paste all your code.

 

by: SteHPosted on 2004-08-23 at 09:47:04ID: 11872408

Thx, a newly created dialog based app with english selected as language makes the different language parts disappear in the rc file.

 

by: SteHPosted on 2004-08-23 at 09:50:10ID: 11872445

Not really. Just discovered that it seems to be the default icon which gets no language added to it. It is displayed with the wrong one in the property since before changing it to be english as well there were no two languages in the rc file. When setting the icons language from non displayed at the side of the resource but the wrong one in the property restores the two language version of the rc file.

 

by: SteHPosted on 2004-08-23 at 09:54:02ID: 11872486

Every new resource added is not displayed as english if not set to it. Even though the rc file contains no language seperation. Is that a feature?

 

by: jaime_olivaresPosted on 2004-08-23 at 10:18:52ID: 11872770

I experience the same with my projects in spanish, I always have to specify language in properties toolwindow for every resource I insert.

 

by: SteHPosted on 2004-08-23 at 10:21:53ID: 11872795

I am not really sure whether you would need. Only the value displayed as property is wrong since some of them are definitly english and the rc file contains only english language until you change the first resource to english.

 

by: jaime_olivaresPosted on 2004-08-23 at 10:27:51ID: 11872860

I think those resource without specific language are considered Neutral

 

by: AndyAinscowPosted on 2004-08-24 at 00:27:48ID: 11878654

<Every new resource added is not displayed as english if not set to it.>

There is a default language specified.  Every resource is of that default UNLESS  specified otherwise.  (step 1 in wizard for creating new project - combo at bottom for default language).

 

by: SteHPosted on 2004-08-24 at 00:33:47ID: 11878684

But the resources created by the wizard are displayed (in the resource view) as having that default language english US in my case. The property dialog shows the same for them. Newly added resources have no entry in the resource view and the default language of VS in the property dialog (german (switzerland) in my case) which is incorrect!

 

by: AndyAinscowPosted on 2004-08-24 at 01:40:08ID: 11879059

My previous comment turns out to be of dubious quality.  It seems to use the locale (control panel, regional options) as the defaut for new resources.   (Can't see the wood for the trees!).  Is yours set as german (swiss) ?   The resources language is only shown if the setting is different from that of the PC.

 

by: SteHPosted on 2004-08-24 at 01:49:27ID: 11879129

I hoped that everything is set to english (US). At least keyboard layout is. Where can I change the locale settings? One is for the OS I know. Can it be changed for VS?

 

by: SteHPosted on 2004-08-24 at 01:52:23ID: 11879158

I found it. Regional settings of WinXP were reset to german (Switzerland) I guess by some patches IT department did on the PC. I know I set to be US before.

 

by: SteHPosted on 2004-08-24 at 01:53:15ID: 11879169

I think I got a lot of answers now so its time to provide points.

 

by: SteHPosted on 2004-08-24 at 01:58:32ID: 11879222

And to summarize it seems to be that the property popup shows the OS locale if none is specified explicitly. This is for a app created to be of a different locale setting than that of the OS just wrong. The resource is of locale settings specified for the app as wanted.

Will MS do updates on that for VS 6?

 

by: AndyAinscowPosted on 2004-08-24 at 02:27:57ID: 11879414

Will MS do updates on that for VS 6?

personally snowballs in hell come to mind.  (ver 6 is old now)

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...