|
65,535 if the path and prefix are the same.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
In practice when a folder contains more then 6-9000 files Windows isn't happy anymore..
|
|
|
|
|
I have Resource ID (for a stringtable value)in string format. ex ("IDS_VALUE").
How can i convert it into ID format (UINT) to get the the string using LoadString method.
If anybody come across the problem .pls let me know the solution.
Advance thanks!
|
|
|
|
|
Just curiosity: how can be you have just the string?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
the string containing the ID was "composed" using predefined strings from a XML file.
modified on Thursday, January 7, 2010 3:36 AM
|
|
|
|
|
Intead of "IDS_VALUE", you can keep the actual integer values like "2344" in the XML file. And you can easily convert the "2344" to 2344 by using atoi().
|
|
|
|
|
this was an idea, but i want to keep the xml file readable.
if a tag is 2344 instead of NAME (e.g.), it will be difficult to do that.
|
|
|
|
|
Directly to put forward a corresponding relationship between int an string
|
|
|
|
|
You should maintain both the string value and the corrensponding numeric one inside the XML file. IMHO you've no way other than parsing the resource.h in order to decode the string (BTW why are you building a XML replica of the resource.h file?).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thank you. I will use a map eventually (the xml file will remain the same).
There is a strong relation between stringtable values in resources and the data from the xml file, but is not a replica .
|
|
|
|
|
Using a map<string, int=""> would be fine.
|
|
|
|
|
You can also use strings rather than integers to refer to your resource items. If you do not give resource names a #define value, then you can refer to them by the name as string value, rather than its integer equivalent.
|
|
|
|
|
i dont't want to use #define because i use stringtables for different languages.
a map seems to fit to my needs.
|
|
|
|
|
ronovice wrote: i dont't want to use #define
That is what I was trying to explain in my previous post. If you do not use #define then the resource names can be accessed by their actual name as extracted from your XML, no need for a map or any other type of transform.
|
|
|
|
|
i wanted to use LoadString method which will need as parameter a UINT, but i have only the string .
How can I get from resources the text associated with that UINT if i cant convert the string to UINT ID?
if there is another solution(even without using LoadString), I will gladly use it.
|
|
|
|
|
You could try using FindResourceEx()[^] rather than trying to access it directly. This should allow you to use the name as a string and also to select which language you wish the string to be in.
[edit]My apologies, this does not hold true for STRINGTABLE entries, although you could possibly use a user defined resource type.[/edit]
modified on Thursday, January 7, 2010 8:14 AM
|
|
|
|
|
Not possible.
IDS_VALUE is a #define, these are resolved by the preprocessor and are not preserved as strings anywhere in the object files.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
thanks! it was worth a try! i will use a map (as the best idea for the moment)!
|
|
|
|
|
cmk wrote: Not possible.
Untrue; if you do not equate a resource name to an integer value, then you can address it by the actual string name.
[edit]My apologies, this does not hold true for STRINGTABLE entries.[/edit]
modified on Thursday, January 7, 2010 8:12 AM
|
|
|
|
|
Yeah, RT_STRING's screw things up, you can't even FindResource() on them without jumping through hoops.
e.g.
Given: IDS_STRING as a String Table entry
// Fails
hnd = FindResource(mod, MAKEINTRESOURCE(IDS_STRING), RT_STRING);
// Works
id_string = MAKEINTRESOURCE((LOWORD(IDS_STRING)>>4)+1);
hnd = FindResource(mod, id_string, RT_STRING);
... let alone getting the size, or loading the string without using LoadString().
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
|
I really must take my own advice, and test everything before posting suggestions.
|
|
|
|
|
|
Hi,
I want to open 2 dialogs at a time.For first one, im using domodal function. Inside the first dialog,im calling create function to open second dialog.
the code is executed successfully.Is not showing any error. while running the application,its not showing the second dialog.Can anyone please tell me whether this procedure is correct?
Thanks,
modified on Thursday, January 7, 2010 2:06 AM
|
|
|
|
|
from where you invoking second dialog? if you are invoking second modeless dialog box after first one, then it not going to work as DoModal is modal call.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|