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

WTL Toolbar Helper

, 11 Dec 2006 CPOL
Add text, drop-down menus, and comboboxes to a WTL toolbar.
toolbarhelper.zip
toolbarhelpersample.zip
ToolbarHelperSample.exe
toolbarhelpersamples.zip
ToolbarHelperSampleVS6
Release
ToolbarHelperSampleVS6.exe
res
mainfram.bmp
toolbar.bmp
ToolbarHelperSampleVS6.exe.manifest
ToolbarHelperSampleVS6.ico
ToolbarHelperSampleVS6.dsp
ToolbarHelperSampleVS6.dsw
ToolbarHelperSample
Release
ToolbarHelperSample.exe
res
mainfram.bmp
Toolbar.bmp
ToolbarHelperSample.ico
// ToolbarHelperSampleVS6.cpp : main source file for ToolbarHelperSampleVS6.exe
//

#include "stdafx.h"
#include "resource.h"
#include "aboutdlg.h"
#include "MainFrm.h"

CAppModule _Module;

int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
	CMessageLoop theLoop;
	_Module.AddMessageLoop(&theLoop);

	CMainFrame wndMain;

	if(wndMain.CreateEx() == NULL)
	{
		ATLTRACE(_T("Main window creation failed!\n"));
		return 0;
	}

	wndMain.ShowWindow(nCmdShow);

	int nRet = theLoop.Run();

	_Module.RemoveMessageLoop();
	return nRet;
}

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
	HRESULT hRes = ::CoInitialize(NULL);
// If you are running on NT 4.0 or higher you can use the following call instead to 
// make the EXE free threaded. This means that calls come in on a random RPC thread.
//	HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
	ATLASSERT(SUCCEEDED(hRes));

	// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
	::DefWindowProc(NULL, 0, 0, 0L);

	AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES);	// add flags to support other controls

	hRes = _Module.Init(NULL, hInstance);
	ATLASSERT(SUCCEEDED(hRes));

	int nRet = Run(lpstrCmdLine, nCmdShow);

	_Module.Term();
	::CoUninitialize();

	return nRet;
}

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)

Share

About the Author


| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.1411023.1 | Last Updated 11 Dec 2006
Article Copyright 2006 by Rob Caldecott
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid