Easy ways to use Win32 and other unmanaged APIs from .NET

From Yggenyk
Revision as of 06:16, 28 August 2008 by WikiSysop (talk | contribs)
Jump to navigation Jump to search

<google>ENGELSK</google>

PInvoke Visual Studio Add-in

PInvoke is an add-in for Visual Studio that allows you to add an interop by opening the add-in and search for the unmanages API or Type you want to use.

PInvoke gets the information from an online Wiki http://pinvoke.net/ where also can find the interop's.

To install Pinvoke.net download it here:

You will get it together with a free trial ANTS Profiler and Exception Hunter, but you can choose not to install them.

Pinvoke.net.jpg

PInvoke.net add-in support for Visual Studio 2008

The PInvoke.NET add-in for Visual Studio will work in Visual Studio 2008 with some slight modification to the add-in's configuration file.

First, locate the PInvokeDotNetAddIn.Addin file located in %programfiles%\red gate\PInvoke.NET, open it with a text editor such as notepad.exe, and make the following changes:

After the text:


<HostApplication> <Name>Microsoft Visual Studio Macros</Name> <Version>8.0</Version> </HostApplication> <HostApplication> <Name>Microsoft Visual Studio</Name> <Version>8.0</Version> </HostApplication>


Add:


<HostApplication> <Name>Microsoft Visual Studio Macros</Name> <Version>9.0</Version> </HostApplication> <HostApplication> <Name>Microsoft Visual Studio</Name> <Version>9.0</Version> </HostApplication>

and save the file.

It may also be necessary to add the path to the PInvoke add-in to the list of folders where Visual Studio will look for add-ins. From Visual Studio 2008's Tools menu, select Options, then Add-in/Macro security. If the path to the PInvoke.NET installation folder (c:\program files\red gate\PInvoke.NET) is not listed in the collection of add-in file paths, click the add button and select the installation folder.

After restarting Visual Studio 2008, the add-in will function as it does in previous versions of Visual Studio.


<google>ENGELSK</google>

id=siteTree