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
Explain the differences between marshal by value and marshal by reference?
What are the remotable objects in .net remoting?
Can you pass SOAP messages through remoting?
About Iunknown interface Queue ,its methods Query Interface Addref,Release and Explain each ?
what is Client-activated object in remoting?
What is the purpose of strong name?
Can you explain remoting?
what are the requirements to enable remote components to interact each other?
Name the distributed systems available apart from .net remoting?
What are the different types of channels used by .net remoting?
What is the difference between the RegisterWellknownServiceType(), RegisterWellknownClientType(), RegisterActivatedServiceType() and RegisterActivatedClientType() in .net?
Garbage collector?s functionality on unmanaged code ?
What is unboxing?
What are the security features in .net remoting?
Explain how to directly call a native function exported from a dll?