www.pudn.com > 天堂1服务端模拟程序.rar > AccountMaker.cpp


/* 
Copyright (C) 2004  freeplay.dk 
 
This program is free software; you can redistribute it and/or 
modify it under the terms of the GNU General Public License 
as published by the Free Software Foundation; either version 2 
of the License, or (at your option) any later version. 
 
This program is distributed in the hope that it will be useful, 
but WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
GNU General Public License for more details. 
 
You should have received a copy of the GNU General Public License 
along with this program; if not, write to the Free Software 
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
 
You may contact me for further information on admin@freeplay.dk 
*/ 
#define WIN32_LEAN_AND_MEAN 
 
#include  
#include  
#include  
#include  
#include  
#include  
#include  
#include  
#include  
#include  
#include  
#include  
#include "Database.h" 
#include "resource.h" 
#include "AccountMaker.h" 
#include "Logging.h" 
 
#define SIZE 256 
 
HWND mainwnd5; 
extern database db; 
 
BOOL CALLBACK AccountDlgProc(HWND hdwnd, UINT Message, WPARAM wParam, LPARAM lParam) 
{ 
    switch(Message) 
    { 
		mainwnd5 = GetParent(hdwnd); 
    case WM_INITDIALOG: 
	 
	return TRUE; 
        case WM_COMMAND: 
		switch(LOWORD(wParam)) 
        { 
		case IDOK: 
			EndDialog(hdwnd, IDOK); 
		break; 
  		case IDCANCEL: 
			EndDialog(hdwnd, IDCANCEL); 
        break; 
		case IDC_CREATE: 
			char * name = new char[10]; 
			char * pass = new char[10]; 
			char * email = new char[50]; 
			GetDlgItemText(hdwnd, IDC_NAME, name, 10); 
			GetDlgItemText(hdwnd, IDC_PASS, pass, 10); 
			GetDlgItemText(hdwnd, IDC_EMAIL, email, 50); 
 
			db.createaccount(hdwnd, name, pass, email, "0"); 
			EndDialog(hdwnd, IDC_CREATE); 
		break; 
		} 
        default: 
            return FALSE; 
    } 
    return TRUE; 
}