From: David Kerber on
I'm having trouble reading values from a .ini file on windows 7 x64.
Specifically, changes that I make in a text editor are not appearing
when I try to read them in through my application. Other settings that
have been in the .ini file for ages will read in just fine; just not the
new entries.

I have made the changes in both copies of my .ini file: the one in c:
\windows, and the one in my appdata\local\virtualstore\windows folder,
and while changes in either one of these appear in the other in the text
editor, they will not show up when I read them in from my app, even
though long-standing entries work fine.

I'm sure it's something to do with win7's virtualization, but can't
figure out how to get around it; can somebody tell me what I'm missing?



My code I'm usiing is:

labelName = GetIniString("WebSIRA", "OspFullLabel", "", "WinTM.ini")


and GetIniString is:


Function GetIniString$(AppName$, KeyName$, Default$, IniFileName$)
'calls windows API call to get the desired string from the specified
..ini file
ReturnString$ = Space(255)
BuffSize& = Len(ReturnString$)
StringLen& = GetPrivateProfileString&(AppName$, KeyName$, Default$,
ReturnString$, BuffSize&, IniFileName$)
GetIniString$ = Left$(ReturnString$, StringLen&)

End Function



Thanks!
D
From: David Kerber on
Oops, forgot to specify: the trouble I'm having is that I'm always
getting back my "default" value; it's not reading from the .ini file.


In article <MPG.2637d4faeee4b9689896f1(a)news.onecommunications.net>,
ns_dkerber(a)ns_warrenrogersassociates.com says...
>
> I'm having trouble reading values from a .ini file on windows 7 x64.
> Specifically, changes that I make in a text editor are not appearing
> when I try to read them in through my application. Other settings that
> have been in the .ini file for ages will read in just fine; just not the
> new entries.
>
> I have made the changes in both copies of my .ini file: the one in c:
> \windows, and the one in my appdata\local\virtualstore\windows folder,
> and while changes in either one of these appear in the other in the text
> editor, they will not show up when I read them in from my app, even
> though long-standing entries work fine.
>
> I'm sure it's something to do with win7's virtualization, but can't
> figure out how to get around it; can somebody tell me what I'm missing?
>
>
>
> My code I'm usiing is:
>
> labelName = GetIniString("WebSIRA", "OspFullLabel", "", "WinTM.ini")
>
>
> and GetIniString is:
>
>
> Function GetIniString$(AppName$, KeyName$, Default$, IniFileName$)
> 'calls windows API call to get the desired string from the specified
> .ini file
> ReturnString$ = Space(255)
> BuffSize& = Len(ReturnString$)
> StringLen& = GetPrivateProfileString&(AppName$, KeyName$, Default$,
> ReturnString$, BuffSize&, IniFileName$)
> GetIniString$ = Left$(ReturnString$, StringLen&)
>
> End Function
>
>
>
> Thanks!
> D


From: Charlie Russel - MVP on
Chances are that your application is not reading the same file as you're
editing. Keep in mind that there are two versions of "system32" -- the one
that 64bit applications see, in \windows\system32, and the one that 32-bit
applications see, in \windows\SysWOW64.

--
Charlie.
http://msmvps.com/blogs/russel




"David Kerber" <ns_dkerber(a)ns_warrenrogersassociates.com> wrote in message
news:MPG.2637d58e56e19a7d9896f2(a)news.onecommunications.net...
> Oops, forgot to specify: the trouble I'm having is that I'm always
> getting back my "default" value; it's not reading from the .ini file.
>
>
> In article <MPG.2637d4faeee4b9689896f1(a)news.onecommunications.net>,
> ns_dkerber(a)ns_warrenrogersassociates.com says...
>>
>> I'm having trouble reading values from a .ini file on windows 7 x64.
>> Specifically, changes that I make in a text editor are not appearing
>> when I try to read them in through my application. Other settings that
>> have been in the .ini file for ages will read in just fine; just not the
>> new entries.
>>
>> I have made the changes in both copies of my .ini file: the one in c:
>> \windows, and the one in my appdata\local\virtualstore\windows folder,
>> and while changes in either one of these appear in the other in the text
>> editor, they will not show up when I read them in from my app, even
>> though long-standing entries work fine.
>>
>> I'm sure it's something to do with win7's virtualization, but can't
>> figure out how to get around it; can somebody tell me what I'm missing?
>>
>>
>>
>> My code I'm usiing is:
>>
>> labelName = GetIniString("WebSIRA", "OspFullLabel", "", "WinTM.ini")
>>
>>
>> and GetIniString is:
>>
>>
>> Function GetIniString$(AppName$, KeyName$, Default$, IniFileName$)
>> 'calls windows API call to get the desired string from the specified
>> .ini file
>> ReturnString$ = Space(255)
>> BuffSize& = Len(ReturnString$)
>> StringLen& = GetPrivateProfileString&(AppName$, KeyName$, Default$,
>> ReturnString$, BuffSize&, IniFileName$)
>> GetIniString$ = Left$(ReturnString$, StringLen&)
>>
>> End Function
>>
>>
>>
>> Thanks!
>> D
>
>

From: David Kerber on
In article <OEkBKtM4KHA.4964(a)TK2MSFTNGP05.phx.gbl>,
Charlie(a)mvKILLALLSPAMMERSps.org says...
>
> Chances are that your application is not reading the same file as you're
> editing. Keep in mind that there are two versions of "system32" -- the one
> that 64bit applications see, in \windows\system32, and the one that 32-bit
> applications see, in \windows\SysWOW64.

I'm not reading anything in system32; it's in \windows and appdata\local
\virtualstore, and I've tried editing both copies.

D

From: John Barnes on
You need to determine where the app is reading the ini. file from. There is
no magic. Charlie pointed out the obvious difference in 64-bit systems.

"David Kerber" <ns_dkerber(a)ns_warrenrogersassociates.com> wrote in message
news:MPG.26380a54d262438b9896f3(a)news.onecommunications.net...
> In article <OEkBKtM4KHA.4964(a)TK2MSFTNGP05.phx.gbl>,
> Charlie(a)mvKILLALLSPAMMERSps.org says...
>>
>> Chances are that your application is not reading the same file as you're
>> editing. Keep in mind that there are two versions of "system32" -- the
>> one
>> that 64bit applications see, in \windows\system32, and the one that
>> 32-bit
>> applications see, in \windows\SysWOW64.
>
> I'm not reading anything in system32; it's in \windows and appdata\local
> \virtualstore, and I've tried editing both copies.
>
> D
>