#1 Burning Software

It is currently Fri Dec 20, 2024 10:18 am

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: GetTrackInformation not work on delphi
PostPosted: Sat Mar 18, 2006 1:20 pm 
Offline

Joined: Wed Feb 22, 2006 6:25 am
Posts: 12
I have a blank DVD+R, but when use StarBurn_CdvdBurnerGrabber_GetTrackInformation can get
m__LONG__FreeLBs value
but m__LONG__NextWritableAddress always return 0

so I can not get right free space on DVD+R

also in c++ bulder demo work
but on delphi not work


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 18, 2006 6:16 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
For blank DVD NWA should be always zero. FreeLBs is free space. So everything works perfectly well.

I don't understand what your problem really is...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 18, 2006 7:06 pm 
Offline

Joined: Wed Feb 22, 2006 6:25 am
Posts: 12
I want to know how to get free space on a blank DVD
FreeOnDisc :=FTRACK_INFORMATION.m__LONG__FreeLBs * 2048;
but only get 386MB,in fact should get 4GB

why?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 18, 2006 9:34 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
B/s you seems to have problems understanding how large number can 32-bit integer hold. You just get overlapped value... Using 32-bit integers (and math in general) instead of 64-bit ones is *YOUR* problem and not SDK. Fix your program and everything would work in a sharm :)

onlykingqc wrote:
I want to know how to get free space on a blank DVD
FreeOnDisc :=FTRACK_INFORMATION.m__LONG__FreeLBs * 2048;
but only get 386MB,in fact should get 4GB

why?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 19, 2006 6:28 am 
Offline

Joined: Wed Feb 22, 2006 6:25 am
Posts: 12
I use
var
FreeOnDisc: Int64;
get same result
then use FreeonDsic:LARGE_INTEGER;
but still get 386 MB


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 19, 2006 10:00 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Send us debug logs and your exact failing snippet of code.

onlykingqc wrote:
I use
var
FreeOnDisc: Int64;
get same result
then use FreeonDsic:LARGE_INTEGER;
but still get 386 MB


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 19, 2006 10:42 am 
Offline

Joined: Wed Feb 22, 2006 6:25 am
Posts: 12
not know why
if i use
FreeOnDisc:=m__LONG__FreeLBs*2048
get wrong
but if use
FreeOnDisc:=m__LONG__FreeLBs;
FreeOnDisc:=FreeOnDisc*2048;
(freeondisc:int64)
get right result :evil:


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 19, 2006 4:05 pm 
Offline

Joined: Fri Mar 03, 2006 10:56 am
Posts: 3
Yes, this is correct and is how it should be. You can find the answer in the Delphi manual.

In an assignment statement in Delphi the resulting variable type is determined by the type of the largest operand, NOT by the type of the variable receiving the result!

If you do a := b * c then Delphi will calculate the result with the type of the largest variabele and the end result of the calculation will be assigned to a. So if b and c are integers, the result will be of type integer and after the calculation is complete that integer will be assigned to a, even if a itself is of type int64.

If you want the result of a := b * c to be an int64 you could do something like this a := int64(b) * c. Now the first operand is an int64 and the complete calculation will be done within an int64 variable.

In your example FreeOnDisc := m__LONG__FreeLBs * 2048 you will get a result of the type of variable m__LONG__FreeLBs which is longint.
If you want the result of the calculation to be of type int64 you could do for example FreeOnDisc := int64(m__LONG__FreeLBs) * 2048


Last edited by Aspegic on Sun Mar 19, 2006 5:12 pm, edited 3 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 19, 2006 4:47 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
So the problem indeed was in wrong understanding of Delphi type casts and not in StarBurn itself. Good. Thanks to everybody :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group