Click here to Skip to main content
15,905,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How i will call native Dll from C# application.Please let me know step by step process.
Posted

1 solution

This example show how to call the native MessageBox function. It's the same thing
for others functions.

C#
using System;
using System.Runtime.InteropServices;
class Test
{
   [DllImport("user32.dll")]
   public static extern int
      MessageBox(IntPtr h, string m,
         string c, int type);
   public static void Main()
   {
      int retval = MessageBox(IntPtr.Zero, "text", "title", 0);
   }
}
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 11-Jul-11 16:23pm    
There is a lot more to it, but this short sample should be enough to start. My 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900