Question Translate C# Code To Abloo When Using .net

RealHeavyDude

Well-Known Member
As per my experience - YMMV - mostly replace the dot '.' with colon ':'.

Sometimes - when the output of the .NET object is an Array I use the .NET Array object and iterate through the array casting to the particular object type.

Heavy Regards, RealHeavyDude.
 

Cecil

19+ years progress programming and still learning.
Thanks.

Things I get stuck on is the following, where DataDelegate() , EventDelegate() , ErrorDelegate() and CertificateDelegate() methods get passed the name of a method, that is not a quoted string value. How do you do this in the ABL? this-object:methodName does not work.

C# code:
Code:
lResult = MMM.Readers.FullPage.Reader.Initialise(
                    new MMM.Readers.FullPage.DataDelegate(DataCallbackThreadHelper),
                    new MMM.Readers.FullPage.EventDelegate(EventCallbackThreadHelper),
                    new MMM.Readers.ErrorDelegate(ErrorCallbackThreadHelper),
                    new MMM.Readers.FullPage.CertificateDelegate(CertificateCallbackThreadHelper),
                    true,
                    false
                );

My ABL code:
Code:
lResult = MMM.Readers.FullPage.Reader:Initialise(
                    new MMM.Readers.FullPage:DataDelegate( DataCallbackThreadHelper ), /** <--- WHAT GOES HERE**/
                    new MMM.Readers.FullPage:EventDelegate( EventCallbackThreadHelper ), /** <--- WHAT GOES HERE**/
                    new MMM.Readers:ErrorDelegate( ErrorCallbackThreadHelper ), /** <--- WHAT GOES HERE**/
                    new MMM.Readers.FullPage:CertificateDelegate( CertificateCallbackThreadHelper ), /** <--- WHAT GOES HERE**/
                    true,
                    false
                ).
 

Cecil

19+ years progress programming and still learning.
Are the methods you are passing residing in the ABL class in which you are invoking this?

If I understand your question, then the answer is yes. For example, the "DataCallbackThreadHelper" would be either a METHOD of an internal PROCEDURE.
 

Cecil

19+ years progress programming and still learning.
So.... I've discovered the Class Browser tool in Progress Developer Studio. Sorry I 'using this forum thread as a blog.

Code:
DEFINE VARIABLE DataDelegate AS CLASS MMM.Readers.FullPage.DataDelegate.
DataDelegate = NEW MMM.Readers.FullPage.DataDelegate( <parameters> ).

DEFINE VARIABLE EventDelegate AS CLASS MMM.Readers.FullPage.EventDelegate.
EventDelegate = NEW MMM.Readers.FullPage.EventDelegate( <parameters> ).

DEFINE VARIABLE ErrorDelegate AS CLASS MMM.Readers.ErrorDelegate.
ErrorDelegate = NEW MMM.Readers.ErrorDelegate( <parameters> ).

DEFINE VARIABLE CertificateDelegate AS CLASS MMM.Readers.FullPage.CertificateDelegate.
CertificateDelegate= NEW MMM.Readers.FullPage.CertificateDelegate( <parameters> ). /** <!-- still not sure what to pass a  parameter here .--**/

METHOD PUBLIC STATIC FINAL MMM.Readers.ErrorCode Initialise (DataDelegate, EventDelegate,  ErrorDelegate,  CertificateDelegate,
aProcessMessages AS logical,
aProcessInputMessages AS logical).


CONSTRUCTOR PUBLIC FINAL DataDelegate (object AS CLASS System.Object, method AS CLASS System.IntPtr)
CONSTRUCTOR PUBLIC FINAL EventDelegate (object AS CLASS System.Object, method AS CLASS System.IntPtr)
CONSTRUCTOR PUBLIC FINAL CertificateDelegate (object AS CLASS System.Object, method AS CLASS System.IntPtr)
 
Last edited:
Top