mirror of
https://github.com/loginov-dmitry/multithread.git
synced 2025-02-17 16:10:54 +02:00
Добавлен пример использования Queue Ex12
This commit is contained in:
parent
17c02e74a9
commit
08549844b5
16
Ex12/Ex12Proj.dpr
Normal file
16
Ex12/Ex12Proj.dpr
Normal file
@ -0,0 +1,16 @@
|
||||
program Ex12Proj;
|
||||
|
||||
uses
|
||||
Forms,
|
||||
Ex12Unit in 'Ex12Unit.pas' {Form1},
|
||||
MTUtils in '..\CommonUtils\MTUtils.pas',
|
||||
TimeIntervals in '..\CommonUtils\TimeIntervals.pas';
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.MainFormOnTaskbar := True;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
168
Ex12/Ex12Proj.dproj
Normal file
168
Ex12/Ex12Proj.dproj
Normal file
@ -0,0 +1,168 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{bf66e0cb-fcbf-4156-8ea1-35f34dc0312d}</ProjectGuid>
|
||||
<MainSource>Ex12Proj.dpr</MainSource>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
|
||||
<DCC_DependencyCheckOutputName>Ex12Proj.exe</DCC_DependencyCheckOutputName>
|
||||
<FrameworkType>VCL</FrameworkType>
|
||||
<ProjectVersion>18.7</ProjectVersion>
|
||||
<Base>True</Base>
|
||||
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
||||
<TargetedPlatforms>1</TargetedPlatforms>
|
||||
<AppType>Application</AppType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
|
||||
<Base_Win32>true</Base_Win32>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
|
||||
<Base_Win64>true</Base_Win64>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
|
||||
<Cfg_1_Win32>true</Cfg_1_Win32>
|
||||
<CfgParent>Cfg_1</CfgParent>
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
|
||||
<Cfg_2_Win32>true</Cfg_2_Win32>
|
||||
<CfgParent>Cfg_2</CfgParent>
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base)'!=''">
|
||||
<SanitizedProjectName>Ex12Proj</SanitizedProjectName>
|
||||
<DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace>
|
||||
<VerInfo_Locale>1049</VerInfo_Locale>
|
||||
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_Win32)'!=''">
|
||||
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
|
||||
<BT_BuildType>Debug</BT_BuildType>
|
||||
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
|
||||
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
|
||||
<Icon_MainIcon>Ex12Proj_Icon.ico</Icon_MainIcon>
|
||||
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
|
||||
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_Win64)'!=''">
|
||||
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
|
||||
<Icon_MainIcon>Ex12Proj_Icon.ico</Icon_MainIcon>
|
||||
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
|
||||
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
||||
<Version>7.0</Version>
|
||||
<DCC_DebugInformation>0</DCC_DebugInformation>
|
||||
<DCC_LocalDebugSymbols>False</DCC_LocalDebugSymbols>
|
||||
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
|
||||
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
|
||||
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||
<Version>7.0</Version>
|
||||
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
|
||||
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
|
||||
</PropertyGroup>
|
||||
<ProjectExtensions>
|
||||
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
|
||||
<Borland.ProjectType>VCLApplication</Borland.ProjectType>
|
||||
<BorlandProject>
|
||||
<Delphi.Personality>
|
||||
<Parameters>
|
||||
<Parameters Name="UseLauncher">False</Parameters>
|
||||
<Parameters Name="LoadAllSymbols">True</Parameters>
|
||||
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
|
||||
</Parameters>
|
||||
<VersionInfo>
|
||||
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||
<VersionInfo Name="Release">0</VersionInfo>
|
||||
<VersionInfo Name="Build">0</VersionInfo>
|
||||
<VersionInfo Name="Debug">False</VersionInfo>
|
||||
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||
<VersionInfo Name="Special">False</VersionInfo>
|
||||
<VersionInfo Name="Private">False</VersionInfo>
|
||||
<VersionInfo Name="DLL">False</VersionInfo>
|
||||
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||
</VersionInfo>
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName"/>
|
||||
<VersionInfoKeys Name="FileDescription"/>
|
||||
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName"/>
|
||||
<VersionInfoKeys Name="LegalCopyright"/>
|
||||
<VersionInfoKeys Name="LegalTrademarks"/>
|
||||
<VersionInfoKeys Name="OriginalFilename"/>
|
||||
<VersionInfoKeys Name="ProductName"/>
|
||||
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"/>
|
||||
</VersionInfoKeys>
|
||||
<Source>
|
||||
<Source Name="MainSource">Ex12Proj.dpr</Source>
|
||||
</Source>
|
||||
</Delphi.Personality>
|
||||
<Platforms>
|
||||
<Platform value="Win32">True</Platform>
|
||||
<Platform value="Win64">False</Platform>
|
||||
</Platforms>
|
||||
</BorlandProject>
|
||||
<ProjectFileVersion>12</ProjectFileVersion>
|
||||
</ProjectExtensions>
|
||||
<ItemGroup>
|
||||
<DelphiCompile Include="$(MainSource)">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="Ex12Unit.pas">
|
||||
<Form>Form1</Form>
|
||||
</DCCReference>
|
||||
<DCCReference Include="..\CommonUtils\MTUtils.pas"/>
|
||||
<DCCReference Include="..\CommonUtils\TimeIntervals.pas"/>
|
||||
<BuildConfiguration Include="Debug">
|
||||
<Key>Cfg_2</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Base">
|
||||
<Key>Base</Key>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Release">
|
||||
<Key>Cfg_1</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup/>
|
||||
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
|
||||
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
|
||||
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
|
||||
</Project>
|
BIN
Ex12/Ex12Proj.res
Normal file
BIN
Ex12/Ex12Proj.res
Normal file
Binary file not shown.
63
Ex12/Ex12Unit.dfm
Normal file
63
Ex12/Ex12Unit.dfm
Normal file
@ -0,0 +1,63 @@
|
||||
object Form1: TForm1
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 390
|
||||
ClientWidth = 775
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
DesignSize = (
|
||||
775
|
||||
390)
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 16
|
||||
object labLabLastThreadTime: TLabel
|
||||
Left = 8
|
||||
Top = 47
|
||||
Width = 336
|
||||
Height = 16
|
||||
Caption = #1048#1085#1092#1086#1088#1084#1072#1094#1080#1103' '#1086' '#1074#1088#1077#1084#1077#1085#1080' '#1087#1086#1089#1083#1077#1076#1085#1077#1075#1086' '#1079#1072#1087#1091#1097#1077#1085#1085#1086#1075#1086' '#1087#1086#1090#1086#1082#1072
|
||||
end
|
||||
object btnRunInParallelThread: TButton
|
||||
Left = 8
|
||||
Top = 8
|
||||
Width = 217
|
||||
Height = 33
|
||||
Caption = #1047#1072#1087#1091#1089#1090#1080#1090#1100' '#1076#1086#1087'. '#1087#1086#1090#1086#1082
|
||||
TabOrder = 0
|
||||
OnClick = btnRunInParallelThreadClick
|
||||
end
|
||||
object Button1: TButton
|
||||
Left = 248
|
||||
Top = 8
|
||||
Width = 177
|
||||
Height = 33
|
||||
Caption = #1054#1089#1090#1072#1085#1086#1074#1080#1090#1100' '#1087#1086#1090#1086#1082#1080
|
||||
TabOrder = 1
|
||||
OnClick = Button1Click
|
||||
end
|
||||
object ListBox1: TListBox
|
||||
Left = 8
|
||||
Top = 69
|
||||
Width = 759
|
||||
Height = 313
|
||||
Anchors = [akLeft, akTop, akRight, akBottom]
|
||||
TabOrder = 2
|
||||
end
|
||||
object btnClearListBox: TButton
|
||||
Left = 431
|
||||
Top = 8
|
||||
Width = 75
|
||||
Height = 33
|
||||
Caption = #1054#1095#1080#1089#1090#1080#1090#1100
|
||||
TabOrder = 3
|
||||
OnClick = btnClearListBoxClick
|
||||
end
|
||||
end
|
116
Ex12/Ex12Unit.pas
Normal file
116
Ex12/Ex12Unit.pas
Normal file
@ -0,0 +1,116 @@
|
||||
unit Ex12Unit;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, MTUtils, ComCtrls, ExtCtrls, StrUtils, Contnrs,
|
||||
Generics.Collections;
|
||||
|
||||
type
|
||||
TMyThread = class(TThread)
|
||||
private
|
||||
procedure LogEvent(EventText: string);
|
||||
protected
|
||||
procedure Execute; override;
|
||||
end;
|
||||
|
||||
TForm1 = class(TForm)
|
||||
btnRunInParallelThread: TButton;
|
||||
Button1: TButton;
|
||||
ListBox1: TListBox;
|
||||
labLabLastThreadTime: TLabel;
|
||||
btnClearListBox: TButton;
|
||||
procedure btnRunInParallelThreadClick(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure btnClearListBoxClick(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
FList: TObjectList<TMyThread>;
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TForm1.btnClearListBoxClick(Sender: TObject);
|
||||
begin
|
||||
ListBox1.Clear;
|
||||
end;
|
||||
|
||||
procedure TForm1.btnRunInParallelThreadClick(Sender: TObject);
|
||||
begin
|
||||
// Создаём и запускаем новый поток
|
||||
FList.Add(TMyThread.Create(False));
|
||||
end;
|
||||
|
||||
procedure TForm1.Button1Click(Sender: TObject);
|
||||
var
|
||||
t: TMyThread;
|
||||
begin
|
||||
for t in FList do
|
||||
t.Terminate; // Сообщаем потокам о необходимости завершаться
|
||||
FList.Clear; // Уничтожаем потоки
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
FList := TObjectList<TMyThread>.Create;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
FList.Free;
|
||||
end;
|
||||
|
||||
{ TMyThread }
|
||||
|
||||
procedure TMyThread.Execute;
|
||||
var
|
||||
I: Integer;
|
||||
CurTime: TDateTime;
|
||||
begin
|
||||
CurTime := Now; // Запоминаем время ДО вызова Queue
|
||||
Queue(
|
||||
procedure
|
||||
begin
|
||||
Form1.labLabLastThreadTime.Caption :=
|
||||
'Последний поток был запущен: ' + DateTimeToStr(CurTime);
|
||||
end);
|
||||
|
||||
LogEvent('Thread start');
|
||||
I := 0;
|
||||
while not Terminated do
|
||||
begin
|
||||
Inc(I);
|
||||
LogEvent('Event #' + IntToStr(I));
|
||||
ThreadWaitTimeout(Self, 500);
|
||||
end;
|
||||
LogEvent('Thread stop');
|
||||
end;
|
||||
|
||||
procedure TMyThread.LogEvent(EventText: string);
|
||||
var
|
||||
ThreadId: Cardinal;
|
||||
EventTime: TDateTime;
|
||||
begin
|
||||
// Запоминаем ID потока и текущее время ДО вызова Queue
|
||||
ThreadId := GetCurrentThreadId;
|
||||
EventTime := Now;
|
||||
|
||||
TThread.Queue(nil,
|
||||
procedure
|
||||
begin
|
||||
Form1.ListBox1.Items.Add(Format('%s [T:%d] - %s',
|
||||
[FormatDateTime('hh:nn:ss.zzz', EventTime), ThreadId, EventText]));
|
||||
Form1.ListBox1.ItemIndex := Form1.ListBox1.Count - 1;
|
||||
end);
|
||||
end;
|
||||
|
||||
end.
|
16
Ex12Full/Ex12FullProj.dpr
Normal file
16
Ex12Full/Ex12FullProj.dpr
Normal file
@ -0,0 +1,16 @@
|
||||
program Ex12FullProj;
|
||||
|
||||
uses
|
||||
Forms,
|
||||
Ex12FullUnit in 'Ex12FullUnit.pas' {Form1},
|
||||
MTUtils in '..\CommonUtils\MTUtils.pas',
|
||||
TimeIntervals in '..\CommonUtils\TimeIntervals.pas';
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.MainFormOnTaskbar := True;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
137
Ex12Full/Ex12FullProj.dproj
Normal file
137
Ex12Full/Ex12FullProj.dproj
Normal file
@ -0,0 +1,137 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{C59DC37E-6942-4CFB-A342-B93AFB24DDE1}</ProjectGuid>
|
||||
<MainSource>Ex12FullProj.dpr</MainSource>
|
||||
<Base>True</Base>
|
||||
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||
<TargetedPlatforms>1</TargetedPlatforms>
|
||||
<AppType>Application</AppType>
|
||||
<FrameworkType>VCL</FrameworkType>
|
||||
<ProjectVersion>18.7</ProjectVersion>
|
||||
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
|
||||
<Base_Win32>true</Base_Win32>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
|
||||
<Base_Win64>true</Base_Win64>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
|
||||
<Cfg_1_Win32>true</Cfg_1_Win32>
|
||||
<CfgParent>Cfg_1</CfgParent>
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
|
||||
<Cfg_2_Win32>true</Cfg_2_Win32>
|
||||
<CfgParent>Cfg_2</CfgParent>
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base)'!=''">
|
||||
<DCC_E>false</DCC_E>
|
||||
<DCC_F>false</DCC_F>
|
||||
<DCC_K>false</DCC_K>
|
||||
<DCC_N>false</DCC_N>
|
||||
<DCC_S>false</DCC_S>
|
||||
<DCC_ImageBase>00400000</DCC_ImageBase>
|
||||
<SanitizedProjectName>Ex12FullProj</SanitizedProjectName>
|
||||
<DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace>
|
||||
<VerInfo_Locale>1049</VerInfo_Locale>
|
||||
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=</VerInfo_Keys>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_Win32)'!=''">
|
||||
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
|
||||
<BT_BuildType>Debug</BT_BuildType>
|
||||
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
|
||||
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
|
||||
<Icon_MainIcon>Ex12FullProj_Icon.ico</Icon_MainIcon>
|
||||
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
|
||||
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_Win64)'!=''">
|
||||
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
|
||||
<Icon_MainIcon>Ex12FullProj_Icon.ico</Icon_MainIcon>
|
||||
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
|
||||
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
||||
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
|
||||
<DCC_DebugInformation>0</DCC_DebugInformation>
|
||||
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
|
||||
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
|
||||
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
|
||||
<DCC_Optimize>false</DCC_Optimize>
|
||||
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
|
||||
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<DelphiCompile Include="$(MainSource)">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="Ex12FullUnit.pas">
|
||||
<Form>Form1</Form>
|
||||
</DCCReference>
|
||||
<DCCReference Include="..\CommonUtils\MTUtils.pas"/>
|
||||
<DCCReference Include="..\CommonUtils\TimeIntervals.pas"/>
|
||||
<BuildConfiguration Include="Debug">
|
||||
<Key>Cfg_2</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Base">
|
||||
<Key>Base</Key>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Release">
|
||||
<Key>Cfg_1</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
</ItemGroup>
|
||||
<ProjectExtensions>
|
||||
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
|
||||
<Borland.ProjectType/>
|
||||
<BorlandProject>
|
||||
<Delphi.Personality>
|
||||
<Source>
|
||||
<Source Name="MainSource">Ex12FullProj.dpr</Source>
|
||||
</Source>
|
||||
</Delphi.Personality>
|
||||
<Platforms>
|
||||
<Platform value="Win32">True</Platform>
|
||||
<Platform value="Win64">False</Platform>
|
||||
</Platforms>
|
||||
</BorlandProject>
|
||||
<ProjectFileVersion>12</ProjectFileVersion>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
|
||||
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
|
||||
</Project>
|
BIN
Ex12Full/Ex12FullProj.res
Normal file
BIN
Ex12Full/Ex12FullProj.res
Normal file
Binary file not shown.
84
Ex12Full/Ex12FullUnit.dfm
Normal file
84
Ex12Full/Ex12FullUnit.dfm
Normal file
@ -0,0 +1,84 @@
|
||||
object Form1: TForm1
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 390
|
||||
ClientWidth = 775
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
DesignSize = (
|
||||
775
|
||||
390)
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 16
|
||||
object labLabLastThreadTime: TLabel
|
||||
Left = 8
|
||||
Top = 68
|
||||
Width = 336
|
||||
Height = 16
|
||||
Caption = #1048#1085#1092#1086#1088#1084#1072#1094#1080#1103' '#1086' '#1074#1088#1077#1084#1077#1085#1080' '#1087#1086#1089#1083#1077#1076#1085#1077#1075#1086' '#1079#1072#1087#1091#1097#1077#1085#1085#1086#1075#1086' '#1087#1086#1090#1086#1082#1072
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 8
|
||||
Top = 47
|
||||
Width = 226
|
||||
Height = 16
|
||||
Caption = #1056#1077#1078#1080#1084' '#1087#1086#1089#1090#1072#1085#1086#1074#1082#1080' '#1074#1099#1079#1086#1074#1072' '#1074' '#1086#1095#1077#1088#1077#1076#1100':'
|
||||
end
|
||||
object btnRunInParallelThread: TButton
|
||||
Left = 8
|
||||
Top = 8
|
||||
Width = 217
|
||||
Height = 33
|
||||
Caption = #1047#1072#1087#1091#1089#1090#1080#1090#1100' '#1076#1086#1087'. '#1087#1086#1090#1086#1082
|
||||
TabOrder = 0
|
||||
OnClick = btnRunInParallelThreadClick
|
||||
end
|
||||
object Button1: TButton
|
||||
Left = 248
|
||||
Top = 8
|
||||
Width = 177
|
||||
Height = 33
|
||||
Caption = #1054#1089#1090#1072#1085#1086#1074#1080#1090#1100' '#1087#1086#1090#1086#1082#1080
|
||||
TabOrder = 1
|
||||
OnClick = Button1Click
|
||||
end
|
||||
object ListBox1: TListBox
|
||||
Left = 8
|
||||
Top = 88
|
||||
Width = 759
|
||||
Height = 294
|
||||
Anchors = [akLeft, akTop, akRight, akBottom]
|
||||
TabOrder = 2
|
||||
end
|
||||
object cbLinkThreadToQueue: TComboBox
|
||||
Left = 240
|
||||
Top = 44
|
||||
Width = 281
|
||||
Height = 24
|
||||
Style = csDropDownList
|
||||
ItemIndex = 0
|
||||
TabOrder = 3
|
||||
Text = #1040#1089#1089#1086#1094#1080#1080#1088#1086#1074#1072#1090#1100' '#1074#1099#1079#1086#1074' '#1089' '#1087#1086#1090#1086#1082#1086#1084' TThread'
|
||||
OnSelect = cbLinkThreadToQueueSelect
|
||||
Items.Strings = (
|
||||
#1040#1089#1089#1086#1094#1080#1080#1088#1086#1074#1072#1090#1100' '#1074#1099#1079#1086#1074' '#1089' '#1087#1086#1090#1086#1082#1086#1084' TThread'
|
||||
#1053#1077' '#1072#1089#1089#1086#1094#1080#1080#1088#1086#1074#1072#1090#1100' '#1074#1099#1079#1086#1074' '#1089' '#1087#1086#1090#1086#1082#1086#1084)
|
||||
end
|
||||
object btnClearListBox: TButton
|
||||
Left = 431
|
||||
Top = 8
|
||||
Width = 75
|
||||
Height = 33
|
||||
Caption = #1054#1095#1080#1089#1090#1080#1090#1100
|
||||
TabOrder = 4
|
||||
OnClick = btnClearListBoxClick
|
||||
end
|
||||
end
|
191
Ex12Full/Ex12FullUnit.pas
Normal file
191
Ex12Full/Ex12FullUnit.pas
Normal file
@ -0,0 +1,191 @@
|
||||
unit Ex12FullUnit;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, MTUtils, ComCtrls, ExtCtrls, StrUtils, Contnrs,
|
||||
Generics.Collections;
|
||||
|
||||
type
|
||||
TMyThread = class(TThread)
|
||||
private
|
||||
procedure LogEvent(EventText: string);
|
||||
procedure CallMyFuncInMainThread(param1: Integer; param2: string);
|
||||
protected
|
||||
procedure Execute; override;
|
||||
end;
|
||||
|
||||
TForm1 = class(TForm)
|
||||
btnRunInParallelThread: TButton;
|
||||
Button1: TButton;
|
||||
ListBox1: TListBox;
|
||||
labLabLastThreadTime: TLabel;
|
||||
Label1: TLabel;
|
||||
cbLinkThreadToQueue: TComboBox;
|
||||
btnClearListBox: TButton;
|
||||
procedure btnRunInParallelThreadClick(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure cbLinkThreadToQueueSelect(Sender: TObject);
|
||||
procedure btnClearListBoxClick(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
FList: TObjectList<TMyThread>;
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
LinkThreadToQueue: Boolean = True;
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TForm1.btnClearListBoxClick(Sender: TObject);
|
||||
begin
|
||||
ListBox1.Clear;
|
||||
end;
|
||||
|
||||
procedure TForm1.btnRunInParallelThreadClick(Sender: TObject);
|
||||
begin
|
||||
// Создаём и запускаем новый поток
|
||||
FList.Add(TMyThread.Create(False));
|
||||
end;
|
||||
|
||||
procedure TForm1.Button1Click(Sender: TObject);
|
||||
var
|
||||
t: TMyThread;
|
||||
begin
|
||||
for t in FList do
|
||||
t.Terminate; // Сообщаем потокам о необходимости завершаться
|
||||
FList.Clear; // Уничтожаем потоки
|
||||
end;
|
||||
|
||||
procedure TForm1.cbLinkThreadToQueueSelect(Sender: TObject);
|
||||
begin
|
||||
LinkThreadToQueue := cbLinkThreadToQueue.ItemIndex = 0;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
FList := TObjectList<TMyThread>.Create;
|
||||
ThreadWaitTimeoutSleepTime := 1;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
FList.Free;
|
||||
end;
|
||||
|
||||
{ TMyThread }
|
||||
|
||||
procedure TMyThread.CallMyFuncInMainThread(param1: Integer; param2: string);
|
||||
begin
|
||||
TThread.Queue(nil,
|
||||
procedure
|
||||
var
|
||||
s: string;
|
||||
begin
|
||||
s := Format('param1=%d; param2=%s', [param1, param2]);
|
||||
Form1.ListBox1.Items.Add(s);
|
||||
end);
|
||||
end;
|
||||
|
||||
procedure TMyThread.Execute;
|
||||
var
|
||||
I: Integer;
|
||||
CurTime: TDateTime;
|
||||
sVal: string;
|
||||
begin
|
||||
// Делаем низкий приоритет потоку, чтобы выделялим минимальные
|
||||
// кванты времени. Так быстрее проявляется проблема очистки
|
||||
// очереди при уничтожении потока
|
||||
Priority := tpLowest;
|
||||
|
||||
CurTime := Now; // Запоминаем время ДО вызова Queue
|
||||
Queue(
|
||||
procedure
|
||||
begin
|
||||
Form1.labLabLastThreadTime.Caption :=
|
||||
'Последний поток был запущен: ' + DateTimeToStr(CurTime);
|
||||
end);
|
||||
|
||||
|
||||
{I := 111;
|
||||
sVal := 'Text 1';
|
||||
CallMyFuncInMainThread(I, sVal);
|
||||
I := 222;
|
||||
sVal := 'Text 2';
|
||||
CallMyFuncInMainThread(I, sVal); }
|
||||
|
||||
|
||||
I := 111;
|
||||
sVal := 'Text 1';
|
||||
TThread.Queue(nil,
|
||||
procedure
|
||||
var
|
||||
s: string;
|
||||
begin
|
||||
s := Format('param1=%d; param2=%s', [I, sVal]);
|
||||
Form1.ListBox1.Items.Add(s);
|
||||
end);
|
||||
|
||||
I := 222;
|
||||
sVal := 'Text 2';
|
||||
TThread.Queue(nil,
|
||||
procedure
|
||||
var
|
||||
s: string;
|
||||
begin
|
||||
s := Format('param1=%d; param2=%s', [I, sVal]);
|
||||
Form1.ListBox1.Items.Add(s);
|
||||
end);
|
||||
|
||||
|
||||
LogEvent('Thread start');
|
||||
while not Terminated do
|
||||
begin
|
||||
Inc(I);
|
||||
LogEvent('Event #' + IntToStr(I));
|
||||
ThreadWaitTimeout(Self, 500);
|
||||
end;
|
||||
|
||||
LogEvent('Thread stop');
|
||||
for I := 1 to 100 do
|
||||
begin
|
||||
LogEvent('Thread stop' + I.ToString);
|
||||
Sleep(0); // Делаем активным другой поток
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMyThread.LogEvent(EventText: string);
|
||||
var
|
||||
ThreadId: Cardinal;
|
||||
EventTime: TDateTime;
|
||||
ThreadRef: TMyThread;
|
||||
begin
|
||||
// Запоминаем ID потока и текущее время ДО вызова Queue
|
||||
ThreadId := GetCurrentThreadId;
|
||||
EventTime := Now;
|
||||
|
||||
if LinkThreadToQueue then
|
||||
ThreadRef := Self
|
||||
else
|
||||
ThreadRef := nil;
|
||||
|
||||
TThread.Queue(ThreadRef,
|
||||
procedure
|
||||
begin
|
||||
Form1.ListBox1.Items.Add(Format('%s [T:%d] - %s',
|
||||
[FormatDateTime('hh:nn:ss.zzz', EventTime), ThreadId, EventText]));
|
||||
Form1.ListBox1.ItemIndex := Form1.ListBox1.Count - 1;
|
||||
|
||||
// Подвешиваем основной поток
|
||||
Sleep(5);
|
||||
end);
|
||||
end;
|
||||
|
||||
end.
|
@ -2,7 +2,8 @@ program Ex4Proj;
|
||||
|
||||
uses
|
||||
Forms,
|
||||
Ex4Unit in 'Ex4Unit.pas' {Form1};
|
||||
Ex4Unit in 'Ex4Unit.pas' {Form1},
|
||||
ProgressViewer in '..\CommonUtils\ProgressViewer.pas';
|
||||
|
||||
{$R *.res}
|
||||
|
||||
|
@ -22,51 +22,16 @@
|
||||
<Borland.Personality>Delphi.Personality</Borland.Personality>
|
||||
<Borland.ProjectType>VCLApplication</Borland.ProjectType>
|
||||
<BorlandProject>
|
||||
<BorlandProject xmlns=""> <Delphi.Personality> <Parameters>
|
||||
<Parameters Name="UseLauncher">False</Parameters>
|
||||
<Parameters Name="LoadAllSymbols">True</Parameters>
|
||||
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
|
||||
</Parameters>
|
||||
<VersionInfo>
|
||||
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||
<VersionInfo Name="Release">0</VersionInfo>
|
||||
<VersionInfo Name="Build">0</VersionInfo>
|
||||
<VersionInfo Name="Debug">False</VersionInfo>
|
||||
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||
<VersionInfo Name="Special">False</VersionInfo>
|
||||
<VersionInfo Name="Private">False</VersionInfo>
|
||||
<VersionInfo Name="DLL">False</VersionInfo>
|
||||
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||
</VersionInfo>
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileDescription"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||
</VersionInfoKeys>
|
||||
<Source>
|
||||
<Source Name="MainSource">Ex4Proj.dpr</Source>
|
||||
</Source>
|
||||
</Delphi.Personality> </BorlandProject></BorlandProject>
|
||||
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><VersionInfo><VersionInfo Name="IncludeVerInfo">False</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1049</VersionInfo><VersionInfo Name="CodePage">1251</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Source><Source Name="MainSource">Ex4Proj.dpr</Source></Source></Delphi.Personality></BorlandProject></BorlandProject>
|
||||
</ProjectExtensions>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
|
||||
<ItemGroup>
|
||||
<DelphiCompile Include="Ex4Proj.dpr">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="..\CommonUtils\ProgressViewer.pas" />
|
||||
<DCCReference Include="Ex4Unit.pas">
|
||||
<Form>Form1</Form>
|
||||
</DCCReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
|
||||
</Project>
|
@ -4,7 +4,8 @@ uses
|
||||
Forms,
|
||||
Ex5Unit in 'Ex5Unit.pas' {Form1},
|
||||
MTUtils in '..\CommonUtils\MTUtils.pas',
|
||||
TimeIntervals in '..\CommonUtils\TimeIntervals.pas';
|
||||
TimeIntervals in '..\CommonUtils\TimeIntervals.pas',
|
||||
ProgressViewer in '..\CommonUtils\ProgressViewer.pas';
|
||||
|
||||
{$R *.res}
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="..\CommonUtils\MTUtils.pas" />
|
||||
<DCCReference Include="..\CommonUtils\ProgressViewer.pas" />
|
||||
<DCCReference Include="..\CommonUtils\TimeIntervals.pas" />
|
||||
<DCCReference Include="Ex5Unit.pas">
|
||||
<Form>Form1</Form>
|
||||
|
@ -3,7 +3,8 @@ program Ex7Proj;
|
||||
uses
|
||||
Forms,
|
||||
Ex7Unit in 'Ex7Unit.pas' {Form1},
|
||||
MTUtils in '..\CommonUtils\MTUtils.pas';
|
||||
MTUtils in '..\CommonUtils\MTUtils.pas',
|
||||
TimeIntervals in '..\CommonUtils\TimeIntervals.pas';
|
||||
|
||||
{$R *.res}
|
||||
|
||||
|
@ -22,52 +22,17 @@
|
||||
<Borland.Personality>Delphi.Personality</Borland.Personality>
|
||||
<Borland.ProjectType>VCLApplication</Borland.ProjectType>
|
||||
<BorlandProject>
|
||||
<BorlandProject xmlns=""> <Delphi.Personality> <Parameters>
|
||||
<Parameters Name="UseLauncher">False</Parameters>
|
||||
<Parameters Name="LoadAllSymbols">True</Parameters>
|
||||
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
|
||||
</Parameters>
|
||||
<VersionInfo>
|
||||
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||
<VersionInfo Name="Release">0</VersionInfo>
|
||||
<VersionInfo Name="Build">0</VersionInfo>
|
||||
<VersionInfo Name="Debug">False</VersionInfo>
|
||||
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||
<VersionInfo Name="Special">False</VersionInfo>
|
||||
<VersionInfo Name="Private">False</VersionInfo>
|
||||
<VersionInfo Name="DLL">False</VersionInfo>
|
||||
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||
</VersionInfo>
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileDescription"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductName"></VersionInfoKeys>
|
||||
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||
</VersionInfoKeys>
|
||||
<Source>
|
||||
<Source Name="MainSource">Ex7Proj.dpr</Source>
|
||||
</Source>
|
||||
</Delphi.Personality> </BorlandProject></BorlandProject>
|
||||
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><VersionInfo><VersionInfo Name="IncludeVerInfo">False</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1049</VersionInfo><VersionInfo Name="CodePage">1251</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Source><Source Name="MainSource">Ex7Proj.dpr</Source></Source></Delphi.Personality></BorlandProject></BorlandProject>
|
||||
</ProjectExtensions>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
|
||||
<ItemGroup>
|
||||
<DelphiCompile Include="Ex7Proj.dpr">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="..\CommonUtils\MTUtils.pas" />
|
||||
<DCCReference Include="..\CommonUtils\TimeIntervals.pas" />
|
||||
<DCCReference Include="Ex7Unit.pas">
|
||||
<Form>Form1</Form>
|
||||
</DCCReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
|
||||
</Project>
|
Loading…
x
Reference in New Issue
Block a user