When we import legacy dlls in C# we use something like the following notation:
[DllImport("user32.dll")] // Why am I enclosed in "["s
static extern int MessageBoxA(int hWnd, string strMsg, string strCaption, int iType);
OR also:
[MarshalAs(UnmanagedType.LPStr)] // <-- What in the world is it?
string arg1,
as mentioned here
However, this notation is not exclusively used for interop Services only like here, like:
[Conditional("DOT")] // <--- this guy right here!
static void MethodB()
{
Console.WriteLine(false);
}
but it is not listed as a preprocessor directive at msdn
What is this notation called? Where can I find literature or documentation for it?