interview questions and answers

Microsoft Technologies Interview Questions | C# Interview Questions

Friday, 10 February 2012
Main Menu
Home
Online Test
Contest
Search
FAQs
Contact Us
Login
Most Popular Category
JAVA

Microsoft Technologies
ASP, C#, DotNet, ...

Programming
C++, PHP, VB, ...

SAP

Testing

Web Technologies

Polls
Does personal networking help in job search?
 
IT Placement Papers interview questions Microsoft Technologies interview questions C#

This category contains C# Interview Questions and Answers


How do you directly call a native function exported from a DLL?

PDF Print E-mail

example of the DllImport attribute in action: 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); } } This example shows the minimum requirements for declaring a C# method that is implemented in a native DLL. The method C.MessageBoxA() is declared with the static and external modifiers, and has the DllImport attribute, which tells the compiler that the implementation comes from the user32.dll, using the default name of MessageBoxA. For more information, look at the Platform Invoke tutorial in the documentation.




Be first to comment this article

Only registered users can write comments.
Please login or register.

 
< Prev   Next >

Microsoft Technologies Interview Questions | C# Interview Questions

Top!
Top!
Copyright © 2008 InterviewDuniya.com All Rights Reserved.
Partner Site: Maheshwari Matrimony