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 |
What?s typical about a Windows process in regards to memory allocation?
What are the channels in .net remoting?
What is a formatter in .net remoting?
Explain threading types?
Explain marshalling and its types in .net remoting
When should we choose .net remoting over .net web services?
What are the consideration in deciding to use .NET Remoting or ASP.NET Web Services?
What do you mean by passport authentication?
Is it a good design practice to distribute the implementation to remoting client?
What are CAO's i.e. Client Activated Objects ?
How can you configure a .net remoting object via xml file?
Where is global assembly cache located on the system?