Image by Fanghong and Gnomz007 |
The only thing I could do was to look the code and read the few comments. At some point, I found a call to the function GetName(). Changing the name returned by that function was one of the purpose of my job, so I looked for the implementation. And this is what I have found:
CString GetName() { return GetValue("Name"); }
Pretty useless, don't you think? OK, let's see the implementation of GetValue():
#define MAIN_APP "Main" CString GetValue(CString szField) { return GetField(MAIN_APP, szField); }
Is this a joke? Well, let's see where the story ended:
#define MAIN_INI "main.ini" CString GetField(CString szSection, CString szField) { char szResult[100]; GetPrivateProfileString( (LPCTSTR) szSection, (LPCTSTR) szField, "App", szResult, 100, MAIN_INI ); return szResult; }
Surprised? Now I'm sure you are wondering why someone had done this. I'm still wondering too.
Post a Comment