Re: [DUG]: first error fixed, now for the second

2001-10-07 Thread abaddon



If the names of the controls are Edit1, Edit2 and so on, then just change
the procedure to assign the values correctly eg:
  Edit1.text := tmp.Name;
  Edit2.,text := tmp.StreetAddress

thanx trevor but the problem is with eread(addressfile,temp)
undecleared identifier, so i take it declear it as a string

...
   Brendon Toogood

E-Mail [EMAIL PROTECTED]
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of unsubscribe delphi
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/



[DUG]: Best way to load a DLL

2001-10-07 Thread Jeremy Coulter



HI 
all.
I am wondering what 
is the best way to load/use a dll from an app.

Currently, I am 
doing something similar to this :-

Function 
GetSomoething(iIndex:integer):smallint;stdcall; external 
'mydll.dll';

This works fine, but 
what I am unsure about IS, is it better to do the above, or use LoadLibrary 
?
By declaring the 
function to the above keep the DLL in memory the whole time the app. is running? 
or does it load the dll when the function is called?

Some thoughts and 
suggestions welcome.

Thanks, Jeremy 
Coulter


[DUG]: fixed all errors

2001-10-07 Thread abaddon

i found out what the error was it should have read

read(addressfile,tmp);
not 
eread(addressfile,tmp);

so thanx for all who helped.


...
   Brendon Toogood

E-Mail [EMAIL PROTECTED]
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of unsubscribe delphi
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/



Re: [DUG]: fixed all errors

2001-10-07 Thread Nello Sestini

I thought Dave already pointed out this error on 4/10
in his post that read:

 What is eread? I assume this should be read.
 What is eName? a TEdit on the form?

-ns


- Original Message - 
From: [EMAIL PROTECTED]
To: Multiple recipients of list delphi [EMAIL PROTECTED]
Sent: Sunday, October 07, 2001 6:43 PM
Subject: [DUG]: fixed all errors


i found out what the error was it should have read

read(addressfile,tmp);
not 
eread(addressfile,tmp);

so thanx for all who helped.


...
   Brendon Toogood

E-Mail [EMAIL PROTECTED]
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of unsubscribe delphi
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of unsubscribe delphi
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/



[DUG]: Thanks Max

2001-10-07 Thread NIRAV KAKU

Cracked it. : )

regards,
NIRAV KAKU

- From the Shreemat Bhägwat Gïta -
'Sarcasm is the lowest form of wit.'
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of unsubscribe delphi
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/



Re: [DUG]: Treeview with checkboxes

2001-10-07 Thread Nic Wise

Jeremy,

I think Raize does: www.raize.com

N

- Original Message -
From: Limsowtin, Philippe [EMAIL PROTECTED]
To: Multiple recipients of list delphi [EMAIL PROTECTED]
Sent: Monday, October 08, 2001 12:13 PM
Subject: RE: [DUG]: Treeview with checkboxes


 You probably already know this but:
 You can use the treeview that comes with delphi.
 Just set the state image to a bitmap that looks like a checked or
unchecked
 box.

 a REALLY basic implementation might be:

if   treeview1.Selected.StateIndex = 2 then
 treeview1.Selected.StateIndex := 1
else
 treeview1.Selected.StateIndex := 2;

 where 1 and 2 refer to the checked and unchecked images

 -Original Message-
 From: vss [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, 4 October 2001 9:55 a.m.
 To: Multiple recipients of list delphi
 Subject: [DUG]: Treeview with checkboxes


 Hi. Does anyone know of any treeview controls that can had checkboxes as
 well as images ?

 Thanks, Jeremy Coulter


 --
-
 New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
   Website: http://www.delphi.org.nz
 To UnSub, send email to: [EMAIL PROTECTED]
 with body of unsubscribe delphi
 Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
 --
-
 New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
   Website: http://www.delphi.org.nz
 To UnSub, send email to: [EMAIL PROTECTED]
 with body of unsubscribe delphi
 Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/


---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of unsubscribe delphi
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/



[DUG]: Line too long error

2001-10-07 Thread Phil Scadden

I've hit this more than once:

D5 complaining 
[Fatal Error] PGSHeightData.pas(1): Line too long (more than 1023 characters)

It isnt - and if I put in the other lines, modify it, etc. It still reports this error.
Any ideas???

--
Phil Scadden, Institute of Geological and Nuclear Sciences
41 Bell Rd South, PO Box 30368, Lower Hutt, New Zealand
Ph +64 4 5704821, fax +64 4 5704603

---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of unsubscribe delphi
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/



RE: [DUG]: Line too long error

2001-10-07 Thread Manning, John

Sounds like the file contains one or more control characters in it or
doesn't have the require CR/LF characters at the end of each line (which
will cause it to appear OK in some editors).

Could you try opening it in another editor like MS Word and copying it into
the Delphi IDE?

John

-Original Message-
From: Phil Scadden [mailto:[EMAIL PROTECTED]]
Sent: Monday, 8 October 2001 11:05 am
To: Multiple recipients of list delphi
Subject: [DUG]: Line too long error


I've hit this more than once:

D5 complaining 
[Fatal Error] PGSHeightData.pas(1): Line too long (more than 1023
characters)

It isnt - and if I put in the other lines, modify it, etc. It still reports
this error.
Any ideas???
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of unsubscribe delphi
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/



[DUG]: Line too long - solved...

2001-10-07 Thread Phil Scadden

Problems with using CSV - it had unix carriage control though the file looked okay.
Converted to DOS and it compiled fine.

--
Phil Scadden, Institute of Geological and Nuclear Sciences
41 Bell Rd South, PO Box 30368, Lower Hutt, New Zealand
Ph +64 4 5704821, fax +64 4 5704603

---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of unsubscribe delphi
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/



Re: [DUG]: Line too long error

2001-10-07 Thread Nello Sestini

a wild guess:   is it possible this is a unix/dos txt file format
problem?

(end of line is CR/LF in DOS and just LF in unix)

-ns

- Original Message -
From: Phil Scadden [EMAIL PROTECTED]
To: Multiple recipients of list delphi [EMAIL PROTECTED]
Sent: Monday, October 08, 2001 8:04 AM
Subject: [DUG]: Line too long error


 I've hit this more than once:

 D5 complaining
 [Fatal Error] PGSHeightData.pas(1): Line too long (more than 1023
characters)

 It isnt - and if I put in the other lines, modify it, etc. It still
reports this error.
 Any ideas???

 --
 Phil Scadden, Institute of Geological and Nuclear Sciences
 41 Bell Rd South, PO Box 30368, Lower Hutt, New Zealand
 Ph +64 4 5704821, fax +64 4 5704603

 --
-
 New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
   Website: http://www.delphi.org.nz
 To UnSub, send email to: [EMAIL PROTECTED]
 with body of unsubscribe delphi
 Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/


---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of unsubscribe delphi
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/



[DUG]: [Q] MIDAS (Socket Connection), BDE, Threads

2001-10-07 Thread Donovan J. Edye

G'Day All,
I have the following:
- A component TCricketLiveScoringClient that uses a MIDAS socket
connection to make and handle a connection to a MIDAS server
- The above component uses a TTXProcessThread to monitor changes in a
local BDE table
- When a change is detected by the it uses
TCricketLiveScoringClient.ProcessTX() to send the transaction to the
MIDAS server
However what I am finding is that if an exception is raised and the
thread terminated and the connection to the MIDAS server closed that the
application dies horribly with access violation(s), runtime error 216
etc. So my questions are these:
- The thread uses its own TDatabase connection (and not the TDatabase
connection of the application that contains the component). But does it
require a TSession component as well? Are there issues here to do with
the BDE/Threading?
- It appears to me that the AppServer property of the TSocketConnection
disappears out from under me. However no amount of:
 if not
((VarIsNull(FSocketConnection.AppServer)) AND (varEmpty =
VarType(FSocketConnection.AppServer)) AND
 (varNull =
VarType(FSocketConnection.AppServer))) then
seems to protect me from getting the access violation.
Can anybody provide me with some pointers etc.? Below find the necessary
code, but if you need anything else then please ask. I am at a loss as to
how to solve this. Environment is D5.01 Enterprise.
TIA

type
 TNewTXDataEvent = procedure(ATXID : integer; ATXPayload :
string; TotalTXs : integer;
 var EventCompleted : boolean; var
EventCompletedSuccessfully : boolean) of object;
 TTXProcessThread = class(TThread)
 private
 FDatabase : TDataBase;
 FEventCompleted : boolean;
 FEventCompletedSuccessfully :
boolean;
 FLastTxIDProcessed : integer;
 //FSession : TSession;
 FTXTable : TTable;
 FNewTXDataEvent : TNewTXDataEvent;
 protected
 procedure Execute; override;
 procedure FireCallBackEvent;
 public
 constructor Create(CreateSuspended :
Boolean; ADBPath : string;
 AStartTXID : integer;
ANewTXData : TNewTXDataEvent);
 destructor Destroy; override;
 end;
type
 TCricketLiveScoringClient = class(TCustomPanel)
 private
 FActive : boolean;
 FCricketAppGUID : string;
 FGlobalMatchCode : string;
 FLastTXProcessed : integer;
 FSocketConnection :
TSocketConnection;
 FStatusPanel : TPanel;
 FTXPanel : TPanel;
 FMessages : TStringList;
 FTXProcessingThread :
TTXProcessThread;
 FClientIP : string;
 FDBPath : string;
 FLoggedIn : boolean;
 FMidasServerPort : SmallInt;
 FMidasServerAddress : string;
 procedure AddMessage(AMsg : string);
 procedure CustomOnDblClick(Sender :
TObject);
 function Get_Local_IPAddr : string;
 procedure HandleExceptionError(AProcName,
AErr, ADelphiError : string);
 function Login : boolean;
 function Logout : boolean;
 procedure NewDataEvent(ATXID : integer;
ATXPayload : string; TotalTXs : integer;
 var EventCompleted :
boolean; var EventCompletedSuccessfully : boolean);
 function ProcessTX(AGlobalMatchCode :
string; ATXID : Integer;
 const ATXPayload :
string; var ANextTXID : Integer;
 var ASQLServerErrroCode
: integer; var ASQLServerErrorDesc : string) : WordBool;
 procedure SetActive(const Value :
boolean);
 procedure SetGlobalMatchCode(const Value :
string);
 procedure SetMidasServerAddress(const
Value : string);
 procedure SetMidasServerPort(const Value :
SmallInt);
 protected
 public
 constructor Create(AOwner : TComponent);
override;
 destructor Destroy; override;
 published
 property Active : boolean read FActive
write SetActive;
 property Align;
 property BevelInner;
 property BevelOuter;
 property CricketAppGUID : string read
FCricketAppGUID write FCricketAppGUID;
 property GlobalMatchCode : string read
FGlobalMatchCode write SetGlobalMatchCode;
 property DBPath : string read FDBPath
write FDBPath;
 property MidasServerAddress : string read
FMidasServerAddress write SetMidasServerAddress;
 property MidasServerPort : SmallInt read
FMidasServerPort write SetMidasServerPort;
 end;

function TCricketLiveScoringClient.ProcessTX(AGlobalMatchCode : string;
ATXID : Integer;
 const ATXPayload : string; var ANextTXID : Integer;
 var ASQLServerErrroCode : integer; var ASQLServerErrorDesc :
string) : WordBool;

// PURPOSE: Processes the supplied TX information
const
 PROC_NAME = 'TCricketLiveScoringClient.ProcessTX';
 ERR_MSG = 'I was unable to process the transaction.';
begin
 //Show failure at this point
 result := FALSE;
 try
 if not
((VarIsNull(FSocketConnection.AppServer)) AND (varEmpty =
VarType(FSocketConnection.AppServer)) AND
 (varNull =
VarType(FSocketConnection.AppServer))) then
 begin
 if
FSocketConnection.AppServer.ProcessTX(FClientIP, FCricketAppGUID,
AGlobalMatchCode, ATXID,

ATXPayload, ANextTXID, ASQLServerErrroCode, ASQLServerErrorDesc) =
WordBool(TRUE) then
 begin
 result
:= TRUE;

FLastTXProcessed := ANextTXID - 1;
 end;
 end;
 except
 on E : Exception do

HandleExceptionError(PROC_NAME, ERR_MSG, E.Message);
 end;
end;


--
Donovan 

Re: [DUG]: [Q] MIDAS (Socket Connection), BDE, Threads

2001-10-07 Thread Robert Martin



I have no idea about how MIDAS works but you 
definately need to use a seperate session with each thread when working with 
DBase etc. As to BDE crashes, me too! Any app that crashes the BDE 
will crash any other app using the BDE in my experiance.

Robert MartinSoftware EngineerWild Software Ltd

  - Original Message - 
  From: 
  Donovan J. 
  Edye 
  To: Multiple recipients of list delphi 
  Sent: Monday, October 08, 2001 2:49 
  PM
  Subject: [DUG]: [Q] MIDAS (Socket 
  Connection), BDE, Threads
  G'Day All,I have the following:- A component 
  TCricketLiveScoringClient that uses a MIDAS socket connection to make and 
  handle a connection to a MIDAS server- The above component uses a 
  TTXProcessThread to monitor changes in a local BDE table- When a change is 
  detected by the it uses TCricketLiveScoringClient.ProcessTX() to send the 
  transaction to the MIDAS serverHowever what I am finding is that if an 
  exception is raised and the thread terminated and the connection to the MIDAS 
  server closed that the application dies horribly with access violation(s), 
  runtime error 216 etc. So my questions are these:- The thread uses its 
  own TDatabase connection (and not the TDatabase connection of the application 
  that contains the component). But does it require a TSession component as 
  well? Are there issues here to do with the BDE/Threading?- It appears to 
  me that the AppServer property of the TSocketConnection "disappears" out from 
  under me. However no amount of: if not 
  ((VarIsNull(FSocketConnection.AppServer)) AND (varEmpty = 
  VarType(FSocketConnection.AppServer)) 
  AND (varNull = 
  VarType(FSocketConnection.AppServer))) thenseems to protect me from 
  getting the access violation.Can anybody provide me with some pointers 
  etc.? Below find the necessary code, but if you need anything else then please 
  ask. I am at a loss as to how to solve this. Environment is D5.01 
  Enterprise.TIAtype TNewTXDataEvent = 
  procedure(ATXID : integer; ATXPayload : string; TotalTXs : 
  integer; var EventCompleted : boolean; var 
  EventCompletedSuccessfully : boolean) of object; 
  TTXProcessThread = class(TThread) 
  private FDatabase : 
  TDataBase; FEventCompleted : 
  boolean; FEventCompletedSuccessfully : 
  boolean; FLastTxIDProcessed : 
  integer; //FSession : 
  TSession; FTXTable : 
  TTable; FNewTXDataEvent : 
  TNewTXDataEvent; protected 
  procedure Execute; override; procedure 
  FireCallBackEvent; public 
  constructor Create(CreateSuspended : Boolean; ADBPath : 
  string; AStartTXID : 
  integer; ANewTXData : TNewTXDataEvent); 
  destructor Destroy; override; end;type 
  TCricketLiveScoringClient = class(TCustomPanel) 
  private FActive : 
  boolean; FCricketAppGUID : 
  string; FGlobalMatchCode : 
  string; FLastTXProcessed : 
  integer; FSocketConnection : 
  TSocketConnection; FStatusPanel : 
  TPanel; FTXPanel : 
  TPanel; FMessages : 
  TStringList; FTXProcessingThread : 
  TTXProcessThread; FClientIP : 
  string; FDBPath : 
  string; FLoggedIn : 
  boolean; FMidasServerPort : 
  SmallInt; FMidasServerAddress : 
  string; procedure AddMessage(AMsg : 
  string); procedure CustomOnDblClick(Sender : 
  TObject); function Get_Local_IPAddr : 
  string; procedure 
  HandleExceptionError(AProcName, AErr, ADelphiError : 
  string); function Login : 
  boolean; function Logout : 
  boolean; procedure NewDataEvent(ATXID : 
  integer; ATXPayload : string; TotalTXs : 
  integer; var 
  EventCompleted : boolean; var EventCompletedSuccessfully : 
  boolean); function 
  ProcessTX(AGlobalMatchCode : string; ATXID : 
  Integer; const ATXPayload 
  : string; var ANextTXID : 
  Integer; var 
  ASQLServerErrroCode : integer; var ASQLServerErrorDesc : string) : 
  WordBool; procedure SetActive(const Value : 
  boolean); procedure SetGlobalMatchCode(const 
  Value : string); procedure 
  SetMidasServerAddress(const Value : string); 
  procedure SetMidasServerPort(const Value : SmallInt); 
  protected public 
  constructor Create(AOwner : TComponent); 
  override; destructor Destroy; 
  override; published property 
  Active : boolean read FActive write 
  SetActive; property 
  Align; property 
  BevelInner; property 
  BevelOuter; property CricketAppGUID : string 
  read FCricketAppGUID write FCricketAppGUID; 
  property GlobalMatchCode : string read FGlobalMatchCode write 
  SetGlobalMatchCode; property DBPath : string 
  read FDBPath write FDBPath; property 
  MidasServerAddress : string read FMidasServerAddress write 
  SetMidasServerAddress; property 
  MidasServerPort : SmallInt read FMidasServerPort write 
  SetMidasServerPort; end;function 
  TCricketLiveScoringClient.ProcessTX(AGlobalMatchCode : string; ATXID : 
  Integer; const ATXPayload : string; var ANextTXID : 
  Integer; var ASQLServerErrroCode : integer; var 
  ASQLServerErrorDesc : string) : 
  WordBool;// 
  PURPOSE: Processes the 

Re: [DUG]: [Q] MIDAS (Socket Connection), BDE, Threads

2001-10-07 Thread Donovan J. Edye

R,
Do you have some sample code implementing a TSession robustly? The code
and examples I have seen only seem to scratch the surface and I need
something a bit more tried and tested real world than what is in the
help.
TIA
At 15:50 08/10/2001 +1300, you wrote:
I have no
idea about how MIDAS works but you definately need to use a seperate
session with each thread when working with DBase etc. As to BDE
crashes, me too! Any app that crashes the BDE will crash any other
app using the BDE in my experiance.

Robert Martin
Software Engineer
Wild Software Ltd
- Original Message - 
From: Donovan J. Edye

To: Multiple recipients of list delphi 
Sent: Monday, October 08, 2001 2:49 PM
Subject: [DUG]: [Q] MIDAS (Socket Connection), BDE, Threads
G'Day All,
I have the following:
- A component TCricketLiveScoringClient that uses a MIDAS socket connection to make and handle a connection to a MIDAS server
- The above component uses a TTXProcessThread to monitor changes in a local BDE table
- When a change is detected by the it uses TCricketLiveScoringClient.ProcessTX() to send the transaction to the MIDAS server
However what I am finding is that if an exception is raised and the thread terminated and the connection to the MIDAS server closed that the application dies horribly with access violation(s), runtime error 216 etc. So my questions are these:
- The thread uses its own TDatabase connection (and not the TDatabase connection of the application that contains the component). But does it require a TSession component as well? Are there issues here to do with the BDE/Threading?
- It appears to me that the AppServer property of the TSocketConnection disappears out from under me. However no amount of:
 if not ((VarIsNull(FSocketConnection.AppServer)) AND (varEmpty = VarType(FSocketConnection.AppServer)) AND
 (varNull = VarType(FSocketConnection.AppServer))) then
seems to protect me from getting the access violation.
Can anybody provide me with some pointers etc.? Below find the necessary code, but if you need anything else then please ask. I am at a loss as to how to solve this. Environment is D5.01 Enterprise.
TIA

type
 TNewTXDataEvent = procedure(ATXID : integer; ATXPayload : string; TotalTXs : integer;
 var EventCompleted : boolean; var EventCompletedSuccessfully : boolean) of object;
 TTXProcessThread = class(TThread)
 private
 FDatabase : TDataBase;
 FEventCompleted : boolean;
 FEventCompletedSuccessfully : boolean;
 FLastTxIDProcessed : integer;
 //FSession : TSession;
 FTXTable : TTable;
 FNewTXDataEvent : TNewTXDataEvent;
 protected
 procedure Execute; override;
 procedure FireCallBackEvent;
 public
 constructor Create(CreateSuspended : Boolean; ADBPath : string;
 AStartTXID : integer; ANewTXData : TNewTXDataEvent);
 destructor Destroy; override;
 end;
type
 TCricketLiveScoringClient = class(TCustomPanel)
 private
 FActive : boolean;
 FCricketAppGUID : string;
 FGlobalMatchCode : string;
 FLastTXProcessed : integer;
 FSocketConnection : TSocketConnection;
 FStatusPanel : TPanel;
 FTXPanel : TPanel;
 FMessages : TStringList;
 FTXProcessingThread : TTXProcessThread;
 FClientIP : string;
 FDBPath : string;
 FLoggedIn : boolean;
 FMidasServerPort : SmallInt;
 FMidasServerAddress : string;
 procedure AddMessage(AMsg : string);
 procedure CustomOnDblClick(Sender : TObject);
 function Get_Local_IPAddr : string;
 procedure HandleExceptionError(AProcName, AErr, ADelphiError : string);
 function Login : boolean;
 function Logout : boolean;
 procedure NewDataEvent(ATXID : integer; ATXPayload : string; TotalTXs : integer;
 var EventCompleted : boolean; var EventCompletedSuccessfully : boolean);
 function ProcessTX(AGlobalMatchCode : string; ATXID : Integer;
 const ATXPayload : string; var ANextTXID : Integer;
 var ASQLServerErrroCode : integer; var ASQLServerErrorDesc : string) : WordBool;
 procedure SetActive(const Value : boolean);
 procedure SetGlobalMatchCode(const Value : string);
 procedure SetMidasServerAddress(const Value : string);
 procedure SetMidasServerPort(const Value : SmallInt);
 protected
 public
 constructor Create(AOwner : TComponent); override;
 destructor Destroy; override;
 published
 property Active : boolean read FActive write SetActive;
 property Align;
 property BevelInner;
 property BevelOuter;
 property CricketAppGUID : string read FCricketAppGUID write FCricketAppGUID;
 property GlobalMatchCode : string read FGlobalMatchCode write SetGlobalMatchCode;
 property DBPath : string read FDBPath write FDBPath;
 property MidasServerAddress : string read FMidasServerAddress write SetMidasServerAddress;
 property MidasServerPort : SmallInt read FMidasServerPort write SetMidasServerPort;
 end;

function TCricketLiveScoringClient.ProcessTX(AGlobalMatchCode : string; ATXID : Integer;
 const ATXPayload : string; var ANextTXID : Integer;
 var ASQLServerErrroCode : integer; var ASQLServerErrorDesc : string) : WordBool;

// 

Re: [DUG]: [Q] MIDAS (Socket Connection), BDE, Threads

2001-10-07 Thread Donovan J. Edye

R,
Sorry. Part II. Is a TSession still necessary even though the thread and
the application have their own TDatabase components and inherently their
own Session?
At 15:50 08/10/2001 +1300, you wrote:
I have no
idea about how MIDAS works but you definately need to use a seperate
session with each thread when working with DBase etc. As to BDE
crashes, me too! Any app that crashes the BDE will crash any other
app using the BDE in my experiance.

Robert Martin
Software Engineer
Wild Software Ltd
- Original Message - 
From: Donovan J. Edye

To: Multiple recipients of list delphi 
Sent: Monday, October 08, 2001 2:49 PM
Subject: [DUG]: [Q] MIDAS (Socket Connection), BDE, Threads
G'Day All,
I have the following:
- A component TCricketLiveScoringClient that uses a MIDAS socket connection to make and handle a connection to a MIDAS server
- The above component uses a TTXProcessThread to monitor changes in a local BDE table
- When a change is detected by the it uses TCricketLiveScoringClient.ProcessTX() to send the transaction to the MIDAS server
However what I am finding is that if an exception is raised and the thread terminated and the connection to the MIDAS server closed that the application dies horribly with access violation(s), runtime error 216 etc. So my questions are these:
- The thread uses its own TDatabase connection (and not the TDatabase connection of the application that contains the component). But does it require a TSession component as well? Are there issues here to do with the BDE/Threading?
- It appears to me that the AppServer property of the TSocketConnection disappears out from under me. However no amount of:
 if not ((VarIsNull(FSocketConnection.AppServer)) AND (varEmpty = VarType(FSocketConnection.AppServer)) AND
 (varNull = VarType(FSocketConnection.AppServer))) then
seems to protect me from getting the access violation.
Can anybody provide me with some pointers etc.? Below find the necessary code, but if you need anything else then please ask. I am at a loss as to how to solve this. Environment is D5.01 Enterprise.
TIA

type
 TNewTXDataEvent = procedure(ATXID : integer; ATXPayload : string; TotalTXs : integer;
 var EventCompleted : boolean; var EventCompletedSuccessfully : boolean) of object;
 TTXProcessThread = class(TThread)
 private
 FDatabase : TDataBase;
 FEventCompleted : boolean;
 FEventCompletedSuccessfully : boolean;
 FLastTxIDProcessed : integer;
 //FSession : TSession;
 FTXTable : TTable;
 FNewTXDataEvent : TNewTXDataEvent;
 protected
 procedure Execute; override;
 procedure FireCallBackEvent;
 public
 constructor Create(CreateSuspended : Boolean; ADBPath : string;
 AStartTXID : integer; ANewTXData : TNewTXDataEvent);
 destructor Destroy; override;
 end;
type
 TCricketLiveScoringClient = class(TCustomPanel)
 private
 FActive : boolean;
 FCricketAppGUID : string;
 FGlobalMatchCode : string;
 FLastTXProcessed : integer;
 FSocketConnection : TSocketConnection;
 FStatusPanel : TPanel;
 FTXPanel : TPanel;
 FMessages : TStringList;
 FTXProcessingThread : TTXProcessThread;
 FClientIP : string;
 FDBPath : string;
 FLoggedIn : boolean;
 FMidasServerPort : SmallInt;
 FMidasServerAddress : string;
 procedure AddMessage(AMsg : string);
 procedure CustomOnDblClick(Sender : TObject);
 function Get_Local_IPAddr : string;
 procedure HandleExceptionError(AProcName, AErr, ADelphiError : string);
 function Login : boolean;
 function Logout : boolean;
 procedure NewDataEvent(ATXID : integer; ATXPayload : string; TotalTXs : integer;
 var EventCompleted : boolean; var EventCompletedSuccessfully : boolean);
 function ProcessTX(AGlobalMatchCode : string; ATXID : Integer;
 const ATXPayload : string; var ANextTXID : Integer;
 var ASQLServerErrroCode : integer; var ASQLServerErrorDesc : string) : WordBool;
 procedure SetActive(const Value : boolean);
 procedure SetGlobalMatchCode(const Value : string);
 procedure SetMidasServerAddress(const Value : string);
 procedure SetMidasServerPort(const Value : SmallInt);
 protected
 public
 constructor Create(AOwner : TComponent); override;
 destructor Destroy; override;
 published
 property Active : boolean read FActive write SetActive;
 property Align;
 property BevelInner;
 property BevelOuter;
 property CricketAppGUID : string read FCricketAppGUID write FCricketAppGUID;
 property GlobalMatchCode : string read FGlobalMatchCode write SetGlobalMatchCode;
 property DBPath : string read FDBPath write FDBPath;
 property MidasServerAddress : string read FMidasServerAddress write SetMidasServerAddress;
 property MidasServerPort : SmallInt read FMidasServerPort write SetMidasServerPort;
 end;

function TCricketLiveScoringClient.ProcessTX(AGlobalMatchCode : string; ATXID : Integer;
 const ATXPayload : string; var ANextTXID : Integer;
 var ASQLServerErrroCode : integer; var ASQLServerErrorDesc : string) : WordBool;

// PURPOSE: Processes the supplied TX information
const
 PROC_NAME = 

Re: [DUG]: [Q] MIDAS (Socket Connection), BDE, Threads

2001-10-07 Thread Nic Wise

yes, you do need a sepetate TSession per thread - each database usually
shares a single one, hence the problem.

N
- Original Message -
From: Donovan J. Edye [EMAIL PROTECTED]
To: Multiple recipients of list delphi [EMAIL PROTECTED]
Sent: Monday, October 08, 2001 3:54 PM
Subject: Re: [DUG]: [Q] MIDAS (Socket Connection), BDE, Threads


 R,

 Sorry. Part II. Is a TSession still necessary even though the thread and
 the application have their own TDatabase components and inherently their
 own Session?

 At 15:50 08/10/2001 +1300, you wrote:
 I have no idea about how MIDAS works but you definately need to use a
 seperate session with each thread when working with DBase etc.  As to BDE
 crashes, me too!  Any app that crashes the BDE will crash any other app
 using the BDE in my experiance.
 
 Robert Martin
 Software Engineer
 Wild Software Ltd
 - Original Message -
 From: mailto:[EMAIL PROTECTED]Donovan J. Edye
 To: mailto:[EMAIL PROTECTED]Multiple recipients of list delphi
 Sent: Monday, October 08, 2001 2:49 PM
 Subject: [DUG]: [Q] MIDAS (Socket Connection), BDE, Threads
 
 G'Day All,
 
 I have the following:
 
 - A component TCricketLiveScoringClient that uses a MIDAS socket
 connection to make and handle a connection to a MIDAS server
 - The above component uses a TTXProcessThread to monitor changes in a
 local BDE table
 - When a change is detected by the it uses
 TCricketLiveScoringClient.ProcessTX() to send the transaction to the
 MIDAS server
 
 However what I am finding is that if an exception is raised and the
 thread terminated and the connection to the MIDAS server closed that the
 application dies horribly with access violation(s), runtime error 216
 etc. So my questions are these:
 
 - The thread uses its own TDatabase connection (and not the TDatabase
 connection of the application that contains the component). But does it
 require a TSession component as well? Are there issues here to do with
 the BDE/Threading?
 - It appears to me that the AppServer property of the TSocketConnection
 disappears out from under me. However no amount of:
 
if not ((VarIsNull(FSocketConnection.AppServer)) AND (varEmpty =
  VarType(FSocketConnection.AppServer)) AND
   (varNull = VarType(FSocketConnection.AppServer))) then
 seems to protect me from getting the access violation.
 
 Can anybody provide me with some pointers etc.? Below find the necessary
 code, but if you need anything else then please ask. I am at a loss as
to
 how to solve this. Environment is D5.01 Enterprise.
 
 TIA
 
 
 type
 TNewTXDataEvent = procedure(ATXID : integer; ATXPayload : string;
  TotalTXs : integer;
var EventCompleted : boolean; var EventCompletedSuccessfully :
  boolean) of object;
 
 TTXProcessThread = class(TThread)
 private
FDatabase : TDataBase;
FEventCompleted : boolean;
FEventCompletedSuccessfully : boolean;
FLastTxIDProcessed : integer;
//FSession : TSession;
FTXTable : TTable;
FNewTXDataEvent : TNewTXDataEvent;
 protected
procedure Execute; override;
procedure FireCallBackEvent;
 public
constructor Create(CreateSuspended : Boolean; ADBPath : string;
   AStartTXID : integer; ANewTXData : TNewTXDataEvent);
destructor Destroy; override;
 end;
 
 type
 TCricketLiveScoringClient = class(TCustomPanel)
 private
FActive : boolean;
FCricketAppGUID : string;
FGlobalMatchCode : string;
FLastTXProcessed : integer;
FSocketConnection : TSocketConnection;
FStatusPanel : TPanel;
FTXPanel : TPanel;
FMessages : TStringList;
FTXProcessingThread : TTXProcessThread;
FClientIP : string;
FDBPath : string;
FLoggedIn : boolean;
FMidasServerPort : SmallInt;
FMidasServerAddress : string;
procedure AddMessage(AMsg : string);
procedure CustomOnDblClick(Sender : TObject);
function Get_Local_IPAddr : string;
procedure HandleExceptionError(AProcName, AErr, ADelphiError :
  string);
function Login : boolean;
function Logout : boolean;
procedure NewDataEvent(ATXID : integer; ATXPayload : string;
  TotalTXs : integer;
   var EventCompleted : boolean; var EventCompletedSuccessfully :
  boolean);
function ProcessTX(AGlobalMatchCode : string; ATXID : Integer;
   const ATXPayload : string; var ANextTXID : Integer;
   var ASQLServerErrroCode : integer; var ASQLServerErrorDesc :
  string) : WordBool;
procedure SetActive(const Value : boolean);
procedure SetGlobalMatchCode(const Value : string);
procedure SetMidasServerAddress(const Value : string);
procedure SetMidasServerPort(const Value : SmallInt);
 protected
 
 public
constructor Create(AOwner : TComponent); override;
destructor Destroy; override;
 published
property Active : 

Re: [DUG]: [Q] MIDAS (Socket Connection), BDE, Threads

2001-10-07 Thread Robert Martin



TDatabase components use the 'Defaut' session by 
default. You simply need create a new session for each TDatabase you 
create. To create a applicatoin only runtime Session we use the following 
code...


constructor TProcessing.Create(Sender : 
TClient);// Each client has their own Processing 
threadbegininherited create(True); // don't 
execute immediately Owner := Sender; 
FreeOnTerminate := True; ClientSession := 
TSession.Create(MainForm); 

 
EnterCriticalSection(IncSessionNo); 
try 
Inc(MainForm.SessionNo); 
ClientSession.SessionName := 'Client Session ' + 
IntToStr(MainForm.SessionNo); 
finally 
LeaveCriticalSection(IncSessionNo); end;
..



Note ClientSession is a TSession that all database 
stuff is pointed to. The other bit ensures that the 
clientSession.SessionName is unique. Hope this is of some use

Robert MartinSoftware EngineerWild Software Ltd

  - Original Message - 
  From: 
  Donovan J. 
  Edye 
  To: Multiple recipients of list delphi 
  Sent: Monday, October 08, 2001 3:54 
  PM
  Subject: Re: [DUG]: [Q] MIDAS (Socket 
  Connection), BDE, Threads
  R,Sorry. Part II. Is a TSession still necessary even 
  though the thread and the application have their own TDatabase components and 
  inherently their own Session?At 15:50 08/10/2001 +1300, you wrote:
  I have no 
idea about how MIDAS works but you definately need to use a seperate session 
with each thread when working with DBase etc. As to BDE crashes, me 
too! Any app that crashes the BDE will crash any other app using the 
BDE in my experiance.Robert MartinSoftware 
EngineerWild Software Ltd
- Original Message - 
  From: Donovan J. 
  Edye To: Multiple 
  recipients of list delphi Sent: Monday, October 08, 2001 
  2:49 PMSubject: [DUG]: [Q] MIDAS (Socket Connection), BDE, 
  ThreadsG'Day All,I have the following:- A 
  component TCricketLiveScoringClient that uses a MIDAS socket connection to 
  make and handle a connection to a MIDAS server- The above component 
  uses a TTXProcessThread to monitor changes in a local BDE table- When 
  a change is detected by the it uses TCricketLiveScoringClient.ProcessTX() 
  to send the transaction to the MIDAS serverHowever what I am 
  finding is that if an exception is raised and the thread terminated and 
  the connection to the MIDAS server closed that the application dies 
  horribly with access violation(s), runtime error 216 etc. So my questions 
  are these:- The thread uses its own TDatabase connection (and not 
  the TDatabase connection of the application that contains the component). 
  But does it require a TSession component as well? Are there issues here to 
  do with the BDE/Threading?- It appears to me that the AppServer 
  property of the TSocketConnection "disappears" out from under me. However 
  no amount of: if not 
  ((VarIsNull(FSocketConnection.AppServer)) AND (varEmpty = 
  VarType(FSocketConnection.AppServer)) 
  AND (varNull = 
  VarType(FSocketConnection.AppServer))) thenseems to protect me from 
  getting the access violation.Can anybody provide me with some 
  pointers etc.? Below find the necessary code, but if you need anything 
  else then please ask. I am at a loss as to how to solve this. Environment 
  is D5.01 Enterprise.TIAtype 
  TNewTXDataEvent = procedure(ATXID : integer; ATXPayload : string; TotalTXs 
  : integer; var EventCompleted : boolean; 
  var EventCompletedSuccessfully : boolean) of object; 
  TTXProcessThread = class(TThread) 
  private FDatabase : 
  TDataBase; FEventCompleted : 
  boolean; FEventCompletedSuccessfully : 
  boolean; FLastTxIDProcessed : 
  integer; //FSession : 
  TSession; FTXTable : 
  TTable; FNewTXDataEvent : 
  TNewTXDataEvent; 
  protected procedure Execute; 
  override; procedure 
  FireCallBackEvent; 
  public constructor 
  Create(CreateSuspended : Boolean; ADBPath : 
  string; AStartTXID : 
  integer; ANewTXData : TNewTXDataEvent); 
  destructor Destroy; override; 
  end;type TCricketLiveScoringClient = 
  class(TCustomPanel) 
  private FActive : 
  boolean; FCricketAppGUID : 
  string; FGlobalMatchCode : 
  string; FLastTXProcessed : 
  integer; FSocketConnection : 
  TSocketConnection; FStatusPanel : 
  TPanel; FTXPanel : 
  TPanel; FMessages : 
  TStringList; FTXProcessingThread : 
  TTXProcessThread; FClientIP : 
  string; FDBPath : 
  string; FLoggedIn : 
  boolean; FMidasServerPort : 
  SmallInt; FMidasServerAddress : 
  string; procedure AddMessage(AMsg : 
  string); procedure 
  CustomOnDblClick(Sender : TObject); 
  function Get_Local_IPAddr : string; 
  procedure HandleExceptionError(AProcName, AErr, ADelphiError : 
  string); function Login : 
  boolean; function Logout :