- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any way in (Compaq 6.6A) Visual Fortran to establish in advance the sequencing of resource/control identification numbers?
I want to calculate my way to which Dialog I should be using for a particular size of model, and I want to calculate my way to which Static or Edit boxes I should be using within the dialog.
Everything worked well immediately after I did my first set of these -- purely by accident, for I had no idea what the numbering protocols were all about -- because the sequencing took care of itself.
But now that I've created some additional resources/controls in the meantime, I can't go back and just pick up where I left off with the sequencing of the items I want to calculate my way to.
Is it permissible to simply edit the resource.h or resource.fd file, sort the items I want to sequence, and renumber them-- allof this outside the Developer Studio? Or would I just edit the resource.h and let the resource.fd take care of itself?
Insight that anyone might offer for this will be greatly appreciated!
Thanks and God bless!
Jack O'Sullivan
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Itis a VERY BAD IDEA to get involved, in any way, with the actual numerical values for dialog control identifiers, stringtable entries and the like as assigned by the IDE. Both DevStudio and VS follow indecipherable internal rules for generating these values, and also frequently assign duplicate values for controls in different dialogs. It is only by gross accident that sets of controls occasionally end up with identifier values in numeric sequence, and you should NEVER rely on this sort of thing in any program operations. There is also no guaranteethat the values of control identifiers will be the same from one compilation to the next.
One way to approach this programming issue is to create a separate array of identifiers, which isexplicitly loaded with the pre-defined values (whatever they are; the actual numbers become irrelevent) from the resource editor:
INTEGER,PARAMETER,DIMENSION(nc) :: mycont= &
(/ IDC_BUTTON22, IDC_BUTTON47, .... /)
where the IDC_* quantities are as (already) defined by the resource editor, with their values given in the (previously INCLUDEd)*.fd files. The ordering ofentries in mycont() can then implement your internal logical groupings and requirements, and your program can select sets of controls via their mycont() indices, in a manner which is now independent of any changes in the underlying identifier values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
... and just when I thought there might be a chance that life was getting a bit easier!
Thanks so much for the suggested approach -- very clearly put!
Thanks again and God bless!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paul-Curtis wrote:
"There is also no guaranteethat the values of control identifiers will be the same from one compilation to the next."
I do not understand this sentence, because the control identifiers with its values are laid down in the resource.h and this file does not change for a new compilation.
Further do you know the possibility to enter your own value for a control?
When you define the control identifier in the properties, you can also enter:
name=value instead of only name.
I will not recommend to enter your own values. It is better to rely on the assigned values, but there can arise situations where you prefer to enter your own values for a sequence of controls.
Guus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks very much, Guus, for your additional tips. I had found the name=value technique, but was hoping there was some way to mass-produce the "values" for several hundred dialog options.
Alittle creative editing seems to have done the trick a la Paul-Curtis' advice.
Thanks to both of you!
God bless!
Jack

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page