Does it make a big difference (eg. in speed) if I use stringtable or have the strings in .data? Or is the stringtable a way to structure your code? vesa
:rolleyes:I'm not very sure but I think that the only difference between the two fields is that the 'DATA?' one is not preallocated-The variables you enter there do not increase the size of the executable file. In terms of speed:confused:-I have tried several debuggers, I don't believe that it can't be any difference at all. By beginning the program, the size which is allocated is being accessed with exactly (the relative references are the same) the same way.
String table has many avantages... First, you can distribute it without the source code (the .data too... but in C/C++ or other languages... not... the strings are frequently in the functions calls. Even in win32asm, in some case, you can have strings "outside" of a well organized .data section (szText macro in exemple). It can be useful if you are planning to give the text to a translator. I'm not sure about this (if someone can confirm/infirm it, don't hesitate please), but the things in .data section are all loaded in memory at application launch... it can waste lot of memory. With string tables, you call the api when you need the string and it copies it into a buffer. Of course, string tables has their inconvenients too... API calls are usually longer in bytes and slower... Your executable can grow quickly and i think the things in the ressource are all stored in unicode format (-> it doubles the size of the string ;_;). But for an international app, the stringtables are the best way to include many languages in the same exe without pain... For a little "local" app, i would use .data section to store my strings, but for a big international app, the string tables... I Hope my advices help you... Happy coding.
and you can't store strings in .data? only in .data section :).
for all you guys speaking about the .data? section, i think the question mark in his message was actually just a plain, normal, regular question mark, and not a part of the question :rolleyes: (that means he asked about the difference between the string table and the .data section, not the .data? section)
fresh, you are right. I asked a question and used the ? to indicate it. vesa
High, I can't say something about speed. I used a stringtable, for example, in response to an error message (winsock). I assign the string ID's to the error numbers. Now, in my code, it was an easy way to call API 'LoadString' with the resource ID identical to the error number. Yes, for me, it was a great experience. It was so easy. bye Test