.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Smart Cleanup: Achieve More Reliable Resource Management with Our Custom C++ Classes

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

Managing resources in C++ is not easy. When you're unsuccessful, your app can leak all kinds of resources including file system handles, database connections, and, of course, memory. Even in garbage-collected languages like Managed C++, resource management is difficult because garbage collection only deals with memory management, not the other resources that cause performance problems.In this article, the author describes the SmartAny template library he created, which uses a policy-based approach to dynamic resource management. Readers will learn how to use the SmartAny classes and policies to ensure the proper cleanup of their resources, be they files, OS handles, or native and unmanaged objects.

Eric Niebler

MSDN Magazine June 2003

View Complete Post

More Related Resource Links

Netting C++: Resource Cleanup


Last time Stan Lippman did not consider the visibility of types and nondeterministic finalization in writing his TQL wrapper code. This month he rewrites the code.

Stanley B. Lippman

MSDN Magazine August 2006

Smart Tags: Simplify UI Development with Custom Designer Actions in Visual Studio


Windows Forms 2.0 components expose smart tags by utilizing Designer Actions. By taking advantage of this feature, you can add smart tags to your own custom components to make setting their properties and other actions much easier and developer-friendly.

Michael Weinhardt

MSDN Magazine July 2005

Resource File: Windows Media 9 Series Digital Rights Management


If you have an application that handles Windows Media content and you need an effective way to track content usage, Windows Media 9 Series now offers Digital Rights Management (DRM). It allows you to take advantage of the peer-to-peer distribution model and still redirect users back to your app once they have downloaded your content (prior to viewing).

MSDN Magazine May 2003

Office XP: Build a Custom DLL to Expose Your Objects and Services Through Smart Tag Technology


Smart Tags is a new technology delivered with Office XP that makes it easy for users to complete common tasks on familiar and relevant data regardless of the application they are using. Microsoft provides tools to make it easy to roll out simple Smart Tag applications using XML as a backbone. The Smart Tag SDK provides the detail needed to build a COM automation server for Smart Tags in Visual Basic or Visual C++. This article brings the reader through the SDK to outline the process of building a Smart Tag DLL using the tag recognizer and the action provider to create customized user experiences.

Paul Sanna

MSDN Magazine January 2002

Custom controls and ViewState management issue



I want to know that when we create custom controls, then is there State Management through ViewState done automatically or we have to handle it explicitely ?Since i have created Custom Controls that is behaving as if it is not maintaining its state on PostBack.

SharePoint 2010 Enterprise Content Management Resource Center - NEW!

Find developer resources for using the comprehensive ECM object model to manage documents, records, managed metadata, rich media assets, and web content.

SharePoint 2010: Application Lifecycle Management (ALM) Resource Center

Are you looking for information about BCS? BCS enables users to read and write data from external systems-through web services, databases, and .NET assemblies.

What happened to the backup and restore classes in namespace Microsoft.SqlServer.Management.Smo vers

I do not see these two classes in version 10 of this namespace and I am not finding any documentation explaining what happened to them.

Custom Classes for Tabs Control

I want to apply a custom class to the header text of the tabs. However, the documentation indicates that all I have to do is supply a custom class to override the default. The font is being changed as expected but it appears that all of the other classes are being overridden as well. .CustomTabStyle .ajax__tab_tab { font-family: Tahoma; font-size: 10px; } . <ajax:TabContainer runat="server" CssClass="CustomTabStyle" ActiveTabIndex="0" Height="150px" Width="690px" style="margin:5px"> <ajax:TabPanel runat="server" HeaderText="Contact Information"> <ContentTemplate> Contact Information Here </ContentTemplate> </ajax:TabPanel> <ajax:TabPanel ID="TabPanel1" runat="server" HeaderText="Miscellaneous Information"> <ContentTemplate> Miscellaneous Information Here </ContentTemplate> </ajax:TabPanel> </ajax:TabContainer>

Query Correlation faliure using custom Request/Reply Message Contract classes.

Hi,I have a service which is correlated by a Guid query. When I'm using designer created Message Content/Parameters feature for message definition, everithing working lika a charm. But If I define custom [MessageContract] Request/Reply classes (where request class has Guid SvcUID property for correlation), and choose'em as Message Content in the designer with proper CorrelatesOn definition of course, I have got a service exception about correlation query faliure. Have you folks tried to apply your custom [MessageContract] classes for correlated communication?

returning arrays of custom serialized classes



I have the following class:

  [XmlRoot("person", Namespace = "http://mme.se")]
  public class Person : IXmlSerializable
    public string FirstName;

    public static XmlQualifiedName MySchema(XmlSchemaSet xs)
      string xsd =
        @"<?xml version='1.0' encoding='utf-8'?>
<xs:schema id='person' 
 <xs:complexType name='personType'>
   <xs:element name='f' type='xs:string'/>

      var schemaSerializer = new XmlSerializer(

How to achieve Custom Forms Authentication



In my earlier verison, I used Active Directory to authenticate users which was Custom. In the sense that, I had passed UserName and password along with a token request through datalayer to authenticate against AD. it would eventually check the DomainName\UserName, password against AD and will get authenticated.

Well, now, I have to do similar thing using Forms.
Can some one explain in detail how to I achieve this custom forms authentication?

Custom directory Management service


hi,I want to customize the way contatc is created in AD by sharepoint when an email address is assigned to it.

for example, when an email address is assigned, it creates contact in AD but without Email address. I would like to update that Email address and other propperties like disply name when a contact is created.

Additionally I want t create folder structure (Container/SubContainer) which imitates Sharepoint contact's hierarchy.

like if on share point server list is created at home> subsite >myList. I want my contact to be created as homecontainer>subsitecontainer :contact, where homecontainer, subsitecontainerare containers in Active directory.

Achieve Dwm color blurs on custom blurred windows


I've made a picture to describe my question best, as words really could not do it properly this time. The question and notes are included in the picture. http://localhostr.com/files/c7c2fe/Colorization.png

Transcript of notes:

Color Averages:

  • Blur: #FEC1C1
  • Unfocused: #FEC1C1
  • Focused: #DE6868
  • Taskbar: #DC6161

Question: How can I achieve the focused/taskbar color blends on a blur window.


  • The blur window is created with DwmEnableBlurBehindWindow

  • The glass windows are created with DwmExtendFrameIntoClientArea

  • No extra color handling has been done (i.e. rectangles/backgrounds)

  • Average colors calculated by a maximal gaussian blur on the GIMP.

  • Colorization information is obtained with DwmGetColorizationParameters

Using the ProfileService with custom profile classes.



I'm not sure if this is the right place to post, but here it goes.

We've been using the asp.net Profile system for a while now, but now we want to access Profiles, Roles etc. from a WCF service.

We have a problem with the ProfileService, probably because the ProfileService doesn't know our custom profile classes (KnownType).

Here is what we have in web.config for the service:

<profile inherits="MyCompany.Web.Profile.MyAppProfile" defaultProvider="SqlProvider" enabled="true" automaticSaveEnabled="true">
        <add name="SqlProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="UserRepository" applicationName="MyApp" description="SqlProfile for MyApp"/>

Basically, we need to expose the properties in the MyComany.Web.Profile.MyAppProfile. This class inherits ProfileBase and has some pointers to other profile classes containing the actual properties we want to expose:

public class MyAppProfile : ProfileBase

Resource Governor, IS_MEMBER and custom role

I'm doing some testing with resource governor and the is_member function.  I can get it to pick up a user assigned to a standard database role, such as db_owner, but not a custom role I created in a database.  Is there anyway to get it to work with a custom role?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend