|
|
1.1 ! root 1: /* chat.cpp */ ! 2: ! 3: /* Local sysop chat module (GUI Borland C++ Builder Project for Win32) */ ! 4: ! 5: /* $Id: chat.cpp,v 1.1.1.1 2000/10/10 11:27:23 rswindell Exp $ */ ! 6: ! 7: /**************************************************************************** ! 8: * @format.tab-size 4 (Plain Text/Source Code File Header) * ! 9: * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * ! 10: * * ! 11: * Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html * ! 12: * * ! 13: * This program is free software; you can redistribute it and/or * ! 14: * modify it under the terms of the GNU General Public License * ! 15: * as published by the Free Software Foundation; either version 2 * ! 16: * of the License, or (at your option) any later version. * ! 17: * See the GNU General Public License for more details: gpl.txt or * ! 18: * http://www.fsf.org/copyleft/gpl.html * ! 19: * * ! 20: * Anonymous FTP access to the most recent released source is available at * ! 21: * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * ! 22: * * ! 23: * Anonymous CVS access to the development source and modification history * ! 24: * is available at cvs.synchro.net:/cvsroot/sbbs, example: * ! 25: * cvs -d :pserver:[email protected]:/cvsroot/sbbs login * ! 26: * (just hit return, no password is necessary) * ! 27: * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src * ! 28: * * ! 29: * For Synchronet coding style and modification guidelines, see * ! 30: * http://www.synchro.net/source.html * ! 31: * * ! 32: * You are encouraged to submit any modifications (preferably in Unix diff * ! 33: * format) via e-mail to [email protected] * ! 34: * * ! 35: * Note: If this box doesn't appear square, then you need to fix your tabs. * ! 36: ****************************************************************************/ ! 37: ! 38: //--------------------------------------------------------------------------- ! 39: ! 40: #include <vcl.h> ! 41: #pragma hdrstop ! 42: USERES("chat.res"); ! 43: USEFORM("MainFormUnit.cpp", MainForm); ! 44: int node_num=0; ! 45: char node_number[32]=""; ! 46: char ctrl_dir[MAX_PATH+1]=""; ! 47: char node_dir[MAX_PATH+1]=""; ! 48: char user_name[128]=""; ! 49: //--------------------------------------------------------------------------- ! 50: WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR cmdline, int) ! 51: { ! 52: char* p; ! 53: char* argv=NULL; ! 54: char str[256]; ! 55: int argc=0; ! 56: int len=0; ! 57: ! 58: wsprintf(str,"CHAT: %s\r\n",cmdline); ! 59: OutputDebugString(str); ! 60: ! 61: for(p=cmdline;*p;p++) { ! 62: switch(argc) { ! 63: case 0: ! 64: argv=ctrl_dir; ! 65: break; ! 66: case 1: ! 67: argv=node_dir; ! 68: break; ! 69: case 2: ! 70: argv=node_number; ! 71: break; ! 72: default: ! 73: argv=user_name; ! 74: break; ! 75: } ! 76: if(*p==' ' && argc<3) { ! 77: argv[len]=0; ! 78: argc++; ! 79: len=0; ! 80: continue; ! 81: } ! 82: argv[len++]=*p; ! 83: } ! 84: if(argv!=NULL) ! 85: argv[len]=0; ! 86: ! 87: if(!user_name[0]) ! 88: return 0; ! 89: ! 90: node_num=(atoi(node_number)); ! 91: ! 92: try ! 93: { ! 94: Application->Initialize(); ! 95: Application->CreateForm(__classid(TMainForm), &MainForm); ! 96: Application->Run(); ! 97: } ! 98: catch (Exception &exception) ! 99: { ! 100: Application->ShowException(&exception); ! 101: } ! 102: return 0; ! 103: } ! 104: //---------------------------------------------------------------------------
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.