Board index » cppbuilder » Difference in syntax from C++ Builder 5 to Rad 5

Difference in syntax from C++ Builder 5 to Rad 5


2007-09-14 07:25:03 AM
cppbuilder84
I downloaded the trial version of C++ Builder/Delphi 2007 and trying to
see how much of the existing code I have will work in the new version.
This code was originally written for compatibility with C++ Builder 5
and the corresponding Delphi version.
I have some components written mostly in Delphi with some assembly that
the new compiler doesn't like. I've included the relevant sections below:
type
QPCCast = record
LowPart: DWORD;
HighPart: DWORD;
end;
{ Centralized timer method -- will use QueryPerformaceCounter }
{ if avail, return is the number of ms since the system started }
function AdTimeGetTime : DWord;
{$IFDEF Win32}
var
Count : TLargeInteger;
{$ENDIF}
begin
{$IFDEF Win32}
if QPFreq <>0 then begin
QueryPerformanceCounter(Count);
asm
xor edx, edx
mov eax, QPCCast(Count).HighPart
div QPFreq
mov eax, QPCCast(Count).LowPart
div QPFreq
mov Result, eax
end;
end else
{$ENDIF}
Result := timeGetTime;
end;
The error I'm getting from RAD is E2003 Undeclared identifier, on
HighPart and LowPart. I don't know Delphi or assembly really, but my
understanding is that the code is trying to cast the variable Count as
type QPCCast and reference the upper and lower 32-bits of the 64-bit
integer. Has there been a syntactic change that makes this unusable?
How should this been done in the new version? These are not the only
places that this particular type of casting is happening.
Thanks,
Marty
 
 

Re:Difference in syntax from C++ Builder 5 to Rad 5

In article < XXXX@XXXXX.COM >,
Martin < XXXX@XXXXX.COM >wrote:
Quote
The error I'm getting from RAD is E2003 Undeclared identifier
Which compiler dcc32 or bcc32? I am assuming dcc32 since you didn't
include any C++ code. You may want to ask here:
borland.public.delphi.language.objectpascal
--
-David Dean
CodeGear C++ QA Engineer
<blogs.codegear.com/ddean/>