Can you post your code?
Have you verified that the path is correct?
Main Topics
Browse All TopicsHI,
I am using GetPRivateProfileString GetPRivateProfileInt in my C++ program(using MFC) and seeing strange problems with WIndows 2000 (S.Pack3). When I use this API on a INI file in an AS400 network share it never returns me any value( or I should say it always returns me the default value I have specified). This program was working fine until Windows 2000(S.Pack2) and is working in rest of the operating systems. Something has changed in WIndows 2000(S.PAck3) that is causing it. IS anyone aware of any fix(or) workaround for this issue.
If I go back to S.PAck2 it starts working so I am confirmed that S.Pack3 has introduced this bug.
The above APIs work fine if the Ini file is in local PC or any windows network share
Thanks
saravana
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I agree, it works if you have the ini file in the winodws share or local hard drive but clearly it does not work if you have it in AS400 network shares. The reason why I am so sure about the code is because the progarm works fine if I have s.pack 2 and as soon as I install s.pack3 it fails and again if un-install s.pack3 and go back to s.pack2 it works. anyways i am enclosing the code for your reference
int nMode = ::GetPrivateProfileInt("Ge
if (nMode == -1)
{
AfxMessageBox("Unable to read from W2K.INI in QUADPROD - GetPrivateProfileInt");
}
char szVal[40]={0};
GetPrivateProfileString("G
if (stricmp(szVal,"-1") == 0)
{
AfxMessageBox("Unable to read from W2K.INI in QUADPROD - GetPrivateProfileString");
}
Thanks
saravana
Business Accounts
Answer for Membership
by: jhancePosted on 2002-11-16 at 09:53:08ID: 7457956
In fact GetPrivateProfileString DOES work on Win2000 SP3 as well as all other versions of Win2000.
Clearly you are either programming this improperly or there is a problem with the INI file.
Post your code!