winAPI functions
-
Can i use winAPI functions in C#??
-
Can i use winAPI functions in C#??
You can import functionality from a native dll. For example:
[DllImport("kernel32", SetLastError=true)]
static extern IntPtr CreateFile(
string filename,
uint desiredAccess,
uint shareMode,
uint attributes,
uint creationDisposition,
uint flagsAndAttributes,
uint templateFile
);You can then call CreateFile as you would a normal C# method. You will need to know the basic conversion types from C++ to C#. Or you can use [MarshalAs(UnmanagedType...)] attribute on a field.
"If you just say porn then you get all manner of chaff and low grade stuff."
- Paul Watson, Lounge 25 Mar 03
"If a man is standing in the middle of the forest speaking and there is no woman around to hear him, is he still wrong?"
- Anon
Jonathan 'nonny' Newman Homepage [www.nonny.com] [^]
-
Can i use winAPI functions in C#??
yes, ofcourse you can use. you can use regular static/nonstatic mfc/nonMfc dll. + you can use COM dll using COM dll is easy as eating popcorn ;P and using other dll is hard and will need testing using marshalling etc :((