background preloader

Visual Studio

Facebook Twitter

Finding Memory Leaks Using the CRT Library. Memory leaks, defined as the failure to correctly deallocate memory that was previously allocated, are among the most subtle and hard-to-detect bugs in C/C++ applications. A small memory leak might not be noticed at first, but over time, a progressive memory leak can cause symptoms that range from decreased performance to crashing when the application runs out of memory.

Worse, a leaking application that uses up all available memory can cause another application to crash, creating confusion as to which application is responsible. Even seemingly harmless memory leaks might be symptomatic of other problems that should be corrected. The Visual Studio debugger and C Run-Time (CRT) libraries provide you with the means for detecting and identifying memory leaks. The primary tools for detecting memory leaks are the debugger and the C Run-Time Libraries (CRT) debug heap functions. To enable the debug heap functions, include the following statements in your program: Detected memory leaks!

Or:

Deployment

Troubleshooting pkgdef Files - The Visual Studio Blog. For those using the Visual Studio 2010 SDK to create extensions for Visual Studio, you should find the creation and use of .pkgdef files to be mostly automatic (see What's a PkgDef and Why?). However, like anything involving computers and software, there are occasions that require manual intervention because they aren’t covered by the automatic settings or things can go wrong.

This article illustrates some possible issues with .pkgdef files and provides techniques for discovering what’s wrong and correcting them. Please note that these techniques apply not only to the Visual Studio 2010 IDE, but also to applications built using the Visual Studio 2010 Shell (Isolated) (or Integrated). All of the examples assume the case of VS 2010 running on 32-bit Windows 7. For other cases, substitute the appropriate file locations and names and registry root key. What Could Go Wrong? First of all, how do you know if something goes wrong? Issue: Per-user Extension Is Not Enabled Run: devenv.exe /log. How to Update a Visual Studio 2008 Guidance Package to Visual Studio 2010.

PluginResources - dxcorecommunityplugins - Where to start when creating Coderush/Refactor/DXCore plugins - Community-contributed plugins for DXCore. Decorate Your Code with Astonishing Attributes. Hen I first saw attributes in Visual Studio .NET, I thought they were some sort of oddity Microsoft had dragged in from Java, C++, or perhaps the Delta Quadrant. They clearly aren't Visual Basic code. To someone who uses angle brackets only for comparing two numbers, this Property statement, <XmlIgnore(True)> Public Property Salary() As Decimal, looks like it's been infected by the Borg! In fact, attributes don't look like code because they aren't code.

They're really code "decorations" that supply extra information related to the code to anyone or any process that cares. Generally, these attributes are useful to entities that manipulate code and objects in interesting ways—such as Visual Studio's Properties window, the debugger, and XML serializers. After I got over the shock of seeing the suspicious brackets (or "wakkas" to give them their cool and edgy name) scattered throughout my code, I discovered that they can make using and understanding code a lot easier.

Visual Studio Extensions

Tutorial: A Simple Managed Project System - Visual Studio Extensibility User Education. Here's a preview of the new managed project system tutorial. It's written for Visual Studio 2008, Visual Studio SDK 1.0, and Windows Vista. Submitted by Martin Tracy. This posting is provided "AS IS" with no warranties, and confers no rights. In Visual Studio, projects are the containers that developers use to organize source-code files and other assets that appear in Solution Explorer.

Typically, projects are specified by the contents of a project file, for example, a .csproj file for a Visual C# project. This walkthrough shows how to create a project type that has the project file name extension .myproj. In particular, this walkthrough shows how to do these tasks: · Create a simple project type. · Create a simple project prototype template. · Register the project template in Visual Studio. · Create a new project instance by using the template together with the New Project wizard. · Create a project factory for the project system. · Create a project node for the project system. 1. 2. 3. 4. 5.

Understanding Composite UI Application Block, Part V. In most applications certain user interface areas are shared among various modules. Examples are all kinds of menus, tool bars, status bars, Outlook style sidebars and others. What is common for all of them is that they serve as containers for collections items (menu items, toolbar buttons, etc.) that user can activate to trigger some actions in the application. For example, the File > Open menu item normally would invoke the action of opening a file. However same action could be also accessible using a toolbar button. UIExtensionSites are the shared containers that can contain your UIElements. Next step is to attach Commands to your UIElements. All pages in the .NET PetShop sample share a common NavigationBar that contains links to following pages: Sign In, Sign Out, Edit Account, View Shopping Cart and the Search TextBox.

First I need to add a MenuStrip to the the ShellForm and make it publicly accessible. RootWorkItem.UIExtensionSites.RegisterSite("NavBar", Shell.menuStrip); ThunderClap, Vol. 7, No. 2: Microsoft's Composite UI Application Block (CAB) -- A Prefabricated Toolkit for a Modern Smart Client App, and an in-house training class on it. Thunderclap, the Newsletter of Rolling Thunder Computing Volume 7, Number 2, Fall 2005 In this issue: Feature Article: The Composite UI Application Block -- A Prefabricated Toolkit for a Modern Smart Client App Blatant Self-Promotion: New in-house class on Composite UI Application Block A Good Read: Two Books about Funerals by Thomas Lynch Annabelle and Lucy's Latest Subscription Information Feature Article: The Composite UI Application Block -- A Prefabricated Toolkit for a Modern Smart Client App Microsoft .NET is an advance over its predecessors every way but one.

We now have new problems to solve on the desktop. Our new rich client applications require different feature sets than the MFC provided. To provide exactly that, the Patterns and Practices group at Microsoft has just released the Common User Interface Application Block (CAB). An example of a CAB app is shown in the following diagram.

It’s assembled from several independent parts that are loosely coupled together. A Good Read NEW! SAL Annotations. If you examine the library header files, you may notice some unusual annotations, for example, _In_z and _Out_z_cap_(_Size). These are examples of the Microsoft source-code annotation language (SAL), which provides a set of annotations to describe how a function uses its parameters, for example, the assumptions it makes about them and the guarantees it makes on finishing. The header file <sal.h> defines the annotations. You can put an annotation before either the type of a function parameter or its return type, and use the annotation to describe the behavior of the function regarding the parameter or the return value.

There are two classes of annotations: buffer annotations and advanced annotations. The most important annotations provide a consistent way to annotate buffer parameters or return values for a function. The appropriate macro for a given buffer can be constructed by using the information in the tables in this section. Use only one buffer annotation for each parameter.

Understanding the TypeDescriptor: A Metadata Engine for Designtime Code - Partho's Weblog. Hi folks - long time no see... E.L.D.S.? Yeah, sure! Never mind that, here is a dump of my understanding of the TypeDescriptor. Hope you find it useful! What is Metadata in the context of CLR? Now we all know that the all-powerful and mighty .NET Framework Designtime infrastructure lets every component have 2 views of itself – a designtime view and a runtime view. Every Form on the design surface of a Visual Studio 2005 DeviceApplication project has a property called FormFactor. This means that the designtime infrastructure is displaying a metadata different from what is returned by reflection API. The System.ComponentModel.TypeDescriptor of course! TypeDescriptor is a metadata engine provided by the .NET FCL. ... That is not quiet correct. To restate: Unlike the native CLR metadata engine, TypeDescriptor lets you inspect as well as modify the metadata (add, change and delete) of the target in any conceivable manner.

Here is an example of metadata inspection using TypeDescriptor: SYSK 293: Business Rules – Easy, Flexible, Decoupled - AppDev: Something You Should Know by Irena Kennedy. From what I see, in this version, Microsoft Windows Workflow Foundation doesn’t allow you to author and use business rules without a link to an activity or a workflow… Also, the types of rules you can create are somewhat limited… After spending some time trying to fit WF into what I needed, I recalled the simplicity of the Microsoft ScriptControl object that allowed you to run VBScript or JavaScript code snippets, and even allowed to pass in parameters… I wanted to have a mechanism where I can execute a .NET code snippet that was not previously compiled with the simplicity of the following statement: ScriptEngine.Evaluate(codeBody, methodToInvoke, methodParameters); So, I decided to create a class that can compile and run C# code on the fly… Imagine being able to create your business rules in C# (or VB.NET), maintain them in some secure but easy to edit place like database, and execute them when needed… Here is my code (as always, use at your own risk, etc…): using System; using System.Text;

Programatic Configuraton - Enterprise Library (v2.0) Logging Block. ObjectBuilder Dependency Injection Framework. Enterprise Library : Configuration Part 1.1.3 - ConfigurationContext - Being Scott Densmore. Last week I did a podcast (why do we call it that when we use the WMA format?) With Ron Jacobs on the ConfigurationContext. I know that the talk was abstract and probably a little hard to follow and I hope to clear that up today with another explanation and samples.

I want to start off by saying that we intentionally did not document this “feature” because: a) we ran out of time , b) we knew it was a hard concept to cover, and c) I didn’t think people would be that interested (see what you get when you assume things). What is the ConfigurationContext ? Glad you asked. The ConfigurationContext is where your configuration data lives when it is loaded from storage and is the interface for read and writing this configuration data. . Most people don’t have a problem using their app.config or web.config for storing there meta-data configuration. The first way to do this is using the ConfigurationDictionary object. See this post for examples on how this works. . ). Now playing: 311 - Omaha Stylee. Rob Caron. Visual Studio Widgets. Prism. Patterns & practices Developer Center June 2013 Prism provides guidance to help you more easily design and build, flexible, and easy-to-maintain client business apps that run on Windows Runtime, Windows Presentation Foundation (WPF) desktop, Silverlight, or Windows Phone 7.

These apps may start small and evolve over time. Using design patterns that embody important architectural design principles, such as separation of concerns and loose coupling, Prism helps you to design and build apps that embody significant presentation and business logic that typically interact with back-end systems and services and, using a layered architecture, may be physically deployed across multiple tiers. Developing a Windows Store business app using C#, XAML, and Prism for the Windows Runtime shipped in May 2013. As part of the guidance, we created a simplified version of Prism that is optimized for Windows Runtime development. The Prism family of guidance provides support for the multiple platforms. Modifying the Guidance Package. With the Windows Installer of the Smart Client Software Factory, you can choose to install the source code for the guidance package, install the guidance package and register it, or you can choose to both install the source code and register the guidance package.

When you choose to register the guidance package, the installer copies the guidance package contents and assemblies to your computer. When you install the source code, you can compile the guidance package to create the assemblies. The guidance package you can register with Windows Installer and the guidance package you can install as source code are identical with the exception of their identifiers. This means you can customize the guidance package source code, register it, and use it side by side with the guidance package that is registered by Windows Installer. You can modify the existing guidance package, or create new guidance packages, to customize the Smart Client Software Factory. Registering a Guidance Package. Web Service Software Factory - View Discussion. Hi, I've been fighting with this for a while to no avail. What I'm trying to do is add context sensitive menu option to add some additional files to the selected project. The problem comes with needing to add files to different folders and the creation of the folders.

I can code a recipe to add the files (generated using t4 templates) to the root folder without any problems. The challenge is to generate the folders and then add a file to the root and then a file to the new folder. Currently I bind the recipe to the project in the vstemplate file for the project (as below) and in this code I have to set the target. The AddErrorHandlingComponents recipe is then defined in the ASMX Guidance Package.xml file. Any ideas would be much appreciated. Geordie. Patterns & practices Guidance Explorer. IVsProject2.AddItem Method (UInt32, VSADDITEMOPERATION, String, UInt32, String[], IntPtr, VSADDRESULT[]) (Microsoft.VisualStudio.Shell.Interop) Creates new items in a project, adds existing files to a project, or causes Add Item wizards to be run.

Namespace:Microsoft.VisualStudio.Shell.InteropAssembly:Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll) int AddItem( uint itemidLoc, VSADDITEMOPERATION dwAddItemOperation, string pszItemName, uint cFilesToOpen, string[] rgpszFilesToOpen, IntPtr hwndDlgOwner, VSADDRESULT[] pResult ) Parameters itemidLoc Type: System.UInt32 [in] Identifier of the container folder for the item being added. DwAddItemOperation Type: Microsoft.VisualStudio.Shell.Interop.VSADDITEMOPERATION [in] Operation applied to the newly created item. PszItemName Type: System.String [in] Name of the item to be added. cFilesToOpen [in] Number of items in rgpszFilesToOpen. RgpszFilesToOpen Type: System.String[] [in, size_is(cFilesToOpen)] Array of pointers to OLESTR file names.

HwndDlgOwner Type: System.IntPtr [in] Handle to the Add Item dialog box. pResult Return Value COM Signature From vsshell.idl: INFO: List of known project type Guids. Introduction This article provides a list of known project type Guids. More Information Every Visual Studio project has a project type (Windows project, Smart Device project, Web Site project, etc.) and in some cases more than one type (subtypes or flavors). Every project type is identified by a unique Guid, so every project has one or more project type Guids. Project type Guids are stored generally in the project file: <PropertyGroup> <ProjectTypeGuids>{A860303F-1F3F-4691-B57E-529FC101A107};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids> ...

But for some special projects (such as some database projects) and projects lacking a file (such as Web Site projects), the project type is stored also in the solution file: Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SqlServerProject1", "SqlServerProject1.vbproj", "{BE5F0BE0-93CD-4FCE-A853-9096A442DF1B}" EndProject ...

Dxcorecommunityplugins - Community-contributed plugins for DXCore. IntelliSense/Browsing options in VC++ 2010 - Visual C++ Team Blog.