How do you directly call a native function exported from a
DLL?

Answer Posted / santhanakumar

HERE IS THE CODE EXAMPLE :

using System.Runtime.InteropServices; \
class C
{
[DllImport("user32.dll")]
public static extern int MessageBoxA(int h, string
m, string c, int type);
public static int Main()
{
return MessageBoxA(0, “Hello
World!”, “Caption”, 0);
}
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of strong name?

743


define client activated objects (cao)?

810


What is Remoting?

807


What are the channels in .net remoting?

714


Explain the hierarchial description of remoting?

700


What is unmanaged code?

726


Explain marshalling and its types in .net remoting

682


What are dynamic assemblies?

757


Define a process?

716


Hello, I want to connect a system in LAN and i want to access that.When ever i am moving a mouse in my desktop the similar thing have to happend in the another system in which i have connected. I need coding for this in c# and .NET . any one please help me.It is very urgent to me Advance thanks. my email id:manojkumarchallagundla@gmail.com

2493


what is Client-activated object in remoting?

763


What are the information required to configure remote objects?

680


What is asynchronous programming?

753


What are the security measures exist for .net remoting in system.runtime.remoting?

793


What is the difference between remoting and webservice?

708