Structures with .DLL's

Everything else that doesn't fall into one of the other PB categories.
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Structures with .DLL's

Post by Killswitch »

I've downloaded a .dll to help me with generating CD ID's for use with a free service that give's you the name and track listings of CD's that some of you suggested to me in a previous post.

This is the first time i've used a .dll in one of my programs, so I'm a bit shakey to start off with. Now in the documentation this is appended on the end (it's freeware, so I'm not breaking any agreements):
Types
TCdRom = record
HaId : Byte;
Target : Byte;
Lun : Byte;
Vendor : ShortString;
ProductId : ShortString;
Revision : ShortString;
VendorSpec: ShortString;
end;


TCdRoms = record
CdRomCount: Byte;
CdRom : array[0..25] of TCdRom;
end;


TTOC = record
M: Byte;
S: Byte;
F: Byte;
AudioTrack: Boolean; // indicates if the track is an audio or data track
end;


TCdToc = record
TracksOnCD: Byte;
LeadOut : TTOC;
Tracks : array[0..99] of TTOC;
end;
Am I right in saying that these are structures? And if so how do I impliment them properly? Bytes are easy but PB doesn't have a nativge Boolean true/false type does it? And 'Traks : array[0...99] or TTOC is a structured array in a strucuture, how do I impliment that?

Thanks for you help in advance.
~I see one problem with your reasoning: the fact is thats not a chicken~
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post by tinman »

Look like structures anyway.

What language was it written in? That would give you an idea how big the boolean is, but IIRC it is normally a long in Windows. You'll also have to watch out for misalignment of data in the structures, since there are a few odd numbered bytes at the start of some.

Structure mystructure
member.type[number_items_in_the_array]
EndStructure
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Post by Killswitch »

I'm not sure, but I think it was C. Deffinatly not Pascel as there is a Pascel version avliable. Thanks for your help.
~I see one problem with your reasoning: the fact is thats not a chicken~
FloHimself
Enthusiast
Enthusiast
Posts: 229
Joined: Wed May 14, 2003 3:38 pm
Location: Lüneburg - Germany

Post by FloHimself »

This seems to be Delphi.
Boolean = 1 Byte
ShortString = 256 Byte
Post Reply