Hello!
I have been using this particular function for months now, however today it stopped working. I can't imagine why, and I'm ruling nothing out, so if you have any ideas please do tell!
I am loading function in such manner:
[DllImport("kernel32")]
private static extern int GetPrivateProfilestring(string section, string key, string def, StringBuilder retVal, int size, string filePath);
and then I try to use it this way:
StringBuilder temp = new StringBuilder(255);
int i = GetPrivateProfilestring(Section, Key, "", temp, 255, strPath);
return temp.ToString();
as said this worked for ages, however from now on it throws this exception:
System.EntryPointNotFoundException: Unable to find an entry point named 'GetPrivateProfilestring' in DLL 'kernel32'
Why would this happen? Is it possible that the dll was changed (by windows update or something)? Maybe it just can't be found anymore, would the exception be different then? I know this is unlikely however as I've said Im ruling nothing out since this has always worked and the source code has not been changed...
Update: Oddly enough the capitalization helped, it seams to be working now. However I am still curious as to why has this happened, and why did it happen now? I can assure you that it worked for months now.
I am a bit afraid of just changing it and updating our software everywhere, since the error only occurred on my machine (as far as I know anyway), however the old method has been working in production on various PC's and configurations for over 6 months.