Thread View: borland.public.cppbuilder.upgrade
2 messages
2 total messages
Started by Martin
Thu, 13 Sep 2007 23:25
Difference in syntax from C++ Builder 5 to Rad 5
Author: Martin
Date: Thu, 13 Sep 2007 23:25
Date: Thu, 13 Sep 2007 23:25
49 lines
2417 bytes
2417 bytes
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
Author: David Dean [CodeGear]
Date: Fri, 14 Sep 2007 17:42
Date: Fri, 14 Sep 2007 17:42
13 lines
1331 bytes
1331 bytes
In article <46e9c6e7@newsgroups.borland.com>, Martin <dev@no.comppromed.spam.com> wrote: > 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 <http://blogs.codegear.com/ddean/>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads