Error using GetPrivateProfileString and GetPrivateProfileSectionNames
-
I've inherited a large VB6 project (with zero chance of moving it to VB.NET) that I am slowly refactoring, beginning with reading the .ini files. Never mind the way it currently works, I just want to read all the section names, then within each section name, read all the keys and values. According to the documentation on MSDN, this should be simple. The GetPrivateProfileSectionNames function should give me the section names, then GetPrivateProfileString (with a null for key-name) should give me the list of key/value pairs within the specified section. But they're not working. When the GetPrivateProfileSectionNames wouldn't work, I tried switching to GetPrivateProfileString and passing it a null for the section name (which according to MSDN should do basically the same thing as GetPrivateProfileSectionNames). Again, no luck. I could copy all the declarations and usages here (and will if I need to), but was hoping someone else may have experienced the same thing and already recognizes the symptoms and knows the answer. Any help appreciated.
David --------- Empirical studies indicate that 20% of the people drink 80% of the beer. With C++ developers, the rule is that 80% of the developers understand at most 20% of the language. It is not the same 20% for different people, so don't count on them to understand each other's code. http://yosefk.com/c++fqa/picture.html#fqa-6.6 ---------