okpiao 님이 쓰신 글 :
: 얼마전 친구한테서 델파이로 만들어진 화상 메신져 소스를 받았는데요..
: 저는 프로그램에 대해서 왕초보 랍니다..
: 그래서 고수님들의 도움이 피료한데요...
: 이거좀 도와주세요..
:
: 아마도 제생각엔 TypeDef.inc 이라는 파일이 한개가 없는거 같던데..
:
: 실행시킬려니까 [Fatal Error] Globals.pas(8): File not found: '..\TypeDef.inc' 이런 문구가 뜨더군요..
:
: Globals.pas 파일의 소스는 아래와 같습니다
:
: unit Globals;
:
: interface
:
: uses
: Windows, Classes, SysUtils, Forms, IniFiles;
:
: {$INCLUDE '..\TypeDef.inc'}
:
: // ----------------------------------------------------------------------------
: // Constant
: // ----------------------------------------------------------------------------
: const
: PS_PORT = 10501; // Presencer Server 기본포트
: CS_PORT = 10502; // Chat Server 기본포트
: VIDEO_PORT = 10503; // Video 기본 포트
: VOICE_SEND_PORT = 10505; // Voice 송신 포트
: VOICE_RECV_PORT = 10506; // Voice 수신 포트
: NDS_PORT = 10504; // NetworkDetect Server 기본포트
: // ---------------------------------------------------------------------------
:
: // by 권호석 2004.09.06 ------------------------------------------------------
: // MAX_BUFFER_SIZE = 65536;
: // 기존의 65536바이트를 넘는 경우가 발생해 사이즈를 좀 더 늘렸다.
: // by 권호석 2004.09.23 ----------------------------------------------------
: // 상수값으로 했을경우 98에서 싸이즈를 수용못할까봐 형을 지정해서 값을 넣음
: MAX_BUFFER_SIZE = 100000; // 네트워크 상으로 데이터를 한번에 읽을 수 있는 크기
: // ---------------------------------------------------------------------------
: MAIN_TOP_HEIGHT = 200; // 메인화면 위 메뉴부분 높이
: MAIN_PUBLIC_HEIGHT = 131; // 메인화면 아래 공지사항 부분 높이
:
: CRLF = #13#10;
: CRLFCRLF = #13#10#13#10;
:
: DEFAULT_SITE = '
http://www.kissgirl.co.kr';
: DEFAULT_ADDR = '121.212.7.45';
: DEFAULT_NAME_K = '키스걸';
: DEFAULT_NAME_E = 'kissgirl';
: DEFAULT_CAPTION = '키스걸';
: // NOTICE_CAPTION = '[캐스토피아 알림]';
:
: DEFAULT_ITEM_PATH = '/pdsfile/item/';
:
: // ----------------------------------------------------------------------------
: // TGlobal
: // ----------------------------------------------------------------------------
: type
: TGlobal = class
: public
: constructor Create;
: destructor Destroy; override;
: procedure Load;
: procedure Save;
: public // INI file 과 관련되지 않은 정보
: ClientState : TClientState;
: public // INI file 과 관련된 정보
: // 메인폼 좌표 정보
: MainLeft, MainTop, MainWidth, MainHeight: Integer;
: // 채팅폼 좌표 정보
: ChatLeft, ChatTop, ChatWidth, ChatHeight: Integer;
: // GK 정보
: GK_URL: String;
: // 로그인 정보
: SaveID: Boolean;
: ID: String;
: PW: String; // INI file에 저장하지 않는다.
: PurposeIndex: Integer;
: public
: // 개인정보 (Process_Login 에서 세팅된다)// INI file에 저장하지 않는다.
: NickName: String;
: Sex: String;
: Location: String;
: Age: Integer;
: Level: Integer;
: Purpose: String;
: PictureURL: String;
: // 채팅관련초기값
: {
: ChatDecPoint1 : Integer; // 채팅비용 1
: ChatDecPoint2 : Integer; // 채팅비용 2
: ChatDecPoint3 : Integer; // 채팅비용 3
: ChatDecPoint4 : Integer; // 채팅비용 4
: ChatDecPoint5 : Integer; // 채팅비용 5
: ChatDecPoint6 : Integer; // 채팅비용 6
: ChatDecPoint7 : Integer; // 채팅비용 7
: ChatDecPoint8 : Integer; // 채팅비용 8
: }
: MaxInspectPoint : Integer; // 관람불가 포인트
:
: // 환경설정정보
: AllowMemo: Boolean;
: AlarmBuddy: Boolean;
: AllowInspect: Boolean; // 여자전용
: AlarmCondition: Boolean;
: AlarmLocation: String;
: AlarmSex: String;
: AlarmLowerAge: Integer;
: AlarmUpperAge: Integer;
: AllowSMS: Boolean;
: SMSStarTime: String;
: SMSEndTime: String;
: InitChatPoint: Integer; // 여자전용
: // 기타 정보
: Point: Integer;
: // 디버그 옵션
: ViewChangePoint: Boolean;
: AutoOpenVideo: Boolean;
: // Audio Tuning Wizard
: RecordDeviceID: Integer;
: PlayDeviceID: Integer;
: PlayVolume: Integer;
: RecordVolume: Integer;
: // ServerVoice
: ServerVoiceBufferCount: Integer;
: ServerVoicePort: Integer;
: ServerVoiceThreadPriority: Integer;
: ServerVoiceKeepAliveTime: DWORD;
: // ClientVoice
: ClientVoiceBufferCount: Integer;
: ClientVoiceRecvPort: Integer;
: ClientVoiceSendPort: Integer;
: ClientVoiceThreadPriority: Integer;
: ClientVoiceMinThresholdTime: DWORD;
: ClientVoiceMaxThresholdTime: DWORD;
: // Version 정보
: Version: String;
: // by 권호석 2004.08.27 ----------------------------------------------------
: // Network Type 정보
: NetworkType : TNetworkType;
: NetworkPort : Integer;
: WaitTime : Integer;
: // -------------------------------------------------------------------------
: Monitor : Boolean;
: MonitorID : String;
: end;
:
: var
: Global: TGlobal = nil;
: // MAX_BUFFER_SIZE : Integer;
:
: // ----------------------------------------------------------------------------
: // General Function
: // ----------------------------------------------------------------------------
: function IfThen(Condition: Boolean; TrueValue: String; FalseValue: String): String;
: function StrToState(StrState: String): TClientState;
: function StrToNetworkType(Value: String): TNetworkType;
: function NetworkTypeToStr(Value: TNetworkType): String;
: procedure ActiveApplication;
: function StringToPriceType( PriceType : String ): TPriceType;
: function PriceTypeToString( PriceType : TPriceType ): String;
:
: implementation
:
: // ----------------------------------------------------------------------------
: // TGlobal
: // ----------------------------------------------------------------------------
: constructor TGlobal.Create;
: begin
: inherited;
: ClientState := csNone;
: // 개인정보
: Sex := '';
: Location := '';
: Age := 0;
: Load;
:
: // by 권호석 2004.09.23 -------------------------------------------------
: // 상수값으로 했을경우 98에서 싸이즈를 수용못할까봐 형을 지정해서 값을 넣음
: // MAX_BUFFER_SIZE := 10000;
: // ----------------------------------------------------------------------
: end;
:
: destructor TGlobal.Destroy;
: begin
: Save;
: inherited;
: end;
:
: procedure TGlobal.Load;
: var
: Path: String;
: IniFile: TIniFile;
: begin
: Path := ExtractFilePath(Application.ExeName);
: IniFile := TIniFile.Create(Path + DEFAULT_NAME_E + '.ini');
: // 메인폼 좌표 정보
: MainLeft := IniFile.ReadInteger('Coordination', 'MainLeft', -1);
: MainTop := IniFile.ReadInteger('Coordination', 'MainTop', 0);
: MainWidth := IniFile.ReadInteger('Coordination', 'MainWidth', 500);
: MainHeight := IniFile.ReadInteger('Coordination', 'MainHeight', 640);
: // 채팅폼 좌표 정보
: ChatLeft := IniFile.ReadInteger('Coordination', 'ChatLeft', -1);
: ChatTop := IniFile.ReadInteger('Coordination', 'ChatTop', -1);
: ChatWidth := IniFile.ReadInteger('Coordination', 'ChatWidth', -1);
: ChatHeight := IniFile.ReadInteger('Coordination', 'ChatHeight', -1);
: // GK 정보
: GK_URL := IniFile.ReadString('URL', 'GK_URL', DEFAULT_SITE + '/gk.txt');
: // 로그인 정보
: SaveID := IniFile.ReadBool('Login', 'SaveID', false);
: ID := IniFile.ReadString('Login', 'ID', '');
: // by 권호석 2004.09.09 ----------------------------------------------------
: // 비밀번호를 초기화시킨다.
: PW := '';
: // PW := IniFile.ReadString('Login', 'PW', '');
: // -------------------------------------------------------------------------
:
: PurposeIndex := IniFile.ReadInteger('Login', 'PurposeIndex', 0);
: // 디버그 옵션
: ViewChangePoint := IniFile.ReadBool('Debug', 'ViewChangePoint', false);
: AutoOpenVideo := IniFile.ReadBool('Debug', 'AutoOpenVideo', true);
: // Audio Tuning Wizard
: RecordDeviceID := IniFile.ReadInteger('AudioTuningWizard', 'RecordDeviceID', 0);
: PlayDeviceID := IniFile.ReadInteger('AudioTuningWizard', 'PlayDeviceID', 0);
: PlayVolume := IniFile.ReadInteger('AudioTuningWizard', 'PlayVolume', 10);
: RecordVolume := IniFile.ReadInteger('AudioTuningWizard', 'RecordVolume', 10);
: // ServerVoice
: ServerVoiceBufferCount := IniFile.ReadInteger('ServerVoice', 'BufferCount', 2);
: ServerVoicePort := IniFile.ReadInteger('ServerVoice', 'Port', 11010);
: ServerVoiceThreadPriority := IniFile.ReadInteger('ServerVoice', 'ThreadPriority', THREAD_PRIORITY_TIME_CRITICAL);
: ServerVoiceKeepAliveTime := IniFile.ReadInteger('ServerVoice', 'KeepAliveTime', 10000);
: // ClientVoice
: ClientVoiceBufferCount := IniFile.ReadInteger('ClientVoice', 'BufferCount', 2);
: ClientVoiceRecvPort := IniFile.ReadInteger('ClientVoice', 'RecvPort', 11011);
: ClientVoiceSendPort := IniFile.ReadInteger('ClientVoice', 'SendPort', 11010);
: ClientVoiceThreadPriority := IniFile.ReadInteger('ClientVoice', 'ThreadPriority', THREAD_PRIORITY_TIME_CRITICAL);
: ClientVoiceMinThresholdTime := IniFile.ReadInteger('ClientVoice', 'MinThresholdTime', 120);
: ClientVoiceMaxThresholdTime := IniFile.ReadInteger('ClientVoice', 'MaxThresholdTime', 1000);
:
: // by 권호석 2004.08.27 ----------------------------------------------------
: // Network Type 정보
: if( NetworkType = ntNone ) then
: begin
: NetworkType := TNetworkType( IniFIle.ReadInteger( 'NetworkDetect', 'NetworkType', 0 ) );
: end;
: NetworkPort := IniFile.ReadInteger( 'NetworkDetect', 'Port', 10054 );
: WaitTime := IniFile.ReadInteger( 'NetworkDetect', 'WaitTime', 100 );
: // -------------------------------------------------------------------------
:
: IniFile.Free;
:
: IniFile := TIniFile.Create(Path + 'Version.ini');
: // Version 정보
: Version := IniFile.ReadString('Version', 'Version', '');
:
: Inifile.Free;
: //--------------------------------------------------------------------------
: end;
:
: procedure TGlobal.Save;
: var
: Path: String;
: IniFile: TIniFile;
: begin
: Path := ExtractFilePath(Application.ExeName);
: IniFile := TIniFile.Create(Path + DEFAULT_NAME_E + '.ini');
:
: try
: // 메인폼 좌표 좌표
: IniFile.WriteInteger('Coordination', 'MainLeft', MainLeft);
: IniFile.WriteInteger('Coordination', 'MainTop', MainTop);
: IniFile.WriteInteger('Coordination', 'MainWidth', MainWidth);
: IniFile.WriteInteger('Coordination', 'MainHeight', MainHeight);
: // 채팅폼 좌표 정보
: IniFile.WriteInteger('Coordination', 'ChatLeft', ChatLeft);
: IniFile.WriteInteger('Coordination', 'ChatTop', ChatTop);
: IniFile.WriteInteger('Coordination', 'ChatWidth', ChatWidth);
: IniFile.WriteInteger('Coordination', 'ChatHeight', ChatHeight);
: // GK
: IniFile.WriteString('URL', 'GK_URL', GK_URL);
: // 로그인 정보
: IniFile.WriteBool('Login', 'SaveID', SaveID);
: IniFile.WriteString('Login', 'ID', ID);
: // IniFile.WriteString('Login', 'PW', PW); // INI file에 저장하지 않는다.
: IniFile.WriteInteger('Login', 'PurposeIndex', PurposeIndex);
: // 디버그 옵션
: IniFile.WriteBool('Debug', 'ViewChangePoint', ViewChangePoint);
: IniFile.WriteBool('Debug', 'AutoOpenVideo', AutoOpenVideo);
: // Audio Tuning Wizard
: IniFile.WriteInteger('AudioTuningWizard', 'RecordDeviceID', RecordDeviceID);
: IniFile.WriteInteger('AudioTuningWizard', 'PlayDeviceID', PlayDeviceID);
: IniFile.WriteInteger('AudioTuningWizard', 'PlayVolume', PlayVolume);
: IniFile.WriteInteger('AudioTuningWizard', 'RecordVolume', RecordVolume);
: // ServerVoice
: IniFile.WriteInteger('ServerVoice', 'BufferCount', ServerVoiceBufferCount);
: IniFile.WriteInteger('ServerVoice', 'Port', ServerVoicePort);
: IniFile.WriteInteger('ServerVoice', 'ThreadPriority', ServerVoiceThreadPriority);
: IniFile.WriteInteger('ServerVoice', 'KeepAliveTime', ServerVoiceKeepAliveTime);
: // ClientVoice
: IniFile.WriteInteger('ClientVoice', 'BufferCount', ClientVoiceBufferCount);
: IniFile.WriteInteger('ClientVoice', 'RecvPort', ClientVoiceRecvPort);
: IniFile.WriteInteger('ClientVoice', 'SendPort', ClientVoiceSendPort);
: IniFile.WriteInteger('ClientVoice', 'ThreadPriority', ClientVoiceThreadPriority);
: IniFile.WriteInteger('ClientVoice', 'MinThresholdTime', ClientVoiceMinThresholdTime);
: IniFile.WriteInteger('ClientVoice', 'MaxThresholdTime', ClientVoiceMaxThresholdTime);
:
: // by 권호석 2004.08.27 ------------------------------------------------
: // Network Type 정보
: IniFile.WriteInteger('NetworkDetect', 'NetworkType', Integer(NetworkType) );
: IniFile.WriteInteger('NetworkDetect', 'Port', NetworkPort );
: IniFile.WriteInteger('NetworkDetect', 'WaitTime', WaitTime );
: // ---------------------------------------------------------------------
: finally
: IniFile.Free;
: end;
: end;
:
: // ----------------------------------------------------------------------------
: // General Function
: // ----------------------------------------------------------------------------
: function IfThen(Condition: Boolean; TrueValue: String; FalseValue: String): String;
: begin
: if Condition then
: Result := TrueValue
: else
: Result := FalseValue;
: end;
:
: function StrToState(StrState: String): TClientState;
: begin
: if StrState = 'CS_NONE' then
: Result := csNone
: else if StrState = 'CS_LOGOUT' then
: Result := csLogout
: else if StrState = 'CS_LOGIN' then
: Result := csLogin
: else if StrState = 'CS_VACANT' then
: Result := csVacant
: else if StrState = 'CS_CHAT' then
: Result := csChat
: else if StrState = 'CS_LOGOUTTING' then
: Result := csLogoutting
: else
: Result := csNone;
: end;
:
: function StrToNetworkType(Value: String): TNetworkType;
: begin
: Result := TNetworkType(StrToInt(Value));
: end;
: function NetworkTypeToStr(Value: TNetworkType): String;
: begin
: Result := IntToStr(Integer(Value));
: end;
:
:
: // by 권호석 2004.09.22 --------------------------------------------------------
: // 활성화가 안되 있을경우 깜박임 현상
: procedure ActiveApplication;
: var
: a : FlashwInfo;
: begin
: if( Application.Active = False ) then
: begin
: a.cbSize := SizeOf(a);
: a.hwnd := Application.Handle;
: a.dwFlags := FLASHW_ALL;
: a.uCount := 5;
: a.dwTimeout := 500;
: FlashWindowEx( a );
: end;
: end;
: // ----------------------------------------------------------------------------
: // 스트링을 채팅타입으로 변환
: function StringToPriceType( PriceType : String ): TPriceType;
: // ----------------------------------------------------------------------------
: begin
: if( PriceType = FREE_CHAT ) then Result := ptFree
: else
: if( PriceType = CHARGE_CHAT ) then Result := ptCharge
: else Result := ptNone;
: end;
:
: // ----------------------------------------------------------------------------
: // 채팅타입을 스트링으로 변환
: function PriceTypeToString( PriceType : TPriceType ): String;
: // ----------------------------------------------------------------------------
: begin
: if( PriceType = ptFree ) then Result := FREE_CHAT
: else
: if( PriceType = ptCharge ) then Result := CHARGE_CHAT
: else Result := '';
: end;
:
: end.
:
: 이런 소스구요.
:
: D:\ D드라이버에 TypeDef.inc 라는 파일을 하나 만들고 다시 F9를 누르니깐
:
: [Error] Globals.pas(55): Undeclared identifier: 'TClientState'
: [Error] Globals.pas(129): Undeclared identifier: 'TNetworkType'
: [Error] Globals.pas(149): Undeclared identifier: 'TPriceType'
: [Error] Globals.pas(160): Undeclared identifier: 'csNone'
: [Error] Globals.pas(231): Undeclared identifier: 'ntNone'
: [Error] Globals.pas(321): Undeclared identifier: 'csNone'
: [Error] Globals.pas(323): Undeclared identifier: 'csLogout'
: [Error] Globals.pas(325): Undeclared identifier: 'csLogin'
: [Error] Globals.pas(327): Undeclared identifier: 'csVacant'
: [Error] Globals.pas(329): Undeclared identifier: 'csChat'
: [Error] Globals.pas(331): Undeclared identifier: 'csLogoutting'
: [Error] Globals.pas(367): Undeclared identifier: 'FREE_CHAT'
: [Error] Globals.pas(367): Undeclared identifier: 'ptFree'
: [Error] Globals.pas(369): Undeclared identifier: 'CHARGE_CHAT'
: [Error] Globals.pas(369): Undeclared identifier: 'ptCharge'
: [Error] Globals.pas(370): Undeclared identifier: 'ptNone'
: [Error] Globals.pas(378): Undeclared identifier: 'ptFree'
: [Error] Globals.pas(378): Undeclared identifier: 'FREE_CHAT'
: [Error] Globals.pas(380): Undeclared identifier: 'ptCharge'
: [Error] Globals.pas(380): Undeclared identifier: 'CHARGE_CHAT'
: [Fatal Error] Main.pas(8): Could not compile used unit 'Globals.pas'
:
: 이렇케 쭈욱.. 에러원인이 나오던데..
: 어떻케 하면 되나요?
: 누구좀 도와주세요.. 부탁드림니다 ㅠㅠㅠ
안녕하세요. 까막입니다.
TypeDef.inc 파일에 각종 변수나 자료형이 정의되어 있는거 같네요.
친구분한테 TypeDef.inc 파일을 달라고 하셔야 할거 같군요.
위대한 단군혼이 살아있는 나라.... 대한민국.