Click here to Skip to main content
15,895,740 members
Articles / Programming Languages / C++

ToDoList Add-on

Rate me:
Please Sign up or sign in to vote.
4.69/5 (6 votes)
20 Apr 2002CPOL3 min read 242.3K   2.9K   57  
A Visual Studio add-in to help navigate to TODO:, TASK: etc comments, as well as showing STL containers in debug mode such as std::string, std::list etc
/***************************************************************************/
/* NOTE:                                                                   */
/* This document is copyright (c) by Oz Solomonovich, and is bound by the  */
/* MIT open source license (www.opensource.org/licenses/mit-license.html). */
/* See License.txt for more information.                                   */
/***************************************************************************/

#ifndef __ADDINCOMM_H
#define __ADDINCOMM_H

extern "C" {

#ifndef DECLARE_OPAQUE
#define DECLARE_OPAQUE(name)    typedef struct { int unused; } name##__ ; \
        typedef const name##__ * name; \
        typedef name*  LP##name
#endif

// handle to add-in
DECLARE_OPAQUE(HADDIN);

// this is the prototype of the command handling function for your add-in
typedef int (AddinCmdHandler_t)(LPCTSTR pCmd);


// maximum length of addin names
#define MAX_ADDIN_NAME_LEN      128
#define MAX_ADDIN_VER_STR_LEN   MAX_ADDIN_NAME_LEN


// -- registration --

// registers your add-in.  returns the handle or NULL on error
HADDIN __declspec(dllexport) AICRegisterAddIn(LPCTSTR pName, int iVerMaj, 
    int iVerMin, int iVerExtra, AddinCmdHandler_t *pCmdFn = NULL);

// you must unregister your add-in with this function before the program 
// exits.  the function returns 'true' on success.
bool __declspec(dllexport) AICUnregisterAddIn(HADDIN hAddIn);


// -- add-in information --

// returns the number of addins registered for the running DevStudio 
// instance
int __declspec(dllexport) AICGetAddInCount();

// fills an array with handles to all the registered addins
// you must allocate the memory for the array.  returned handles are 
// read-only.
void __declspec(dllexport) AICGetAddInList(HADDIN addin_array[]);

// get an add-in by it's name.  returned handle is read-only.  
// NULL is returned if the addin isn't registered.
// TIP: don't save this value, because the user might load/unload add-ins
// at runtime from the Tools|Customize|Add-ins dialog.
HADDIN __declspec(dllexport) AICGetAddIn(LPCTSTR pName);

// returns the name of an addin.  returns a temporary string that should be
// copied.
LPCTSTR __declspec(dllexport) AICGetAddInName(HADDIN hAddIn);

// returns the version of the add-in.  in case of error, all integers are
// set to -1
void __declspec(dllexport) AICGetAddInVersion(HADDIN hAddIn, int& iVerMaj,
    int& iVerMin, int& iVerExtra);

// returns a string describing the program and it's version.  if the program
// didn't set a special string, the function returns it's version parameters
// formatted as "#.#.#".  
// the returned is is a temporary and should be copied.
// Non critical, available starting version 1.2.0
LPCTSTR __declspec(dllexport) AICGetAddInVersionString(HADDIN hAddIn);

// set the string describing the program and it's version.  if you don't call
// this function, a default string will be generated
// Non critical, available starting version 1.2.0
void __declspec(dllexport) AICSetAddInVersionString(HADDIN hAddIn, 
    LPCTSTR pszVerStr);


// -- commands --

// send a command to a specified addin.  the return value is specific to the
// add-in executing the command.
int __declspec(dllexport) AICSendCommand(HADDIN hAddIn, LPCTSTR pCommand);


// -- misc --

// DLL version information
void __declspec(dllexport) AICGetDllVersion(int& iVerMaj, int& iVerMin,
                                            int& iVerExtra);


} // extern "C"

#endif // __ADDINCOMM_H

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO ArtfulBits Inc.
Ukraine Ukraine
Name:Kucherenko Oleksandr

Born:September 20, 1979

Platforms: Win32, Linux; - well known and MS-DOS; Win16; OS/2 - old time not touched;

Hardware: IBM PC

Programming Languages: Assembler (for Intel 80386); Borland C/C++; Borland Pascal; Object Pascal; Borland C++Builder; Delphi; Perl; Java; Visual C++; Visual J++; UML; XML/XSL; C#; VB.NET; T-SQL; PL/SQL; and etc.

Development Environments: MS Visual Studio 2001-2008; MS Visual C++; Borland Delphi; Borland C++Builder; C/C++ any; Rational Rose; GDPro; Together and etc.

Libraries: STL, ATL, WTL, MFC, NuMega Driver Works, VCL; .NET 1.0, 1.1, 2.0, 3.5; and etc.

Technologies: Client/Server; COM; DirectX; DirectX Media; BDE; HTML/DHTML; ActiveX; Java Servlets; DCOM; COM+; ADO; CORBA; .NET; Windows Forms; GDI/GDI+; and etc.

Application Skills: Databases - design and maintain, support, programming; GUI Design; System Programming, Security; Business Software Development. Win/Web Services development and etc.

Comments and Discussions