How to put getprivateprofilestring comments in the program
I've written a function GetINIString which basically wraps the GetPrivateProfileString function. Interoping GetPrivateProfileString is giving me this Exception in certain cases: This function is being called by a multi-threaded application. Till now i was using very simple methods to get the INIString but my other colleauge have suggested that this function has worked fine for mutli-threaded application when calling GetINIString.
Re: How to put getprivateprofilestring comments in the program
This function is being called by a multi-threaded application. This function has worked fine for a long while, but recently the mutli-threaded application hangs when calling GetINIString. Pointer to the buffer that receives the retrieved string. Good judgement comes from experience, and experience comes from bad judgement.
Re: How to put getprivateprofilestring comments in the program
The GetPrivateProfileString function returns the string value of the Entry found in the Section part of the file FileName. You need to initialize the StringBuilder with the appropriate initial size. StringBuilder _strInDir = new StringBuilder(80);The GetPrivateProfileString function searches the specified initialization file for a key that matches the name specified by the lpKeyName parameter under the section heading specified by the lpAppName parameter.
Re: How to put getprivateprofilestring comments in the program
I am also using WritePrivateProfileString and whenever I want to assign a value to the string builder before I do a WritePrivateProfileString, The GetPrivateProfileString function is not case-sensitive. The Section and Entry arguments may contain any combination of uppercase and lowercase letters.have I no choice but to do a new StringBuilder(value), every time I want to assign a new value to the StringBuilder type variable.