"Philipp" == Philipp Reif <[EMAIL PROTECTED]> writes:

Philipp> anything, and so I ended up writing a very simple conduit for
Philipp> Plucker that just calls RunSync.exe on each hotsync.

Great, thanks. I'm interested to put this in the Windows distribution
if this are out of beta.

After an short look i have an few suggestion in case you are
interested:

- You could pass some environment variables to RunSync.exe
  - plkr-nonag : set to true and you will not be promoted for an key
    press. (No need to set the close_on_* ini keys)
  - plkr-timeout : Set the time in secondes after the DB build time
    out in all cases. Maybe an good idea for an conduit.

    (Yes i really should write the infos somewhere in the readmes :-)
    
    You need the updated ones: http://www.dirk-heiser.de/Plucker_upd.zip
    But this will in next release.
    
  - You may could add an Checkbox to run the console mode windows
    hidden. I'm doing this with by calling the program with create
    process, by this i get also the return code (<>0 there are an
    error):

    Var
      SUInfo   : TStartupInfo;
      ProcInfo : TProcessInformation;
      Err      : Boolean;
      SWPath   : String;
      Ret      : Integer;

    FillChar(SUInfo, SizeOf(SUInfo), #0);
    with SUInfo do
      begin
        cb := SizeOf(SUInfo);
        dwFlags := STARTF_USESHOWWINDOW;   //Dont do this to see the
        wShowWindow := SW_HIDE;            //Window
      end;

    Err := CreateProcess(NIL,
                       PChar(Qoute(SWPath+'RunSync.exe')+' '+Qoute(Param)),
                       NIL, NIL, True, NORMAL_PRIORITY_CLASS, nil,
                       PChar(SWPath),
                       SUInfo, ProcInfo);

  { Wait for it to finish. }
  if Err then
    Begin
      WaitForSingleObject(ProcInfo.hProcess, INFINITE);
      GetExitCodeProcess(ProcInfo.hProcess,Ret);
      If Ret<>0 Then Halt(Ret);   // Here are the return code
    End
    Else Halt(3 SHL 8);  //Error starting RunSync

- You do not need ask the user for the RunSync.exe location, you could
  read the Plucker home from:
  HKEY_CURRENT_USER\Software\The Plucker Team\Plucker\Path
  Then RunSync.exe are located in this directory.

- Does writing the ini to the Windir work on all systems (user
  rights)? Maybe an Plucker Subdirectory in the users directory (the
  subdir of the Palm SW dir) are an better choice? Or may you could use
  an new key in the channel plicker.ini "update_on_sync" (In this case
  plucker-desktop could modify this info also from his GUI (Checkbox
  update on sync) later)?

- BTW: The rule to get a list of all DB handles are:
  All subdirs of the Plucker dir that follow this mask: "*.DB" and
  having an file called "plucker.ini" inside are Plucker Channels.

  I'm doing it in this way:

Procedure GetDBList(Var DBs:TStringList);

VAR

 SearchRec          : TSearchRec;
 Found              : Longint;

Begin

 DBs.Clear;

 Found := FindFirst ( ExpandFileName(ExtractFilePath(ParamStr(0)))+'*.*', faDirectory, 
SearchRec);
 WHILE Found = 0 DO
  BEGIN
   If SearchRec.Attr AND faDirectory > 0 Then
    If (SearchRec.Name <> '.') and (SearchRec.Name <> '..') Then
     If (UpperCase(ExtractFileExt(SearchRec.Name)) = '.DB') and 
(FileExists(ExtractFilePath(ParamStr(0))+SearchRec.Name+'\plucker.ini')) Then 
DBs.Add(Copy(SearchRec.Name,1,Length(SearchRec.Name)-Length('.DB')));
   Found := FindNext ( SearchRec );
  END;
 FindClose ( SearchRec );

End;

(Sure replace ParamStr(0) with the plucker path)

cu,
 Dirk
-- 
Permanent URLs to the latest Version (1.1.13) of the Plucker Windows installer
 - For the Webpage: http://www.dirk-heiser.de/plucker
 - Direct Download: http://www.dirk-heiser.de/plucker/plucker.exe [2.08MB]

Reply via email to