Articles by Nish

Initially, all my articles used to be mirrored both on my web-site as well as on The Code Project, but this became a hassle since I had to update both versions whenever I made changes. I've decided not to maintain a mirror here and instead I will solely be publishing on The Code Project. Way easier that way, and I also get the advantage of the article-forum provided there.

Recently published articles

Using Newtonsoft JsonConvert to easily construct a derived class from a base instance

Minimal code to copy a base object into a derived instance

Exiting an Azure WebJob programmatically

Shows how to programmatically stop/exit a WebJob on Azure

How to get Azure WebJobs logging to Application Insights

Details the additional steps needed to get WebJobs logging to Application Insights.

Powering Autonomous Capability Domains using an Enterprise Event Stream

Patterns used to power autonomous capability domains using an enterprise event stream

Injecting an interface into unrelated types via partial classes

This how-to article explores an approach using partial classes to inject a common interface into unrelated types that are auto-generated from web services or other external sources

7 reasons C++ devs will love the VS 14 CTP

The article goes through sevean language and IDE features in the VS 14 CTP 2 that are specific to C++ development

Using the Microsoft Azure Storage Client Library for C++

This is an overview of the Microsoft Azure Storage Client Library for C++ with basic code snippets

CodeProject 10 Million Members Celebration

In the summer of 2013, CodeProject celebrated hitting 10 million members and invited various CodeProject members to host get-togethers around the world. Here are some of the goings-on at those celebrations.

C++ 11 features in Visual C++ 2013 Preview

This is a quick overview of ISO C++ 11 compiler features that are supported in VC++ 2013 Preview

Using Casablanca to consume a REST API

The article walks through using the Casablanca REST API library to consume a REST web service from C++ code

Introduction to using MVVM with Visual C++ 2012

Writing a basic Windows Store Hello World equivalent using VC++ and MVVM

A Coder Interview with Nish Nishant

Welcome to our continuing series of CodeProject interviews in which we talk to developers about their backgrounds, projects, interests and pet peeves. In this installment we talk to Nish Nishant, a literal CodeProject legend.

Using lambdas - C++ vs. C# vs. C++/CX vs. C++/CLI

A comparative look at lambdas in C++ and C# with focus on the differences and similarities in lambda usage across the languages and their variants.

Visual C++ and WinRT/Metro - Databinding Basics

An introduction to using WinRT databinding with Visual C++

Visual C++ and WinRT/Metro - Some fundamentals

The fundamentals of using Visual C++ to consume and create WinRT objects

The Code Project Forum Analyzer : Find out how much of a life you don't have!

This is an unofficial Code Project application that can analyze forums over a range of posts to retrieve posting statistics for individual members.

Adding data-bindable attributes to C# enums using the dynamic runtime

This article is about a very light-weight enum extension library that takes advantage of dynamic types in .NET 4.0 to provide a simple way to add meta attributes to an enum field.

Resetting a View Model in WPF MVVM applications without code-behind in the view

The core idea behind this code and article is to provide an uncomplicated approach to reset a view-model without having to adjust DataContext references in views.

Code Project Posts Analyzer for Windows Phone 7

This is a WP7 application that will analyze your most recent posts and give you summarized statistics on your forum wide posting split up.

CP Vanity Lite

This is a lightweight version of Luc Pattyn's popular CP Vanity application

PopClient - A POP3 companion to SmtpClient

PopClient is an asynchronous POP3 library with support for SSL and attachments

Code Project Forums : New Posts Monitor

This application monitors for new posts in the Code Project forums.

WPF Tutorial - Part 1 : Transformations

A brief introduction to using transformations with the WPF

Handling a Window's Closed and Closing events in the View-Model

This article discusses an attached behavior that lets you handle the View Window's Closed and Closing events via commands in the View-Model

Setting non-numeric grid row/column sizes in WPF/Silverlight

John, here's a simpler way to do this. This will also handle strings like "3*" which are valid grid length values in Xaml.private RowDefinition MakeRowDefinition(string height){ RowDefinition rowDef = new RowDefinition(); GridLengthConverter converter = new...

EXIF Compare Utility using WPF

The Exif Compare Utility is a WinDiff equivalent for image files that compares the Exif meta-data and displays the differences and similarities. The application is written using WPF and MVVM.

An MVVM friendly approach to adding system menu entries in a WPF application

This article shows you how to add menu items to the system menu and attach command handlers in an MVVM compatible fashion

An explorative peek into generating deterministic primes through a multi-level multi-language tunneling apparatus

This paper is a summary of a research exercise conducted in conjunction by Nish Sivakumar, Professor Cuthbert Calculus, and Glenn Quagmire.

An extensible ExifReader class with customizable tag handlers

An ExifReader class in C# that supports custom formatting and extraction. StyleCop compliant code, with demos for WPF and Windows Forms.

An LCS based diff-ing library in C#

This is an LCS based diff library that was written for the Code Project Lean and Mean diff engine contest

A first look at the Windows Web Services API

The article shows how to interop between a WCF service and a WWS client, and also how to rewrite the WCF service in WWS retaining compatibility with existing WCF clients.

A generic Trictionary class

This article describes a generic Trictionary class derived from Dictionary that allows two values of different types per key

C++/CLI HowTo : Deriving from a C# disposable class

This article walks through the implementation of a C++/CLI class from a disposable C# base.

Using a TypeDescriptionProvider to support dynamic run-time properties

This articles explains how to implement a TypeDescriptionProvider for a class to support multiple object types using a single class type

A look at STL/CLR performance for linear containers

The performance of STL/CLR sequence containers are compared with that of corresponding BCL generic collection classes

Deploying MFC applications via ClickOnce

A step by step tutorial on how to deploy an MFC application via ClickOnce

A data-bound multi-column combobox

An ownerdrawn multi-column combobox class with support for data-binding

Using and extending the Orcas marshal_as library

This article covers basic marshal_as usage, as well as how to extend marshal_as to support additional type conversions

WPF Tutorial - Part 2 : Writing a custom animation class

This article covers how animations can be applied on properties that do not have an associated animation class

C++/CLI in Action - Using interior and pinning pointers

Excerpt from Chapter 4 on interior and pinning pointers

C++/CLI in Action - Instantiating CLI classes

This is an excerpt from Chapter 1 that covers how CLI classes are instantiated, and discusses constructors and assignment operators

C++/CLI in Action - Declaring CLR types

Excerpts from Chapter 1. Topics are (1) Declaring CLR types and (2) Handles: The CLI equivalent to pointers

How to drag a virtual file from your app into Windows Explorer

Shows how to use CFSTR_FILEDESCRIPTOR and CFSTR_FILECONTENTS to perform drag/drop with virtual files

C++/CLI Library classes for interop scenarios

The article takes a brief look at some not so commonly used classes such as auto_handle, lock, and ptr.

A modal dialog that fades the background to gray-scale imitating the XP shutdown screen

DimmerDialog is a .NET class that shows a modal dialog which grays out the rest of the background, just like the Windows XP Shutdown dialog. This can be used when your application needs to show a very important message box or form that requires immediate user attention.

Using the Windows Forms 2.0 MenuStrip and ToolStrip controls to give your MFC applications a new look and feel

This article demonstrates how to use the Windows Forms 2.0 MenuStrip and ToolStrip controls in an MFC SDI application, using C++/CLI, to get the Office 2003 style menu and toolbar

MessageBoxManager - A Windows Forms component that provides enhanced MessageBox functionality

MessageBoxManager is a Windows Forms component that you can drag & drop into a Windows Forms project's main form, and it gives you enhanced message box functionality without forcing you to change your existing calls to any of the MessageBox.Show() overloads

CAutoNativePtr - A managed smart pointer for using native objects in managed code

CAutoNativePtr is a managed template class that acts as a smart pointer, and is handy for using native objects in managed code.

Using WinForms controls in an MFC dialog

This article is a simple introduction to using the CWinFormsControl MFC class to put a Windows Forms control on an MFC dialog.

A rational attempt to substantiate C++/CLI as a first class CLI language

Why the author thinks that C++/CLI has its own unique role to play as a first-class .NET programming language

The coding gentleman's guide to detecting the .NET Framework

A C++ class that will detect and enumerate the active CLR versions on a machine

Shell Tray Info - Arrange your system tray icons

A tool with full source code that enumerates tray icons and allows you to reposition them as well as send mouse messages.

Function pointers and Delegates - Closing the gap!

Explains the usage of the Marshal class methods GetFunctionPointerForDelegate and GetDelegateForFunctionPointer, and compares their performance with the P/Invoke mechanism.

CProcessData : A template class to ease up SendMessage calls across processes

CProcessData is a template class that makes it easy to use data allocated in a different process, and is useful when making inter-process SendMessage/PostMessage calls.

How to accurately detect if an application is theme-enabled?

Describes a function that overcomes the inadequacies of IsAppThemed and IsThemeActive.

MAC Address Changer for Windows XP/2003

A freeware program (with source code) that allows you to change the MAC ID of your network adapter

CNullable : A convenient Nullable equivalent class for C++/CLI

CNullable can be used to represent a value type (or simple native type) such that the type can be nulled. You can also compare it to nullptr using the == and != operators both of which have been overloaded.

StringConvertor : A convertor class for managed-unmanaged string conversions that handles memory de-allocations

A convertor class for managed-unmanaged string conversions that handles memory de-allocations. Caller need not worry about freeing unmanaged memory allocations.

C++/CLI Properties - Syntactic sugar for accessor methods

Looks at the syntax for the declaration and use of properties in C++/CLI

Simulating polymorphic operator overloads with C#

Article shows how to overcome the C# insistence on operator overloads being static and describes a method for simulating polymorphic behavior for operator overloads.

Send mail without specifying an SMTP server

A class derived from CSMTPConnection that queries the MX record for a target domain and uses that to send mail

Using generics in C++/CLI

Introduces generics and compares it with templates

Guide to using Pinning Pointers

Article on the usage and dangers of pinning pointers

An overview of interior pointers in C++/CLI

Tries to explain the syntax, usage and behavior of interior pointers in C++/CLI

Deterministic Destruction in C++/CLI

Looks at how deterministic destruction is possible with C++/CLI

Arrays in C++/CLI

The article exposes the new array syntax available in C++/CLI for the declaration and use of CLI arrays

Function overriding in C++/CLI

Takes a look at new features like explicit overriding, renamed overriding, multiple overriding and sealing a method

A tool to strip zips of unwanted files before submitting to CodeProject

The CPZipStripper tool with source code

Bug when using the java.util.zip classes to write zip files

Describes an issue when writing a binary file into a zip file using the java.util.zip classes

A first look at C++/CLI

A brief look at the new C++/CLI syntax and how it improves over the old MC++ syntax

To new is C++; To malloc is C; To mix them is sin

Article explains the differences between malloc/free and new/delete in a C++ context

A quick guide to using nested repeaters in ASP.NET

Using nested repeaters in ASP.NET with an XML data store

MultiMail 2.0 - Freeware SMTP stress testing tool

This free program can be used to stress test SMTP servers. It also aids anti-Spam tool developers as a useful mail-bombardment tool.

The virtual bool bug

Describes the virtual bool bug that exists in mixed mode Managed C++ programs that access unmanaged classes

Managed Exception Handling using VC++.NET

An introduction to managed exception handling in MC++ programs

Manipulating Windows using messages and simple CBT hooking

Demonstrates techniques using windows messages and hooks, which allow us to automate a windows properties dialog or even custom applications

The singular non-modality of MFC modal dialogs

Explains the pseudo modality of CDialog based modal dialogs and a problem with the CDialog::EndDialog implementation

Changing default icons for folders and drives

Shows how to globally change the icons for folders and drives. Also shows some nifty tricks you might find handy in your applications.

Getting and setting desktop folder names

Gives you copy/paste-able functions to retrieve the localized folder names, and to set/get user-defined folder names for dekstop folders

The Complete Guide to C++ Strings, Part II - String Wrapper Classes

A guide to the string wrapper classes provided by Visual C++ and class libraries

CPopProxyMT - A multi-threaded POP3 proxy skeleton

CPopProxyMT is a skeletal class that wraps a multi-threaded POP3 proxy. You can further modify this class to suite your needs.

CDocument::DoSave revealed

Explains how you can suppress the File-Save-As dialog in a Doc/View app, how to save files to multiple formats, and how DoSave is implemented.

Some handy dialog box tricks, tips and workarounds

Hidden modal dialogs, stealing focus, always on top dialogs, going full-screen, expanding and contracting dialogs, removing task bar icon, context sensitive help and many other useful tips and tricks.

CFormatDriveDialog - A wrapper class for the undocumented SHFormatDrive API function

A wrapper class for SHFormatDrive (XP/2K only). Corrects some errors in KB article Q173688

Casting Basics - Use C++ casts in your VC++.NET programs

Demonstrates and compares the various casting operators available. Also suggests when to use and what to use!

Delay MessageBox with auto-close option

This message box delays its dismissal by disabling the OK button for a delay interval. It also has an optional auto-close feature. There are two versions, one uses a WH_CBT hook and some basic window tricks like sub-classing to achieve its goal. The other one is more MFC-ied.

A statistical analysis of the performance variations of assorted managed and unmanaged languages

This article compares and contrasts the relative performances of various languages like native C++, Visual Basic 6, C#, VB.NET, Managed C++, MC++ and native code mix, ngen'd assemblies etc. using a prime number generation function as a generic benchmark

Window Sizer

A hot-key based program that lets you resize your current window to any size. Useful for web designers and GUI developers as it helps avoid frequent screen-resolution changes.

An editable multi-line listbox for .NET

An owner drawn listbox that supports multi-line word-wrapped text as well as in-place editing.

FontComboBox - a font listing combo box for .NET

A fully owner drawn ComboBox derived class for enumerating and choosing fonts

A newbie's elementary guide to spawning processes

Gives an elementary introduction to the use of ShellExecute/ShellExecuteEx, CreateProcess, WaitForSingleObject. How to bring up the Find window, the Properties window.

ToolTipListBox - a list box with tool tips

A ListBox derived class that shows tool-tips for items that won't fit within the width of the list box

Ordered ListBox

A ListBox derived class that supports internal ordering and re-ordering of items

N-Track : Work-Time tracking system

A work time tracking system that includes a Managed C++ remoting server and MFC clients that use the managed extensions. The application demonstrates how to mix managed and unmanaged code.

Implementing Callback functions using IJW (avoiding DllImport)

Shows how you can call native API functions that require callbacks using IJW, and without the use of DllImport attribute. The technique allows you to pass a delegate as the callback function just as in the MS recommended manner except, I show you how to do this without the ugly DllImport attribute.

Creating draggable windows - SDI and dialogs

Shows how you can create windows that can be dragged around, not just through the title bar, but anywhere within the window body

Introduction to Managed C++

An attempt to get a beginner started on Managed C++

Outlook style GUI - three-way split form

Demonstrates the usage of splitters, treeviews, listviews, panels, toolbars