SDK:Visual Studio

From Vectorworks Developer
Jump to: navigation, search

.SDK|SDK ..SDK:Types|SDK Types ..SDK:Using the SDK|Using the SDK ..VCOM:VCOM (Vectorworks Component Object Model)|VCOM Basics ..VCOM:Class Reference|VCOM Class Reference

Editor

Quick Open

To quickly open any file in your VS 2005 solution irrelevant of its location on disk or in the project folder hierarchy type ">open <<name of file>>" and hit enter (e.g. ">open moderntools.cpp"). Conveniently, the find box has auto-complete.

VisualStudioQuickOpen.jpg

Selecting

While making selection with the mouse, if you hold "ALT" key down, you'll get block selection.

Pasting this block selection in text will result in putting the block as it was in the text (will NOT add new lines). If you paste it at new line, it will work as normal selection paste (will add new lines).

You can to block selection with keys only the same way (holding down "ALT" key while making the selection with "SHIFT" + <arrows>.

VisualStudioBlockSelection.jpg

Debugger

Defining User Types

You can have variables in your Watch/Locals/Autos debugging windows be displayed in a more convenient way by modifying the text file autoexp.dat (auto expand) located in the Visual Studio directory.

Note In oder to edit (save) those files under Vista you need to have admin permissions on the application that will edit them.

So you should right click on note pad (or the studio itself) and "Run as administrator" Then you will be able to open the file from "Program Files", edit it and save it.

Those settings are done inside autoexp.dat file found in: VisualStudio 2003: C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\Debugger VisualStudio 2005: C:\Program Files\Microsoft Visual Studio 8\Common7\Packages\Debugger

The file is organized into sections.

...

[AutoExpand]

...

[Visualizer]

...

[hresult]

...

VisualStudio 2003

If you installed Visual Studio in a standard location, you will find autoexp.dat at:

C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\Debugger

The syntax is described at the top of the file and there are examples in it as well.

Below I’m having TXString variables display in the Locals window as “str=” and then the characters that make up the string. It’s more convenient than having to expand the TXString and find the member variable. The WorldPt or _WorldPt is another type that is worth having a custom appearance in the debug windows.

VisualStudioAutoexp.jpg

All you have to do is change this file, stop the debugger, then start debugging again for your changes to take effect.

Here are some useful ones, You have to add them inside [AutoExpand] block:

; for NNA datatypes
TXString =len=<fLength>  str=<fCStringData,s>
ViewRect =top=<top,d>  left=<left,d>    bottom=<bottom,d>  right=<right,d>
ViewPt =x=<x,d>  y=<y,d>
PageRect =top=<top,g>  left=<left,g>    bottom=<bottom,g>  right=<right,g>
PagePt =x=<x,g>  y=<y,g>
WorldPt =x=<x,g>  y=<y,g>
WorldPt3 =x=<x,g>  y=<y,g>  z=<z,g>
WorldRect =top=<top,g>  left=<left,g>   bottom=<bottom,g>  right=<right,g>
_WorldPt3 =x=<x> y=<y> z=<z>
_WorldRect =min=<left>, <bottom> max=<right>, <top>
ViewPt_ =x=<x> , y=<y> 
ViewRect_ =min=<left>, <bottom> max=<right>, <top>
VWIID=$BUILTIN(GUID)

VisualStudio 2005

If you installed Visual Studio in a standard location, you will find autoexp.dat at:

C:\Program Files\Microsoft Visual Studio 8\Common7\Packages\Debugger

The settings from the old VisualStudio 2003 will work the same way. In this version you can also specify visualization formatting for complex types like arrays. You will find in this section STL formatting rules.

VisualStudioAutoexpVS2005 visualizer.jpg

Here is some useful ones that you have to put inside [Visualizer] block:

; NNA visualizers
TXStringArray{
    children
    (
        #array
        (
            expr : ($c.fStringsPtr)[$i],  
            size : $c.fNumStringsStored
        )
    )

    preview
    ( 
        #( 
            "[", 
            $e.fNumStringsStored , 
            "](", 
            
            #array
            (
                expr : 	($c.fStringsPtr)[$i],  
                size : 	$c.fNumStringsStored
            ), 
            ")"
        )
    )
}

View Pointers As Arrays

If you have a pointer, and you know it’s actually pointing to an array, the Visual Studio debugger will normally just show you the first element in the array. You get a similar difficulty inspecting a variable sized structure that has a single dimensioned array as the last member.

VisualStudioArrCode.jpg

if you add “,numElements” after the pointer you can view it like an array:

VisualStudioArrVariable.jpg

Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox