Re: Struct Layout in C# to Delphi.Net

From: Marc Scheuner [MVP ADSI] (m.scheuner_at_inova.SPAMBEGONE.ch)
Date: 02/27/04


Date: Fri, 27 Feb 2004 07:36:46 +0100


>1. in C# they declare a const: const short = 1;

The same:

const
        Short = 1;

>2. [StructLayout(LayoutKind.Sequential, Pack=2)] It is placed before class
>declaration. What the hack is that? And how i go about Delphi?

Same:

* add "System.Runtime.InteropServices" the the uses clause

[StructLayout(LayoutKInd.Sequential, Pack=2)]
TMyClass = class.......
.....
end;

Remember: Delphi 8 for .NET *IS* a full featured .NET language - no
need to break or change stuff from C# - it uses the SAME foundations!

Marc



Relevant Pages

  • Re: All the hacking...
    ... installing a component into Turbo Delphi Explorer using only the ... GUI does not qualify as a *hack* - it seems ... as it requires the installation of a software that explicitly ... This hacking is the BEST part about the whole Turbo stuff! ...
    (borland.public.delphi.non-technical)
  • Re: Hacking Delphi 2005 (updated)
    ... I've rewritten and updated my procedure to convert Delphi ... I can just imagine the fun at Borland when followers of ... this hack report bugs. ...
    (borland.public.delphi.non-technical)
  • Re: Writing device drivers in Delphi.
    ... > hack to let you write device drivers in Delphi. ... where would you see translating the DDK header files ...
    (borland.public.delphi.non-technical)
  • Re: Oh Boss . . . Where are you?
    ... in your case it is "Hack". ... I guess Mr. Lundahl ... did not have a "Specific Performance" clause in his contract as he ...
    (rec.audio.tubes)
  • Re: Declaring Units in the Uses section
    ... >are automatically added to that list by Delphi itself as the project is ... >word "Math" in the USES section. ... In my D4P is I add a new Unit then it does not even make a Uses clause ... - the design is actually quite useful ...
    (comp.lang.pascal.delphi.misc)