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

COM from scratch - PART TWO

, 17 Apr 2004
An article about COM Library.
demoapp.zip
demoappsource.zip
ComDemo
ComDemo.clw
ComDemo.dsp
ComDemo.dsw
Comp1
Comp1.clw
Comp1.def
Comp1.dsp
Comp1.dsw
Debug
icon1.ico
Release
res
Comp2
Comp2.clw
Comp2.def
Comp2.dsp
Comp2.dsw
Debug
Release
res
Comp3
Comp3.clw
Comp3.def
Comp3.dsp
Comp3.dsw
Debug
res
Debug
Release
res
bitmap1.bmp
bitmap2.bmp
bitmap3.bmp
bitmap4.bmp
bitmap5.bmp
bitmap6.bmp
bitmap7.bmp
bitmap8.bmp
bitmap9.bmp
bmp00001.bmp
bmp00002.bmp
bmp00003.bmp
bmp00004.bmp
bmp00005.bmp
bmp00006.bmp
butterfl.ico
com.bmp
ComDemo.ico
ComDemoDoc.ico
ico00001.ico
ico00002.bmp
ico00002.ico
ico00003.ico
ico00004.ico
icon1.ico
Toolbar.bmp
parttwosources.zip
part_two
part_two_client
Debug
part_two_client.dsp
part_two_client.dsw
part_two_component
component.def
Component.dll
MAKEFILE
part_two_improved_client_server
client
client.dsp
client.dsw
Debug
Component
Component.clw
Component.def
Component.dsp
Component.dsw
Debug
Component.dll
res
part_two_rebuildproblem
client
client.dsp
client.dsw
Debug
DLL.dll
DLL
Debug
DLL.dsp
DLL.dsw
// MainFrm.cpp : implementation of the CMainFrame class
//

#include "stdafx.h"
#include "ComDemo.h"

#include "MainFrm.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMainFrame

IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
	//{{AFX_MSG_MAP(CMainFrame)
	ON_WM_CREATE()
	ON_WM_ACTIVATE()
	//}}AFX_MSG_MAP

END_MESSAGE_MAP()

static UINT indicators[] =
{
	ID_SEPARATOR,           // status line indicator
	ID_INDICATOR_CAPS,
	ID_INDICATOR_NUM,
	ID_INDICATOR_SCRL,
};

/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction

CMainFrame::CMainFrame()
{
	// TODO: add member initialization code here
	
}

CMainFrame::~CMainFrame()
{
}

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	// TODO: Delete these three lines if you don't want the toolbar to
	//  be dockable
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBar);

	return 0;
}

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	if( !CFrameWnd::PreCreateWindow(cs) )
		return FALSE;
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return TRUE;
}

/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics

#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
	CFrameWnd::AssertValid();
}

void CMainFrame::Dump(CDumpContext& dc) const
{
	CFrameWnd::Dump(dc);
}


#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers




void CMainFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) 
{
	CFrameWnd::OnActivate(nState, pWndOther, bMinimized);
	
	
}

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

Aria Ansari
Software Developer
Denmark Denmark
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 18 Apr 2004
Article Copyright 2004 by Aria Ansari
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid