Hi all:

I need to use function HsSetAppStatus to start and stop Hotsync using the
HSAPI.DLL.
We want to build an exe suitable to be triggered by an AT command
controlled by a time scheduler.

I can do it via a Paradox call, but this is a mess because it needs to
launch a runtime instead of launching a standalone exe.

The same DLL call syntax taken out from Paradox and put in a Delphi source
code doies not work.

I tried to build an exe (from Delphi) but I have something wrong, the
return code is
268435461

What is wrong in this code ?

Or anybody has a piece of running code for this purpose ?

Thanks in advance 

DELPHI CODE (NOT RUNNING)

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TForm1 = class(TForm)
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
function HsSetAppStatus(statusType:longint;dwStartFlags:longint): longint;
far;
external 'HSAPI.DLL';
var
RetCode : longint;

{$R *.DFM}
begin
RetCode:=0;
RetCode:=HsSetAppStatus(0,0);
WriteLn ('Return code = ',RetCode);
ReadLn ;
end.

PARADOX CODE (RUNNING OK)

Uses HSAPI
     HsSetAppStatus(statusType CLONG, dwStartFlags CLONG) CLONG
     endUses
method run(var eventInfo Event)
var
        fs             FileSystem
        ts             textStream
        returnVal               longint
        endvar
this script STOPS HOTSYNC
message ("Proc :S:M_HotSyncStop Starting ... ")
sleep(1000)
fs.makeDir("C:\\APPS\\MOBILE")
fs.makeDir("C:\\APPS\\MOBILE\\LOGS")
ts.create ("C:\\APPS\\MOBILE\\LOGS\\M_HotSyncStop"+"-"+
strval(day(today()))+"-"+strval(month(today()))+".log")
ts.writeLine("Proc M_HotSyncStop.sdl starting on "+
strval(today())+" @ "+strval(time())+".")

returnVal = HsSetAppStatus(0,0)
if returnVal = 0 then
        ts.writeLine("Hot Sync Shutdown on "+
        strval(today())+" @ "+strval(time())+".")
        else
        ts.writeLine("Hot Sync Shutdown failed on "+
        strval(today())+" @ "+strval(time())+".")
endif
ts.writeLine("Proc M_HotSyncStop.sdl ending on "+
strval(today())+" @ "+strval(time())+".")
exit()
endMethod

END PARADOX CODE


Best regards and Thanks in Advance

----------------------------------------------
Horacio Berardone Bouhébent
Safield Service
Tel-Fax +54 +11 49 54 45 96
www.safield-group.com
[EMAIL PROTECTED]
Buenos Aires
---------------------------------------------- 


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to