Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 584
  • Last Modified:

resrc1.h file creation

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?
0
SteH
Asked:
SteH
  • 15
  • 6
  • 6
3 Solutions
 
AndyAinscowCommented:
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?)
0
 
Jaime OlivaresCommented:
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.
0
 
SteHAuthor Commented:
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.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Jaime OlivaresCommented:
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.

0
 
SteHAuthor Commented:
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.
0
 
AndyAinscowCommented:
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.
0
 
SteHAuthor Commented:
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.
0
 
AndyAinscowCommented:
Back to my first comment - it could be an intermediate file.  Do you still get it if you have you anti virus software disabled?
0
 
SteHAuthor Commented:
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.
0
 
SteHAuthor Commented:
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).
0
 
Jaime OlivaresCommented:
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
0
 
SteHAuthor Commented:
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.
0
 
Jaime OlivaresCommented:
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.
0
 
SteHAuthor Commented:
Thx, a newly created dialog based app with english selected as language makes the different language parts disappear in the rc file.
0
 
SteHAuthor Commented:
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.
0
 
SteHAuthor Commented:
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?
0
 
Jaime OlivaresCommented:
I experience the same with my projects in spanish, I always have to specify language in properties toolwindow for every resource I insert.
0
 
SteHAuthor Commented:
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.
0
 
Jaime OlivaresCommented:
I think those resource without specific language are considered Neutral
0
 
AndyAinscowCommented:
<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).
0
 
SteHAuthor Commented:
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!
0
 
AndyAinscowCommented:
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.
0
 
SteHAuthor Commented:
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?
0
 
SteHAuthor Commented:
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.
0
 
SteHAuthor Commented:
I think I got a lot of answers now so its time to provide points.
0
 
SteHAuthor Commented:
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?
0
 
AndyAinscowCommented:
Will MS do updates on that for VS 6?

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 15
  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now