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

Undocumented Visual C++

, 17 Sep 2000
Spelunking in the Badlands of MSDEV
//*******************************************************************************
// COPYRIGHT NOTES
// ---------------
// You may use, compile or redistribute this source as part of your application 
// for free. You may not redistribute it as a part of a software development 
// library without the agreement of the author. If the sources are 
// distributed along with the application, you should leave the original 
// copyright notes in the source code without any changes.
// This code can be used WITHOUT ANY WARRANTIES on your own risk.
// 
// Nick Hodapp
// nhodapp@codeveloper.com
//
//*******************************************************************************

// cstm1dlg.cpp : implementation file
//

#include "stdafx.h"
#include "ExtensionAddin.h"
#include "cstm1dlg.h"
#include "ExtensionAddinAw.h"

#ifdef _PSEUDO_DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDlgExtAddin1 dialog


CDlgExtAddin1::CDlgExtAddin1()
: CAppWizStepDlg(CDlgExtAddin1::IDD)
{
	//{{AFX_DATA_INIT(CDlgExtAddin1)
	m_strDescription = _T("CoDeveloper Generated Addin");
	//}}AFX_DATA_INIT
}


void CDlgExtAddin1::DoDataExchange(CDataExchange* pDX)
{
	CAppWizStepDlg::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgExtAddin1)
	DDX_Control(pDX, IDC_STATIC_URL, m_staticUrl);
	DDX_Control(pDX, IDC_CDBITMAP, m_staticBmp);
	DDX_Text(pDX, IDC_EDIT_ADDIN_DESCRIPTION, m_strDescription);
	DDX_Text(pDX, IDC_EDIT_ADDIN_NAME, m_strName);
	DDX_Text(pDX, IDC_EDIT_ADDIN_OBJNAME, m_strObjName);
	//}}AFX_DATA_MAP
}

// This is called whenever the user presses Next, Back, or Finish with this step
//  present.  Do all validation & data exchange from the dialog in this function.
BOOL CDlgExtAddin1::OnDismiss()
{
	if (!UpdateData(TRUE))
		return FALSE;

	m_strName.TrimLeft();
	m_strName.TrimRight();

	m_strObjName.TrimLeft();
	m_strObjName.TrimRight();

	// simple validation:
	for (int i = 0, iMax = m_strObjName.GetLength() ; i < iMax ; i++)
	{
		int c = m_strObjName.GetAt(i);

		if ((!isalpha(c) && !isdigit(c)) || (i == 0 && isdigit(c)))
		{
			AfxMessageBox("Invalid object name.  Use letters and digits only.", MB_OK, 0);
			UpdateData(FALSE);
			return FALSE;
		}
	}

	ExtensionAddinAW.m_Dictionary[_T("ADDIN_NAME")] = m_strName;
	ExtensionAddinAW.m_Dictionary[_T("ADDIN_OBJNAME")] = m_strObjName;
	ExtensionAddinAW.m_Dictionary[_T("ADDIN_DESCRIPTION")] = m_strDescription;

	return TRUE;	// return FALSE if the dialog shouldn't be dismissed
}


BEGIN_MESSAGE_MAP(CDlgExtAddin1, CAppWizStepDlg)
	//{{AFX_MSG_MAP(CDlgExtAddin1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CDlgExtAddin1 message handlers

BOOL CDlgExtAddin1::OnInitDialog() 
{
	CAppWizStepDlg::OnInitDialog();
	
	// Init bitmap
	m_Bitmap.LoadBitmap(IDB_CODEVELOPER);
	m_staticBmp.SetBitmap(m_Bitmap);

	CRect	rclClient; GetClientRect(&rclClient);
	CRect rcl; m_staticBmp.GetClientRect(&rcl);
	m_staticBmp.SetWindowPos(NULL, (rclClient.Width()/2)-rcl.Width()/2, 5, 0, 0, SWP_NOSIZE | SWP_NOZORDER);

	ExtensionAddinAW.m_Dictionary.Lookup(_T("root"), m_strName);
	ExtensionAddinAW.m_Dictionary.Lookup(_T("root"), m_strObjName);

	UpdateData(FALSE);

	return TRUE;
}


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

Nick Hodapp
Web Developer
United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 18 Sep 2000
Article Copyright 2000 by Nick Hodapp
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid