⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pfghslog.pas

📁 delphi编写与Palm数据交换管道连接程序。
💻 PAS
字号:
unit pfgHslog;
{**************************************************************************}
{* pfgHslog Unit                                                          *}
{*                                                                        *}
{* Header file conversion of hslog.h                                      *}
{*                                                                        *}
{* Header file converted by Paul Gilbert Nov 2000.                        *}
{**************************************************************************}

interface
{
/*****************************************************************************
 *
 * Copyright (c) 1998-1999 Palm Computing, Inc. or its subsidiaries.
 * All rights reserved.
 *
 ****************************************************************************/
/////////////////////////////////////////////////////////////////////////////
//
//	 File:      hslog.h
//
//	 Module:    HSLOGxx(d).DLL
//
//
//	 Description:  Publicly consumable header file prototyping the 'C' API
//                 and the structures used for their parameters.
//                 When using the Microsoft compiler we asure packed
//                 structures on single byte boundaries, with the pragma(1).
//
//
/////////////////////////////////////////////////////////////////////////////
//	 REVISION HISTORY:
//   mja  7/23/95  initial
//
//
//
/////////////////////////////////////////////////////////////////////////////
}

uses pfgWTypes, SysUtils, Windows;

type
  LogError = (slNoError, slBadStream, slDeleteFileFailed, slMoveFileFailed);
  Activity = Integer;

const
  { Enumerations }
  { Activity enumeration }
  slText = -1;
  slDoubleModify = 0;
  slDoubleModifyArchive = 1;
  slReverseDelete = 2;
  slTooManyCategories = 3;
  slCategoryDeleted = 4;
  slDateChanged = 5;
  slCustomLabel = 6;
    slChangeCatFailed = 7;
    slRemoteReadFailed = 8;
  slRemoteAddFailed = 9;
  slRemotePurgeFailed = 10;
  slRemoteChangeFailed = 11;
  slRemoteDeleteFailed = 12;
  slLocalAddFailed = 13;
    slRecCountMismatch = 14;
    slXMapFailed = 15;
    slArchiveFailed = 16;
    slLocalSaveFailed = 17;
    slResetFlagsFailed = 18;
  slSyncStarted = 19;
  slSyncFinished = 20;
  slSyncAborted = 21;
    slWarning = 22;
    slDoubleModifySubsc = 23;
    slFileLinkCompleted = 24;
    slFileLinkDeleted = 25;

var
  LogInit: function: Integer; cdecl;
  LogUnInit: function: Integer; cdecl;
  LogAddEntry: function (pszEntry: LPCTSTR; act: Activity; bTimeStamp: BOOL): Integer;
    cdecl;
  LogSaveLog: function (pszFile: LPCTSTR): Integer; cdecl;
  LogGetWorkFileName: function: LPCTSTR; cdecl;
  LogBuildRemoteLog: function (pszBuffer: LPTSTR; dwLen: DWORD): Integer; cdecl;
  LogTestCounters: function: Word; cdecl;
  LogCloseLog: procedure; cdecl;
  //function LogAddFormattedEntry(act: Activity; bTimeStamp: BOOL;
  //  const dataString: PChar; ...): Integer; cdecl; 

implementation

uses Dialogs, pfgUserData;

var
  DllHandle : THandle;
  DllLoaded : Boolean;

procedure LoadDLL;
begin
  if DLLLoaded then Exit;

  DLLHandle := LoadLibrary(PChar(PalmPath + 'hslog20.dll'));
  DLLLoaded := DLLHandle >= 32;
  if DLLLoaded then
  begin
    @LogInit := GetProcAddress(DLLHandle,'LogInit');
    Assert(@LogInit <> nil);
    @LogUnInit := GetProcAddress(DLLHandle,'LogUnInit');
    Assert(@LogUnInit <> nil);
    @LogAddEntry := GetProcAddress(DLLHandle,'LogAddEntry');
    Assert(@LogAddEntry <> nil);
    @LogSaveLog := GetProcAddress(DLLHandle,'LogSaveLog');
    Assert(@LogSaveLog <> nil);
    @LogGetWorkFileName := GetProcAddress(DLLHandle,'LogGetWorkFileName');
    Assert(@LogGetWorkFileName <> nil);
    @LogBuildRemoteLog := GetProcAddress(DLLHandle,'LogBuildRemoteLog');
    Assert(@LogBuildRemoteLog <> nil);
    @LogTestCounters := GetProcAddress(DLLHandle,'LogTestCounters');
    Assert(@LogTestCounters <> nil);
    @LogCloseLog := GetProcAddress(DLLHandle,'LogCloseLog');
    Assert(@LogCloseLog <> nil);
  end;
end;

initialization
  DLLLoaded := False;
  LoadDLL;

  if (not DllLoaded) then
  begin
    MessageDlg('pfgHslog: Unable to load hslog20.dll',mtError,[mbOk],0);
    Abort;
  end;

finalization
  if DLLLoaded then FreeLibrary(DLLHandle);

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -