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

Difference between .net remoting versus distributed com?

560


Explain the difference between the registerwellknownservicetype(), registerwellknownclienttype(), registeractivatedservicetype() and registeractivatedclienttype() in .net?

520


Explain marshalling and its types in .net remoting

514


Explain serialization formatters in .net remoting

564


How do you implement distributed applications in .net?

506






What is the proxy of the server object in .net remoting?

560


What are different types of assemblies?

572


What are static assemblies?

550


Which one is better WebService and Remoting ?

614


What are the different types of channels used by .net remoting?

516


Define proxy in .net remoting?

567


What is the Difference between CAO and SAO in Remoting.

556


What is Remoting?

636


What are the channels in .net remoting?

529


Define the lease of the object?

588