IT SOLUTIONS
Your TECHNOLOGY partner! 
-Collapse +Expand
C#
Search C# Group:

Advanced
-Collapse +Expand C# Group Home
-Collapse +Expand Message Board
-Collapse +Expand C# KB
-Collapse +Expand C# To/From
To/FromCODEGuides
-Collapse +Expand C# Study Test
PRESTWOODCERTIFIED
-Collapse +Expand C# Store
PRESTWOODSTORE
-Collapse +Expand Members Only

Prestwood eMagazine

May Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingC#WinForms     Print This   
Go To Random Article
Part of the mo. lesson in the Apr 11 Issue of Prestwood eMag
C# Code Snippet:
 A flashcard from our C# Flashcards Library
 A code snippet from our C# Code Snippets Page
[DllImport] attribute

This code allows you to use Win32 DLLs in your .NET applications.


public class Form1 : System.Windows.Forms.Form
{
[DllImport("GetMyCode.dll")]
public static extern string GenerateMyCode(string pProduct,
string pVersion, string pName);

// other form properties, etc...

Note that, below the [DllImport] attribute, you must declare the functions and procedures exported by the DLL you want to use.

More Info

FAQ:  Call a DotNet DLL from Win32 Apps
KB Post:  Using a Legacy Windows DLL in ASP.NET
FAQ:  Using Win32 DLLs in .NET

Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
Full Editor
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post:

Enter your name and security key.

Your Name:
Today's security key = P213A
Enter key:
Code Contributed By Wes Peterson:

Wes Peterson is a Senior Programmer Analyst with Prestwood IT Solutions where he develops custom Windows software and custom websites. When Wes is not coding for clients, he participates in this online community. Prior to his 10-year love-affair with Delphi, he worked with several other tools and databases. Currently he specializes in VS.Net using C# and VB.Net. To Wes, the .NET revolution is as exciting as the birth of Delphi.


 KB Article #100650 Counter
4778
Since 4/2/2008
-
  Load Time=less than 1 second.
 
Print This

KB Post Options:
-
 
Have a question? Need our services? Contact us now.
--Mike Prestwood

Call: 916-726-5675

email: info@prestwood.com


858 People Online Now!!  
Online Now: Sign In to see who's online now!  Not a member? Join now. It's free!
Show More...


©1995-2013 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech