How do you directly call a native function exported from a
DLL?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / moghan
Yes we can call a native function exported from a Dll in
the following way,
I used C#.Net for Coding.
Add a Namespace that "System.Runtime.InteropServices"
Then use the following code,
Syntax:
[DllImport("dllname")]
here place the function in "dllname" Dll.
| Is This Answer Correct ? | 1 Yes | 0 No |
How to register a shared assembly ?
How do you register a .NET assembly?
What are the security issues if we send a query from the application?
Define delegates and events?
What is delay signing?
What is unboxing?
What is the proxy of the server object in .net remoting?
what is Client-activated object in remoting?
About Iunknown interface Queue ,its methods Query Interface Addref,Release and Explain each ?
What?s Singleton activation mode?
explain is .NET Remoting?
Is it a good design practice to distribute the implementation to remoting client?