It seems that these functions and constants you are using are from Windows unit.<div><br></div><div>Did you tried to include it in your uses clause?<br><br><div class="gmail_quote">2011/4/7 Peter Williams <span dir="ltr"><<a href="mailto:pewilliams2010@live.com">pewilliams2010@live.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<div style="font-family:Tahoma;font-size:10pt">Hi All,</div><div style="font-family:Tahoma;font-size:10pt"><br></div><div style="font-family:Tahoma;font-size:10pt">I have a legacy Delphi 7 project which works fine in D7, but it gives these errors in Lazarus 0.9.31.</div>
<div style="font-family:Tahoma;font-size:10pt"><br></div><div style="font-family:Tahoma;font-size:10pt">Options changed, recompiling clean with -B</div><div style="font-family:Tahoma;font-size:10pt">Hint: Start of reading config file /etc/fpc.cfg</div>
<div style="font-family:Tahoma;font-size:10pt">Hint: End of reading config file /etc/fpc.cfg</div><div style="font-family:Tahoma;font-size:10pt">Free Pascal Compiler version 2.4.2-0 [2010/11/11] for i386</div><div style="font-family:Tahoma;font-size:10pt">
Copyright (c) 1993-2010 by Florian Klaempfl</div><div style="font-family:Tahoma;font-size:10pt">Target OS: Linux for i386</div><div style="font-family:Tahoma;font-size:10pt">Compiling Project1.lpr</div><div style="font-family:Tahoma;font-size:10pt">
Compiling DVDregion1.pas</div><div style="font-family:Tahoma;font-size:10pt">DVDregion1.pas(62,13) Error: Identifier not found "ZeroMemory"</div><div style="font-family:Tahoma;font-size:10pt">DVDregion1.pas(63,21) Error: Identifier not found "GetDriveType"</div>
<div style="font-family:Tahoma;font-size:10pt">DVDregion1.pas(65,23) Error: Identifier not found "DRIVE_CDROM"</div><div style="font-family:Tahoma;font-size:10pt">DVDregion1.pas(76,28) Error: Identifier not found "DeviceIoControl"</div>
<div style="font-family:Tahoma;font-size:10pt">DVDregion1.pas(115) Fatal: There were 4 errors compiling module, stopping </div><div style="font-family:Tahoma;font-size:10pt"><br></div><div style="font-family:Tahoma;font-size:10pt">
<br></div><div><div><font face="Tahoma" size="2">unit DVDregion1;</font></div><div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2">{$MODE Delphi}</font></div><div><font face="Tahoma" size="2"><br>
</font></div><div><font face="Tahoma" size="2">interface</font></div><div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2">uses</font></div><div><font face="Tahoma" size="2"> LCLIntf, LCLType, LMessages, Classes, SysUtils, Forms, StdCtrls, Controls;</font></div>
<div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2">type</font></div><div><font face="Tahoma" size="2"> DVD_REGION = record</font></div><div><font face="Tahoma" size="2"> CopySystem,</font></div>
<div><font face="Tahoma" size="2"> RegionData, // current media region</font></div><div><font face="Tahoma" size="2"> SystemRegion, // current drive region</font></div><div><font face="Tahoma" size="2"> ResetCount: Byte;</font></div>
<div><font face="Tahoma" size="2"> end;</font></div><div><font face="Tahoma" size="2"> PDVD_REGION = ^DVD_REGION;</font></div><div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2">const</font></div>
<div><font face="Tahoma" size="2"> IOCTL_DVD_GET_REGION = $335014;</font></div><div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2">type</font></div><div><font face="Tahoma" size="2"> TForm1 = class(TForm)</font></div>
<div><font face="Tahoma" size="2"> Memo1: TMemo;</font></div><div><font face="Tahoma" size="2"> Button1: TButton;</font></div><div><font face="Tahoma" size="2"> procedure Button1Click(Sender: TObject);</font></div>
<div><font face="Tahoma" size="2"> private</font></div><div><font face="Tahoma" size="2"> { Private declarations }</font></div><div><font face="Tahoma" size="2"> public</font></div><div><font face="Tahoma" size="2"> { Public declarations }</font></div>
<div><font face="Tahoma" size="2"> end;</font></div><div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2">var</font></div><div><font face="Tahoma" size="2"> Form1: TForm1;</font></div><div>
<font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2">implementation</font></div><div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2">{$R *.lfm}</font></div><div><font face="Tahoma" size="2"><br>
</font></div><div><font face="Tahoma" size="2">procedure TForm1.Button1Click(Sender: TObject);</font></div><div><font face="Tahoma" size="2">const</font></div><div><font face="Tahoma" size="2"> drive_letter = 'H:';</font></div>
<div><font face="Tahoma" size="2"> RegionStrings: array[0..8] of string = (</font></div><div><font face="Tahoma" size="2"> ' 0 --- No Region Code - works in any DVD player',</font></div><div><font face="Tahoma" size="2"> ' 1 --- United States of America, Canada',</font></div>
<div><font face="Tahoma" size="2"> ' 2 --- Europe, France, Greece, Turkey, Egypt, Arabia, Japan and South Africa',</font></div><div><font face="Tahoma" size="2"> ' 3 --- Korea, Thailand, Vietnam, Borneo and Indonesia',</font></div>
<div><font face="Tahoma" size="2"> ' 4 --- Australia, New Zealand, Mexico, the Caribbean, and South America',</font></div><div><font face="Tahoma" size="2"> ' 5 --- India, Africa, Russia and former USSR countries',</font></div>
<div><font face="Tahoma" size="2"> ' 6 --- Peoples Republic of China',</font></div><div><font face="Tahoma" size="2"> ' 7 --- Unused',</font></div><div><font face="Tahoma" size="2"> ' 8 --- Airlines and Cruise Ships');</font></div>
<div><font face="Tahoma" size="2">var</font></div><div><font face="Tahoma" size="2"> handle: THandle;</font></div><div><font face="Tahoma" size="2"> rv, Region2Check: Integer;</font></div><div><font face="Tahoma" size="2"> region: DVD_REGION;</font></div>
<div><font face="Tahoma" size="2"> dw: DWORD;</font></div><div><font face="Tahoma" size="2"> status: Boolean;</font></div><div><font face="Tahoma" size="2"> Mask: byte;</font></div><div><font face="Tahoma" size="2">begin</font></div>
<div><font face="Tahoma" size="2"> Memo1.Clear;</font></div><div><font face="Tahoma" size="2"> ZeroMemory(@region, SizeOf(DVD_REGION));</font></div><div><font face="Tahoma" size="2"> rv := GetDriveType(drive_letter);</font></div>
<div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2"> if rv = DRIVE_CDROM then</font></div><div><font face="Tahoma" size="2"> Memo1.Lines.Add('Drive is a CD/DVD drive');</font></div>
<div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2"> handle := FileCreate('\\.\' + drive_letter); { *Converted from CreateFile* }</font></div><div><font face="Tahoma" size="2"><br>
</font></div><div><font face="Tahoma" size="2"> if handle = INVALID_HANDLE_VALUE then</font></div><div><font face="Tahoma" size="2"> begin</font></div><div><font face="Tahoma" size="2"> Memo1.Lines.Add('Cannot open the drive');</font></div>
<div><font face="Tahoma" size="2"> Exit;</font></div><div><font face="Tahoma" size="2"> end;</font></div><div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2"> status := DeviceIoControl(</font></div>
<div><font face="Tahoma" size="2"> handle, // handle to device</font></div><div><font face="Tahoma" size="2"> IOCTL_DVD_GET_REGION, // dwIoControlCode</font></div><div><font face="Tahoma" size="2"> nil, // lpInBuffer</font></div>
<div><font face="Tahoma" size="2"> 0, // nInBufferSize</font></div><div><font face="Tahoma" size="2"> @region, // output buffer</font></div><div><font face="Tahoma" size="2"> SizeOf(DVD_REGION), // buffer size</font></div>
<div><font face="Tahoma" size="2"> dw, // number of bytes returned</font></div><div><font face="Tahoma" size="2"> nil);</font></div><div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2"> if not status then</font></div>
<div><font face="Tahoma" size="2"> begin</font></div><div><font face="Tahoma" size="2"> FileClose(handle); { *Converted from CloseHandle* }</font></div><div><font face="Tahoma" size="2"> Memo1.Lines.Add('DevIoControl Failed');</font></div>
<div><font face="Tahoma" size="2"> Exit;</font></div><div><font face="Tahoma" size="2"> end;</font></div><div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2"> Memo1.Lines.Add('The Region and Code for this DVD :');</font></div>
<div><font face="Tahoma" size="2"> Memo1.Lines.Add('');</font></div><div><font face="Tahoma" size="2"> Memo1.Lines.Add('Code - Region');</font></div><div><font face="Tahoma" size="2"><br></font></div><div>
<font face="Tahoma" size="2"> if region.RegionData and $3F = 0 then</font></div><div><font face="Tahoma" size="2"> Memo1.Lines.Add(RegionStrings[0])</font></div><div><font face="Tahoma" size="2"> else</font></div><div>
<font face="Tahoma" size="2"> begin</font></div><div><font face="Tahoma" size="2"> Mask := 1;</font></div><div><font face="Tahoma" size="2"> for Region2Check := 1 to 8 do</font></div><div><font face="Tahoma" size="2"> begin</font></div>
<div><font face="Tahoma" size="2"> if region.RegionData and Mask = 0 then</font></div><div><font face="Tahoma" size="2"> Memo1.Lines.Add(RegionStrings[Region2Check]);</font></div><div><font face="Tahoma" size="2"> Mask := Mask shl 1;</font></div>
<div><font face="Tahoma" size="2"> end;</font></div><div><font face="Tahoma" size="2"> end;</font></div><div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2"> FileClose(handle); { *Converted from CloseHandle* }</font></div>
<div><font face="Tahoma" size="2">end;</font></div><div><font face="Tahoma" size="2"><br></font></div><div><font face="Tahoma" size="2">end.</font></div></div><div style="font-family:Tahoma;font-size:10pt"><br></div><div style="font-family:Tahoma;font-size:10pt">
Best Regards,</div><div style="font-family:Tahoma;font-size:10pt">Peter E Williams</div><div style="font-family:Tahoma;font-size:10pt"><br></div><div style="font-family:Tahoma;font-size:10pt"><br></div> </div>
<br>--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Daniel<br><br>"Let us change our traditional attitude to the construction of programs. Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do." (Donald Knuth)<br>
<br>"Yes, technogeeks can be funny, even if only to each other." (<a href="http://www.boogieonline.com/revolution/science/humor/">http://www.boogieonline.com/revolution/science/humor/</a>)"<br><br>"Man is driven to create; I know I really love to create things. And while I'm not good at painting, drawing, or music, I can write software." (Yukihiro Matsumoto, a.k.a. ``Matz'')<br>
</div>