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 is a formatter in .net remoting?
What are the ways to configure remoting objects before client can use them?
How can you tell the application to look for assemblies at the locations other than its own install?
What is boxing and unboxing ?
4 Answers Amdocs, BirlaSoft, TCS,
About .NET Remoting and types of remoting ?
How to register a shared assembly ?
Can you configure a .NET Remoting object via XML file?
1 Answers Tavant Technologies,
What is strong name and what is the need of it ?
What is the difference between remoting and webservice?
What does manifest consists?
Where is global assembly cache located on the system?
How can objects in two diff. App Doimains communicate with each other ?