Groups > Borland > Borland Delphi migration > Re: DirectX interface needs variant record initialization




DirectX interface needs variant record initialization

DirectX interface needs variant record initialization
Fri, 1 Dec 2006 15:13:46 -0500
This code is not compiling in Delphi 2006.

  PD3DMatrix = ^TD3DMatrix;
  _D3DMATRIX = packed record
    case integer of
      0 : (_11, _12, _13, _14: Single;
           _21, _22, _23, _24: Single;
           _31, _32, _33, _34: Single;
           _41, _42, _43, _44: Single);
      1 : (m : array [0..3, 0..3] of Single);
  end ;


It worked in Delphi 5,6, and 7.

There error is

Type Array needs initialization - not allowed in variant record (E2418)


how should I get around this? 

Post Reply
Re: DirectX interface needs variant record initialization
Mon, 4 Dec 2006 08:19:17 -0500
Well, I think I resolved the problem, more or less.  I could have sworn I 
started a Win32 app, but apparently it was Dotnet.  I had a crash and when I 
restarted the project in Win32 only, it complained about needing some DotNet 
stuff.  So I recreated the project as Win32 and used some compiler 
conditionals in the units and it compiled okay.  Don't know exactly how it 
got around the problem, but I suspect it is not a problem for Win32 and is 
for DotNet.

Post Reply
about | contact