Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

This tip is probably only useful for old versions of Visual Studio. For integrating Vim with modern versions of Visual Studio, see Integrate gvim with Visual Studio.

To open a file in an existing instance of some versions of Visual Studio, a DDE call must be initiated. It's an old and obsolete technology called Dynamic Data Exchange used for interprocess communication. When you click on a .cpp file in the Windows Explorer it calls devenv.exe with the /DDE switch (it's undocumented) and sends it an Open DDE command. You can see it for yourself if you look at the file type mapping of .cpp in the Windows Explorer (if you haven't already changed them to open Vim). The Explorer shell is DDE enabled but I found no way to send DDE from the command line (I didn't really look for it either). So I wrote a small C++ console app from the code I got from an Experts Exchange question. I formatted the code, renamed references from Visual Studio to DevEnv and put it in a project.

Setting the line number is a different problem. I wrote a Perl script using the Win32::GuiTest module. This module allows interacting with the Windows GUI and provides a very useful function called SendKeys. The script finds the Visual C++ window (if you are using a different language change the script) and sends it: a CTRL-G, the current line number as specified on the command line and ENTER.

It is integrated in Vim by a function (in vimrc) that gets the current file name and line number and silently executes the script:

I updated the DevEnvDDE program to connect to Visual Studio .NET 2003. The code now supports an extra command line parameter that specifies the visual studio instance to open the file in (VS6, VSNET or VSNET2003). Simply download the new sources (same link).