I have two constructors.
I noted that if I use only one, by taking of the word "overload", I can call by
passing nil.
constructor Create();overload;
constructor Create(
ActiveIO, ActiveRS232, ActiveRS485 : boolean;
ChipOnRS232, BarcodeOnRS232, LcdOnBoard : boolean;
SecTimeoutInDestroyingInternalThreads : Cardinal;
SecTimeoutOnIO, SecTimeoutOnRS232IfNoChip,
SecTimeoutOnRS485 : Cardinal;
AllReconnectionIfChipReconnect,
AllReconnectionIfOneReconnect : boolean;
JSChipProcedure : TUniBoardProcJSChip;
JSChipMethod : TUniBoardMethodJSChip;
JSUserPointer : Pointer;
CorruptionProc : TUniBoardProcCorruption;
CorruptionMethod : TUniBoardMethodCorruption;
CorruptionUserPointer : Pointer;
H_EventOnReceiveMessages : THandle;
H_EventsOnReconnection : array of THandle;
ProbabileIp : String
); overload;
I have a class TMyClass
with two methods:
procedure JustStartMethod2( IdThread : integer; CodObj : integer ;
MyPointer : Pointer ); stdcall;
procedure CorrMethodTest( IdThread : int;
ObjId : int;
Channel : int;
CodeLauncher : integer;
CodeCorruption : integer;
ParameterCorruption : integer;
UserPointer : Pointer ); stdcall;
The call, done in a third method of TMyClass, is
TUniplanBoard.Create( CB_ActiveIOecov.Checked,
CB_ActiveRS232.Checked,
CB_ActiveRS485.Checked,
not CBnoAtmel.Checked,
CB_BarcodeOnRS232.Checked,
not CBatmelLCD.Checked,
0,0,0,0,
true,false,
nil,JustStartMethod2,nil,
nil,nil, nil, //instead of
nil,CorrMethodTest,nil, => compiler error. It disappears if i use
"nil,CorrMethodTest,nil"
0,EmptyArray,'172.16.12.145')
The types definition are
type TUniBoardProcJSChip = Procedure( IdThread : TUniBoardThreadId;
ObjId : TUniBoardObjectId;
UserPointer : Pointer ); stdcall;
type TUniBoardMethodJSChip = Procedure( IdThread : TUniBoardThreadId;
ObjId : TUniBoardObjectId;
UserPointer : Pointer )
of object; stdcall;
type TUniBoardProcCorruption = Procedure( IdThread : TUniBoardThreadId;
ObjId : TUniBoardObjectId;
Channel : TUniBoardChannels;
CodeLauncher : integer;
CodeCorruption : integer;
ParameterCorruption : integer;
UserPointer : Pointer ); stdcall;
type TUniBoardMethodCorruption = Procedure( IdThread : TUniBoardThreadId;
ObjId : TUniBoardObjectId;
Channel : TUniBoardChannels;
CodeLauncher : integer;
CodeCorruption : integer;
ParameterCorruption : integer;
UserPointer : Pointer )
of object; stdcall;
If
----- Original Message -----
From: Rob Kennedy
To: [email protected]
Sent: Wednesday, January 31, 2007 10:55 PM
Subject: Re: [delphi-en] __Fastcall and PAscal
mauro russo wrote:
> why the compiler gets me an error if i pass 'nil'
> a parameter having as type a procedure of object?
It shouldn't. Please show your code, including the declaration of the
function you're trying to call and the line of code where you try to call
it.
--
Rob
------------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.18/662 - Release Date: 31/01/2007
15.16
----------
Questa email รจ stata verificata dal sistema centralizzato antivirus della
UniPlan Software
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/delphi-en/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/