Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source code for contract jack #85

Open
wants to merge 2 commits into
base: linux-x86_64
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
77 changes: 77 additions & 0 deletions AvP2/AVP2.dsw
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!

###############################################################################

Project: "ClientRes"=.\ClientRes\ClientRes.dsp - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
}}}

###############################################################################

Project: "ClientShellDLL"=.\ClientShellDLL\ClientShellDLL.dsp - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
}}}

###############################################################################

Project: "Object"=.\ObjectDLL\Object.dsp - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
}}}

###############################################################################

Project: "ServerApp"=.\AVP2Serv\ServerApp.dsp - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
}}}

###############################################################################

Project: "ServerRes"=.\ServerRes\ServerRes.dsp - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
}}}

###############################################################################

Global:

Package=<5>
{{{
}}}

Package=<3>
{{{
}}}

###############################################################################

116 changes: 116 additions & 0 deletions AvP2/AVP2Serv/SelectConfigDlg.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// SelectConfigDlg.cpp : implementation file
//

#include "stdafx.h"
#include "serverapp.h"
#include "SelectConfigDlg.h"
#include "Globals.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSelectConfigDlg dialog


CSelectConfigDlg::CSelectConfigDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSelectConfigDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSelectConfigDlg)
//}}AFX_DATA_INIT
}


void CSelectConfigDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSelectConfigDlg)
DDX_Control(pDX, IDOK, m_OKCtrl);
DDX_Control(pDX, IDC_CONFIG, m_ConfigCtrl);
//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSelectConfigDlg, CDialog)
//{{AFX_MSG_MAP(CSelectConfigDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSelectConfigDlg message handlers

BOOL CSelectConfigDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Add all the config files to the combobox.
AddConfigFilesToControl( );

// Enable the OK button only if there are config files found.
m_OKCtrl.EnableWindow( !!m_ConfigCtrl.GetCount( ));

// Get the number of configs.
int nNumConfigs = m_ConfigCtrl.GetCount( );

// If there are no items to select from, then exit.
if( nNumConfigs == 0 )
{
PostMessage( WM_COMMAND, MAKEWPARAM( IDCANCEL, 0 ));
}
else
{
// Select the first item if there are items.
m_ConfigCtrl.SetCurSel( 0 );

// If there's just one config, just select it.
if( nNumConfigs == 1 )
PostMessage( WM_COMMAND, MAKEWPARAM( IDOK, 0 ));
}

return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

BOOL CSelectConfigDlg::AddConfigFilesToControl( )
{
CFileFind fileFind;
CString sConfigFileSearch;

// Create a search string to find all the config files in the config directory.
sConfigFileSearch = SERVER_OPTIONS_CONFIG_DIRECTORY;
sConfigFileSearch += "*";
sConfigFileSearch += SERVER_OPTIONS_CONFIG_EXTENSION;
BOOL bFound = fileFind.FindFile( sConfigFileSearch );
while( bFound )
{
// Get the information about the file found and continue the search.
bFound = fileFind.FindNextFile( );

// Skip directories and dots.
if( fileFind.IsDirectory( ) || fileFind.IsDots( ))
continue;

// Add just the title of the file to the control. Don't add the path
// or the extension. The serverdlg will figure it out.
m_ConfigCtrl.AddString( fileFind.GetFileTitle( ));
}

return TRUE;
}



void CSelectConfigDlg::OnOK()
{
// Save the config selected.
if( m_ConfigCtrl.GetCurSel( ) != LB_ERR )
{
m_ConfigCtrl.GetWindowText( m_sConfig );
}

CDialog::OnOK();
}

58 changes: 58 additions & 0 deletions AvP2/AVP2Serv/SelectConfigDlg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#if !defined(AFX_SELECTCONFIGDLG_H__F3DCDFB1_C80A_41BE_AD06_F1577BE6E79B__INCLUDED_)
#define AFX_SELECTCONFIGDLG_H__F3DCDFB1_C80A_41BE_AD06_F1577BE6E79B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SelectConfigDlg.h : header file
//

#include "Resource.h"

/////////////////////////////////////////////////////////////////////////////
// CSelectConfigDlg dialog

class CSelectConfigDlg : public CDialog
{
// Construction
public:
CSelectConfigDlg(CWnd* pParent = NULL); // standard constructor

// Returns the selected config.
CString GetSelectedConfig( ) { return m_sConfig; }

// Dialog Data
//{{AFX_DATA(CSelectConfigDlg)
enum { IDD = IDD_SELECTCONFIG };
CButton m_OKCtrl;
CComboBox m_ConfigCtrl;
//}}AFX_DATA


// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSelectConfigDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:

// Adds all the config files to the combobox.
BOOL AddConfigFilesToControl( );

// Generated message map functions
//{{AFX_MSG(CSelectConfigDlg)
virtual BOOL OnInitDialog();
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CString m_sConfig;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SELECTCONFIGDLG_H__F3DCDFB1_C80A_41BE_AD06_F1577BE6E79B__INCLUDED_)
85 changes: 85 additions & 0 deletions AvP2/AVP2Serv/ServerApp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Server.cpp : Defines the class behaviors for the application.
//


// Includes...

#include "stdafx.h"
#include "ServerApp.h"
#include "ServerDlg.h"
#include "Resource.h"

// Globals...

HINSTANCE g_hInst = NULL;

// Functions...

/////////////////////////////////////////////////////////////////////////////
// CServerApp

BEGIN_MESSAGE_MAP(CServerApp, CWinApp)
//{{AFX_MSG_MAP(CServerApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CServerApp construction

CServerApp::CServerApp(LPCTSTR lpszAppName) : CWinApp(lpszAppName)
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CServerApp object

CServerApp theApp("AVP2Serv");

CServerApp* GetTheApp()
{
return(&theApp);
}


/////////////////////////////////////////////////////////////////////////////
// CServerApp initialization

BOOL CServerApp::InitInstance()
{
AfxEnableControlContainer();

// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.

#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif

// Get our instance handle...
g_hInst = AfxGetInstanceHandle();

return TRUE;
}

int CServerApp::Run( )
{
CServerDlg dlg;
m_pMainWnd = &dlg;

int nResponse = dlg.DoModal();

// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.

return nResponse;
}

Loading