Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

WTL Helper

, 27 Aug 2007
Add-in for Microsoft VC++.NET 2003 that helps to insert message handlers for WTL.
wtlhelper.zip
WTLHelper.exe
wtlhelper_exe.zip
WTLHelper.exe
wtlhelper_src.zip
source
AddIn.def
Dialog
vssver.scc
Options
res
a1.ico
AddIn.rgs
addin8.rgs
closefld.ico
Clsdfold.ico
DDX.bmp
dialog.bmp
functoolbar.bmp
icons.bmp
message.ico
msg.bmp
mysmall4.bmp
openfld.ico
Openfold.ico
option.bmp
vartoolbar.bmp
vssver.scc
wizard.bmp
Wizard.ico
WtlHelper.dll.manifest
resources
Setup.nsi
WtlHelperRes
res
DDX.bmp
dialog.bmp
msg.bmp
option.bmp
reflect.bmp
wizard.bmp
WtlHelperRes.aps
WtlHelperRes8.vcproj.MINSK.solozhentsev.user
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2004 Sergey Solozhentsev
// Author: 	Sergey Solozhentsev e-mail: salos@mail.ru
// Product:	WTL Helper
// File:      	InsertPoint.h
// Created:	17.01.2005 9:58
// 
//   Using this software in commercial applications requires an author
// permission. The permission will be granted to everyone excluding the cases
// when someone simply tries to resell the code.
//   This file may be redistributed by any means PROVIDING it is not sold for
// profit without the authors written consent, and providing that this notice
// and the authors name is included.
//   This file is provided "as is" with no expressed or implied warranty. The
// author accepts no liability if it causes any damage to you or your computer
// whatsoever.
//
////////////////////////////////////////////////////////////////////////////////

#pragma	  once

#include "VSElements.h"
#include "HandlerManager.h"

//����������� ������ �������, ���������� � ������ �������, ����������� ���������� EnvDTE
#define INSERT_STEP_ENVDTE		1
//����������� ���������� �������, ������� ������� �������, �������� map � ��������� 
//�������
#define INSERT_STEP_GLOBAL		2
//����������� map entry
#define INSERT_STEP_MAP_ENTRY	3

#define INSERT_POINT_UNKNOWN				0
#define INSERT_POINT_FUNC					1
#define INSERT_POINT_VAR					2
#define INSERT_POINT_MAP					3
#define INSERT_POINT_ALT_MAP				4
#define INSERT_POINT_MAP_ENTRY				5
#define INSERT_POINT_HANDLER				6
#define INSERT_POINT_DDX					7
#define INSERT_POINT_SPEC_FUNC				9
#define INSERT_POINT_INCLUDE				10
#define INSERT_POINT_DDXSUPPORT				11
#define INSERT_POINT_REPLACE_END_MSG_MAP	12

struct InsertionPoint
{
	VSElement* pElement;
	int Type;
	virtual HRESULT Insert(VSClass* pClass, int Step) = NULL;
	InsertionPoint(int iType = INSERT_POINT_UNKNOWN) : Type(iType)
	{
	}
	virtual ~InsertionPoint(){};
};

struct InsertPointFunc : public InsertionPoint
{
	CString Body;
	HRESULT Insert(VSClass* pClass, int Step);
	InsertPointFunc(int iType = INSERT_POINT_FUNC);
};

struct InsertPointVariable : public InsertionPoint
{
	HRESULT Insert(VSClass* pClass, int Step);
	InsertPointVariable(int iType = INSERT_POINT_VAR);
};

struct InsertPointMap : public InsertionPoint
{
	HRESULT Insert(VSClass* pClass, int Step);
	InsertPointMap(int iType = INSERT_POINT_MAP);
};

struct InsertPointAltMap : public InsertionPoint
{
	VSMessageMap* pParentMap;
	CString DefineName;
	HRESULT Insert(VSClass* pClass, int Step);
	InsertPointAltMap(int iType = INSERT_POINT_ALT_MAP);
};

struct InsertPointMapEntry : public InsertionPoint
{
	VSMap* pParentMap;
	HRESULT Insert(VSClass* pClass, int Step);
	InsertPointMapEntry(int iType = INSERT_POINT_MAP_ENTRY);
};

struct InsertPointHandler : public InsertPointMapEntry
{
	VSFunction* pFunction;
	CString Body;
	HRESULT Insert(VSClass* pClass, int Step);
	InsertPointHandler(int iType = INSERT_POINT_HANDLER);
};

struct InsertPointDDX : public InsertPointMapEntry
{
	VSVariable* pVariable;
	CString Initializer;
	HRESULT Insert(VSClass* pClass, int Step);
	InsertPointDDX(int iType = INSERT_POINT_DDX);
private:
	HRESULT AddInitializer(VSFunction* pFunc);
};

struct InsertSpecFunction : public InsertPointFunc
{
	VSBase* pBase;
	CString OnCreateBody;
	CString OnDestroyBody;
	MessageStruct* pMesCreate;
	MessageStruct* pMesDestroy;
	bool bInitDialog;
	HRESULT Insert(VSClass* pClass, int Step);
	InsertSpecFunction(int iType = INSERT_POINT_SPEC_FUNC);
};

struct InsertInclude : public InsertionPoint
{
	HRESULT Insert(VSClass* pClass, int Step);
	EnvDTE::ProjectItemPtr pProjectFile;
	_variant_t Pos;
	CString AdditionalMacro;
	InsertInclude(int iType = INSERT_POINT_INCLUDE);
	~InsertInclude();
private:
	EnvDTE::CodeElementPtr pInclude;
};

struct InsertPointDDXSupport : public InsertionPoint
{
	bool bUseFloat;
	VSBase* pBase;
	HRESULT Insert(VSClass* pClass, int Step);
	InsertPointDDXSupport(int Type = INSERT_POINT_DDXSUPPORT);
	~InsertPointDDXSupport();
private:
	EnvDTE::EditPointPtr pFloatPoint;
};

struct InsertPointReplaceEndMap : public InsertionPoint
{
	InsertPointReplaceEndMap();
	HRESULT Insert(VSClass* pClass, int Step);
};

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Sergey Solozhentsev
Web Developer
Belarus Belarus
I am a software developer for 3 years.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141223.1 | Last Updated 27 Aug 2007
Article Copyright 2004 by Sergey Solozhentsev
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid