 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Bernard Hulsman Guest
|
Posted: Mon Sep 15, 2003 8:42 am Post subject: retrieving Version info with differt local settings |
|
|
I would like to retrieve project version info.
That should be all.
I found a procedure for this which should be called,
after calling some different statements :
VerQueryValue(Buff, PChar('040904E4'), Pointer(InfoPtr), RsltLen)
The hardcoded '040904E4' seem to be the LocalId (0409) and the charID
(04E4).
This is strange because if the a LocalId or a CharId should be used to
the versionInfo the procedure VerQueryValue could be able to retrieve
the information it self.
It also suggest that it is possible to retrieve the version info with a
differnent LocalId and CharID then the current(thread) localId and
charID.
But this is not the case. The setting must be identical then the current
setting.
When I force to set first a LocalId with first using
SetThreadLocale(localId);
and later retrieving it before calling VerQueryValue it works fine.
But when I do not force a SetThreadLocale, which I do not want to do,
for just reading the project Version Info, then VerQueryValue sometime
does work and sometime is does not.
Which LocalId does VerQueryValue use if Local thread is not jet set
with SetThreadLocale.
Or even much better. Does the a statement exist where I can ignore all
these LocalId setting and just retrieve my project Version Info.
Thanks,
Bernard Hulsman
|
|
| Back to top |
|
 |
FL Guest
|
Posted: Mon Sep 15, 2003 10:25 am Post subject: Re: retrieving Version info with differt local settings |
|
|
Try using VerQueryValueW instead.
Francisco
Bernard Hulsman wrote:
| Quote: | I would like to retrieve project version info.
That should be all.
I found a procedure for this which should be called,
after calling some different statements :
VerQueryValue(Buff, PChar('040904E4'), Pointer(InfoPtr), RsltLen)
The hardcoded '040904E4' seem to be the LocalId (0409) and the charID
(04E4).
This is strange because if the a LocalId or a CharId should be used to
the versionInfo the procedure VerQueryValue could be able to retrieve
the information it self.
It also suggest that it is possible to retrieve the version info with a
differnent LocalId and CharID then the current(thread) localId and
charID.
But this is not the case. The setting must be identical then the current
setting.
|
|
|
| Back to top |
|
 |
Bernard Hulsman Guest
|
Posted: Mon Sep 15, 2003 1:50 pm Post subject: Re: retrieving Version info with differt local settings |
|
|
Hello Francisco,
I followed your advise and changed using Widestrings with VerQueryValueW as
also the previous needed statement.
But in VerQueryValueW still a hardcoded LocalID and CharId is needed. And
still I do only get a good result if first I force the thread LocalID by
calling the statement SetThreadLocale(localId)
Thanks for your answer.
Bernard Hulsman
FL schreef:
| Quote: | Try using VerQueryValueW instead.
Francisco
Bernard Hulsman wrote:
I would like to retrieve project version info.
That should be all.
I found a procedure for this which should be called,
after calling some different statements :
VerQueryValue(Buff, PChar('040904E4'), Pointer(InfoPtr), RsltLen)
The hardcoded '040904E4' seem to be the LocalId (0409) and the charID
(04E4).
This is strange because if the a LocalId or a CharId should be used to
the versionInfo the procedure VerQueryValue could be able to retrieve
the information it self.
It also suggest that it is possible to retrieve the version info with a
differnent LocalId and CharID then the current(thread) localId and
charID.
But this is not the case. The setting must be identical then the current
setting.
|
|
|
| Back to top |
|
 |
FL Guest
|
Posted: Mon Sep 15, 2003 2:08 pm Post subject: Re: retrieving Version info with differt local settings |
|
|
You can enumerate the possible lang-codepage available by querying
the VarFileInfoTranslation. That's how those string resource editors work.
Francisco
Bernard Hulsman wrote:
| Quote: | Hello Francisco,
I followed your advise and changed using Widestrings with VerQueryValueW as
also the previous needed statement.
But in VerQueryValueW still a hardcoded LocalID and CharId is needed. And
still I do only get a good result if first I force the thread LocalID by
calling the statement SetThreadLocale(localId)
Thanks for your answer.
Bernard Hulsman
|
|
|
| Back to top |
|
 |
Bernard Hulsman Guest
|
Posted: Tue Sep 16, 2003 3:34 pm Post subject: Re: retrieving Version info with differt local settings |
|
|
Hello Francisco,
With your anwser I found the correct direction to search futher.
I could now solve the problem with your help.
Thanks you for that.
Bernard Hulsman
FL schreef:
| Quote: | You can enumerate the possible lang-codepage available by querying
the VarFileInfoTranslation. That's how those string resource editors work.
Francisco
Bernard Hulsman wrote:
Hello Francisco,
I followed your advise and changed using Widestrings with VerQueryValueW as
also the previous needed statement.
But in VerQueryValueW still a hardcoded LocalID and CharId is needed. And
still I do only get a good result if first I force the thread LocalID by
calling the statement SetThreadLocale(localId)
Thanks for your answer.
Bernard Hulsman
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|