Sachin Kainth
Sachin Kainth

Reputation: 46740

Externs and DLL imports

I have this rather strange looking couple of lines in my code, that I am trying to decipher. Does anyone know what it says?

[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);

Upvotes: 0

Views: 67

Answers (1)

Hollis
Hollis

Reputation: 68

That line is known as Platform Invoke, basically it's just making the function GetPrivateProfileString from kernel32.dll available to your program. Check out http://www.pinvoke.net/default.aspx/kernel32.GetPrivateProfileString for a little more information on that specific function.

Upvotes: 1

Related Questions