I have these two lines of code.
CString strHost = AfxGetApp()->GetProfileString(_T("WebServices"), _T("Server"));
AfxMessageBox(strHost);
Nowhere in the app do I set the value. (the installer does that). So the strHost, should be the same no matter where or when this line is run.
Here's what I've got. Press A -> run function that contains code -> see expected data; Press B -> do some windows callbacks -> run function that contains code -> see "";
I'd think something in B was clearing the value, but if I press B first and then A, A yeilds what I want not the "".
Sadly I don't have access to the code that holds the windows callbacks, or rather it has got to be the biggest pile of badly managed obfiscation I've ever seen.
What I'm currious about is, if the GetProfileString is pulling the data from somewhere it shouldn't be? It's the only thing I can think of.
Questions.
1.) Is there a way to confirm I'm still working with the same "key"?
2.) Has anyone ever encountered this before?
Please if you think this is a bad question, and wish to mark it as such, leave a comment so I can fix it.
Though I didn't find the answer fully I did track down something interesting.
I'm using AfxGetApp()->GetProfileString..
It seems the function AfxGetApp() is returning different things at different times.. I'm not sure how that could happen, but at least I can now account for it.