It is first time I am trying to use DllImort in C#. But it is not appearing in InteliSense. I have added
using System.Runtime.InteropServices;
But it is not working again. Instead this [DllImportAttribute] is shown.
What am I doing wrong?
It is first time I am trying to use DllImort in C#. But it is not appearing in InteliSense. I have added
using System.Runtime.InteropServices;
But it is not working again. Instead this [DllImportAttribute] is shown.
What am I doing wrong?
You do nothing wrong. Use this attribute to define the managed signature for the method you want to import.
As Example
[DllImport("kernel32.dll", BestFitMapping = false,
CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr GetModuleHandle(string moduleName);
Look in MSDN for all possible parameter for DllImport