GetPrivateProfileString does not work in WIndows 2000(S.Pack3)

vsaravana
vsaravana used Ask the Experts™
on
HI,
 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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
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!

Commented:
Can you post your code?

Have you verified that the path is correct?

Author

Commented:
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("General", "Mode", -1, "\\\\quadprodnet\\quadrant\\W2K.INI");
 if (nMode == -1)
 {
  AfxMessageBox("Unable to read from W2K.INI in QUADPROD - GetPrivateProfileInt");
 }

 char szVal[40]={0};
 GetPrivateProfileString("General", "Mode", "-1", szVal, 40,"\\\\quadprodnet\\quadrant\\W2K.INI");
 if (stricmp(szVal,"-1") == 0)
 {
  AfxMessageBox("Unable to read from W2K.INI in QUADPROD - GetPrivateProfileString");
 }


Thanks
saravana

   Is it a security issue? Maybe SP3 fixed some security hole for AS400 and hosed you.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial