Click here to Skip to main content
Click here to Skip to main content
Articles » Database » Database » General » Downloads
 
Add your own
alternative version

PostgreSQL/libpqxx Class Generator

, 18 Aug 2006
Automated generation of PostgreSQL data transfer classes.
/***************************************************************************
 pgpqgen.cpp  -  This file contains the entry point, and the code that
                 creates the main property sheet window and calls its
				 DoModal method.

 begin     : December 2004
 copyright : (C) 2004-2006 by Phil Cairns
 email     : oti169@hotmail.com
 $Id: pgpqgen.cpp 2080 2006-08-18 01:53:19Z phil $

 This code may be used in compiled form in any way you desire (including
 commercial use). The code may be redistributed unmodified by any means
 providing it is not sold for profit without the authors written consent,
 and providing that this notice and the authors name and all copyright
 notices remains intact.

 This software is provided "as is" without express or implied warranty. Use
 it at your own risk!
 ***************************************************************************/

#include "stdafx.h"

#include <atlframe.h>
#include <atlctrls.h>
#include <atldlgs.h>

#include "resource.h"

#include "GlobalData.h"
#include "PGWizConnect.h"
#include "PGWizTarget.h"
#include "PGWizTables.h"
#include "PGWizGenerate.h"

CAppModule _Module;

// Run method creates and executes the property sheet (Modally)
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
	CMessageLoop theLoop;
	_Module.AddMessageLoop(&theLoop);

	CPropertySheet sheet(_T("PostgreSQL libpqxx-based Class Generator"));
	PGWizConnect page1;
	PGWizTarget page2;
	PGWizTables page3;
	PGWizGenerate page4;

	sheet.AddPage(page1);
	sheet.AddPage(page2);
	sheet.AddPage(page3);
	sheet.AddPage(page4);
	sheet.SetWizardMode();

	sheet.DoModal();

	_Module.RemoveMessageLoop();
	return 0;
}

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_BAR_CLASSES);	// add flags to support other controls

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

	int nRet = Run(lpstrCmdLine, nCmdShow);

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

	GlobalDataS::close();

	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 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

_oti

Australia Australia
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.1411023.1 | Last Updated 18 Aug 2006
Article Copyright 2005 by _oti
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid