/trunk/DLL Usage Demo/Delphi/CurConvDLLDemo.bdsproj |
---|
0,0 → 1,175 |
<?xml version="1.0" encoding="utf-8"?> |
<BorlandProject> |
<PersonalityInfo> |
<Option> |
<Option Name="Personality">Delphi.Personality</Option> |
<Option Name="ProjectType"></Option> |
<Option Name="Version">1.0</Option> |
<Option Name="GUID">{EF0A4978-FCC9-4307-B0F2-6CC5681592B8}</Option> |
</Option> |
</PersonalityInfo> |
<Delphi.Personality> |
<Source> |
<Source Name="MainSource">CurConvDLLDemo.dpr</Source> |
</Source> |
<FileVersion> |
<FileVersion Name="Version">7.0</FileVersion> |
</FileVersion> |
<Compiler> |
<Compiler Name="A">8</Compiler> |
<Compiler Name="B">0</Compiler> |
<Compiler Name="C">1</Compiler> |
<Compiler Name="D">1</Compiler> |
<Compiler Name="E">0</Compiler> |
<Compiler Name="F">0</Compiler> |
<Compiler Name="G">1</Compiler> |
<Compiler Name="H">1</Compiler> |
<Compiler Name="I">1</Compiler> |
<Compiler Name="J">0</Compiler> |
<Compiler Name="K">0</Compiler> |
<Compiler Name="L">1</Compiler> |
<Compiler Name="M">0</Compiler> |
<Compiler Name="N">1</Compiler> |
<Compiler Name="O">1</Compiler> |
<Compiler Name="P">1</Compiler> |
<Compiler Name="Q">0</Compiler> |
<Compiler Name="R">0</Compiler> |
<Compiler Name="S">0</Compiler> |
<Compiler Name="T">0</Compiler> |
<Compiler Name="U">0</Compiler> |
<Compiler Name="V">1</Compiler> |
<Compiler Name="W">0</Compiler> |
<Compiler Name="X">1</Compiler> |
<Compiler Name="Y">1</Compiler> |
<Compiler Name="Z">1</Compiler> |
<Compiler Name="ShowHints">True</Compiler> |
<Compiler Name="ShowWarnings">True</Compiler> |
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler> |
<Compiler Name="NamespacePrefix"></Compiler> |
<Compiler Name="GenerateDocumentation">False</Compiler> |
<Compiler Name="DefaultNamespace"></Compiler> |
<Compiler Name="SymbolDeprecated">True</Compiler> |
<Compiler Name="SymbolLibrary">True</Compiler> |
<Compiler Name="SymbolPlatform">True</Compiler> |
<Compiler Name="SymbolExperimental">True</Compiler> |
<Compiler Name="UnitLibrary">True</Compiler> |
<Compiler Name="UnitPlatform">True</Compiler> |
<Compiler Name="UnitDeprecated">True</Compiler> |
<Compiler Name="UnitExperimental">True</Compiler> |
<Compiler Name="HResultCompat">True</Compiler> |
<Compiler Name="HidingMember">True</Compiler> |
<Compiler Name="HiddenVirtual">True</Compiler> |
<Compiler Name="Garbage">True</Compiler> |
<Compiler Name="BoundsError">True</Compiler> |
<Compiler Name="ZeroNilCompat">True</Compiler> |
<Compiler Name="StringConstTruncated">True</Compiler> |
<Compiler Name="ForLoopVarVarPar">True</Compiler> |
<Compiler Name="TypedConstVarPar">True</Compiler> |
<Compiler Name="AsgToTypedConst">True</Compiler> |
<Compiler Name="CaseLabelRange">True</Compiler> |
<Compiler Name="ForVariable">True</Compiler> |
<Compiler Name="ConstructingAbstract">True</Compiler> |
<Compiler Name="ComparisonFalse">True</Compiler> |
<Compiler Name="ComparisonTrue">True</Compiler> |
<Compiler Name="ComparingSignedUnsigned">True</Compiler> |
<Compiler Name="CombiningSignedUnsigned">True</Compiler> |
<Compiler Name="UnsupportedConstruct">True</Compiler> |
<Compiler Name="FileOpen">True</Compiler> |
<Compiler Name="FileOpenUnitSrc">True</Compiler> |
<Compiler Name="BadGlobalSymbol">True</Compiler> |
<Compiler Name="DuplicateConstructorDestructor">True</Compiler> |
<Compiler Name="InvalidDirective">True</Compiler> |
<Compiler Name="PackageNoLink">True</Compiler> |
<Compiler Name="PackageThreadVar">True</Compiler> |
<Compiler Name="ImplicitImport">True</Compiler> |
<Compiler Name="HPPEMITIgnored">True</Compiler> |
<Compiler Name="NoRetVal">True</Compiler> |
<Compiler Name="UseBeforeDef">True</Compiler> |
<Compiler Name="ForLoopVarUndef">True</Compiler> |
<Compiler Name="UnitNameMismatch">True</Compiler> |
<Compiler Name="NoCFGFileFound">True</Compiler> |
<Compiler Name="ImplicitVariants">True</Compiler> |
<Compiler Name="UnicodeToLocale">True</Compiler> |
<Compiler Name="LocaleToUnicode">True</Compiler> |
<Compiler Name="ImagebaseMultiple">True</Compiler> |
<Compiler Name="SuspiciousTypecast">True</Compiler> |
<Compiler Name="PrivatePropAccessor">True</Compiler> |
<Compiler Name="UnsafeType">False</Compiler> |
<Compiler Name="UnsafeCode">False</Compiler> |
<Compiler Name="UnsafeCast">False</Compiler> |
<Compiler Name="OptionTruncated">True</Compiler> |
<Compiler Name="WideCharReduced">True</Compiler> |
<Compiler Name="DuplicatesIgnored">True</Compiler> |
<Compiler Name="UnitInitSeq">True</Compiler> |
<Compiler Name="LocalPInvoke">True</Compiler> |
<Compiler Name="MessageDirective">True</Compiler> |
<Compiler Name="CodePage"></Compiler> |
</Compiler> |
<Linker> |
<Linker Name="MapFile">0</Linker> |
<Linker Name="OutputObjs">0</Linker> |
<Linker Name="GenerateHpps">False</Linker> |
<Linker Name="ConsoleApp">1</Linker> |
<Linker Name="DebugInfo">False</Linker> |
<Linker Name="RemoteSymbols">False</Linker> |
<Linker Name="GenerateDRC">False</Linker> |
<Linker Name="MinStackSize">16384</Linker> |
<Linker Name="MaxStackSize">1048576</Linker> |
<Linker Name="ImageBase">4194304</Linker> |
<Linker Name="ExeDescription"></Linker> |
</Linker> |
<Directories> |
<Directories Name="OutputDir">e:\_test</Directories> |
<Directories Name="UnitOutputDir"></Directories> |
<Directories Name="PackageDLLOutputDir"></Directories> |
<Directories Name="PackageDCPOutputDir"></Directories> |
<Directories Name="SearchPath"></Directories> |
<Directories Name="Packages"></Directories> |
<Directories Name="Conditionals"></Directories> |
<Directories Name="DebugSourceDirs"></Directories> |
<Directories Name="UsePackages">False</Directories> |
</Directories> |
<Parameters> |
<Parameters Name="RunParams"></Parameters> |
<Parameters Name="HostApplication"></Parameters> |
<Parameters Name="Launcher"></Parameters> |
<Parameters Name="UseLauncher">False</Parameters> |
<Parameters Name="DebugCWD"></Parameters> |
<Parameters Name="Debug Symbols Search Path"></Parameters> |
<Parameters Name="LoadAllSymbols">True</Parameters> |
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters> |
</Parameters> |
<Language> |
<Language Name="ActiveLang"></Language> |
<Language Name="ProjectLang">$00000000</Language> |
<Language Name="RootDir"></Language> |
</Language> |
<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">1031</VersionInfo> |
<VersionInfo Name="CodePage">1252</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> |
</Delphi.Personality> |
</BorlandProject> |
/trunk/DLL Usage Demo/Delphi/CurConvDLLDemo.cfg |
---|
0,0 → 1,39 |
-$A8 |
-$B- |
-$C+ |
-$D+ |
-$E- |
-$F- |
-$G+ |
-$H+ |
-$I+ |
-$J- |
-$K- |
-$L+ |
-$M- |
-$N+ |
-$O+ |
-$P+ |
-$Q- |
-$R- |
-$S- |
-$T- |
-$U- |
-$V+ |
-$W- |
-$X+ |
-$YD |
-$Z1 |
-cg |
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; |
-H+ |
-W+ |
-M |
-$M16384,1048576 |
-K$00400000 |
-E"e:\_test" |
-LE"C:\Users\DELL User\Documents\Borland Studio-Projekte\Bpl" |
-LN"C:\Users\DELL User\Documents\Borland Studio-Projekte\Bpl" |
-w-UNSAFE_TYPE |
-w-UNSAFE_CODE |
-w-UNSAFE_CAST |
/trunk/DLL Usage Demo/Delphi/CurConvDLLDemo.dpr |
---|
0,0 → 1,15 |
program CurConvDLLDemo; |
uses |
Forms, |
Demo in 'Demo.pas' {Form1}, |
VtsCurConvDLLHeader in 'VtsCurConvDLLHeader.pas'; |
{$R *.res} |
begin |
ReportMemoryLeaksOnShutdown := true; |
Application.Initialize; |
Application.CreateForm(TForm1, Form1); |
Application.Run; |
end. |
/trunk/DLL Usage Demo/Delphi/CurConvDLLDemo.dproj |
---|
0,0 → 1,125 |
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<PropertyGroup> |
<ProjectGuid>{EF0A4978-FCC9-4307-B0F2-6CC5681592B8}</ProjectGuid> |
<MainSource>CurConvDLLDemo.dpr</MainSource> |
<Base>True</Base> |
<Config Condition="'$(Config)'==''">Debug</Config> |
<TargetedPlatforms>1</TargetedPlatforms> |
<AppType>Application</AppType> |
<FrameworkType>VCL</FrameworkType> |
<ProjectVersion>18.2</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="'$(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_DebugInformation>1</DCC_DebugInformation> |
<DCC_E>false</DCC_E> |
<DCC_F>false</DCC_F> |
<DCC_K>false</DCC_K> |
<DCC_N>true</DCC_N> |
<DCC_S>false</DCC_S> |
<DCC_SymbolReferenceInfo>1</DCC_SymbolReferenceInfo> |
<DCC_ImageBase>00400000</DCC_ImageBase> |
<DCC_ExeOutput>e:\_test</DCC_ExeOutput> |
<SanitizedProjectName>CurConvDLLDemo</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>1031</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> |
<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>CurConvDLLDemo_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> |
<AppEnableHighDPI>true</AppEnableHighDPI> |
</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> |
<AppEnableHighDPI>true</AppEnableHighDPI> |
</PropertyGroup> |
<ItemGroup> |
<DelphiCompile Include="$(MainSource)"> |
<MainSource>MainSource</MainSource> |
</DelphiCompile> |
<DCCReference Include="Demo.pas"> |
<Form>Form1</Form> |
</DCCReference> |
<DCCReference Include="VtsCurConvDLLHeader.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">CurConvDLLDemo.dpr</Source> |
</Source> |
</Delphi.Personality> |
<Platforms> |
<Platform value="Win32">True</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> |
/trunk/DLL Usage Demo/Delphi/CurConvDLLDemo.res |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/DLL Usage Demo/Delphi/CurConvDLLDemo_Icon.ico |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/DLL Usage Demo/Delphi/CurConvDemo.cfg |
---|
0,0 → 1,38 |
-$A8 |
-$B- |
-$C+ |
-$D+ |
-$E- |
-$F- |
-$G+ |
-$H+ |
-$I+ |
-$J- |
-$K- |
-$L+ |
-$M- |
-$N+ |
-$O+ |
-$P+ |
-$Q- |
-$R- |
-$S- |
-$T- |
-$U- |
-$V+ |
-$W- |
-$X+ |
-$YD |
-$Z1 |
-cg |
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; |
-H+ |
-W+ |
-M |
-$M16384,1048576 |
-K$00400000 |
-LE"C:\Users\DELL User\Documents\Borland Studio-Projekte\Bpl" |
-LN"C:\Users\DELL User\Documents\Borland Studio-Projekte\Bpl" |
-w-UNSAFE_TYPE |
-w-UNSAFE_CODE |
-w-UNSAFE_CAST |
/trunk/DLL Usage Demo/Delphi/Demo.dfm |
---|
0,0 → 1,94 |
object Form1: TForm1 |
Left = 0 |
Top = 0 |
BorderIcons = [biSystemMenu, biMinimize] |
BorderStyle = bsSingle |
Caption = 'Currency converter' |
ClientHeight = 114 |
ClientWidth = 381 |
Color = clBtnFace |
Font.Charset = DEFAULT_CHARSET |
Font.Color = clWindowText |
Font.Height = -11 |
Font.Name = 'Tahoma' |
Font.Style = [] |
KeyPreview = True |
OldCreateOrder = False |
Position = poScreenCenter |
OnKeyUp = FormKeyUp |
OnShow = FormShow |
PixelsPerInch = 96 |
TextHeight = 13 |
object Label1: TLabel |
Left = 184 |
Top = 23 |
Width = 11 |
Height = 18 |
Caption = '=' |
Font.Charset = DEFAULT_CHARSET |
Font.Color = clWindowText |
Font.Height = -15 |
Font.Name = 'Tahoma' |
Font.Style = [] |
ParentFont = False |
end |
object ComboBox1: TComboBox |
Left = 111 |
Top = 24 |
Width = 58 |
Height = 21 |
Style = csDropDownList |
TabOrder = 1 |
OnChange = Recalc |
end |
object ComboBox2: TComboBox |
Left = 303 |
Top = 24 |
Width = 58 |
Height = 21 |
Style = csDropDownList |
TabOrder = 3 |
OnChange = Recalc |
end |
object Edit1: TEdit |
Left = 24 |
Top = 24 |
Width = 81 |
Height = 21 |
TabOrder = 0 |
Text = 'Edit1' |
OnChange = Recalc |
end |
object Edit2: TEdit |
Left = 216 |
Top = 24 |
Width = 81 |
Height = 21 |
TabStop = False |
Color = clBtnFace |
ReadOnly = True |
TabOrder = 2 |
Text = 'Edit1' |
end |
object CheckBox1: TCheckBox |
Left = 24 |
Top = 80 |
Width = 89 |
Height = 17 |
TabStop = False |
Caption = 'Historic date:' |
TabOrder = 5 |
OnClick = Recalc |
end |
object DateTimePicker1: TDateTimePicker |
Left = 119 |
Top = 76 |
Width = 97 |
Height = 21 |
Date = 42973.608142604160000000 |
Time = 42973.608142604160000000 |
TabOrder = 4 |
TabStop = False |
OnChange = Recalc |
end |
end |
/trunk/DLL Usage Demo/Delphi/Demo.pas |
---|
0,0 → 1,108 |
unit Demo; |
interface |
uses |
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, |
Dialogs, StdCtrls, ComCtrls; |
type |
TForm1 = class(TForm) |
ComboBox1: TComboBox; |
ComboBox2: TComboBox; |
Edit1: TEdit; |
Edit2: TEdit; |
Label1: TLabel; |
DateTimePicker1: TDateTimePicker; |
CheckBox1: TCheckBox; |
procedure FormShow(Sender: TObject); |
procedure Recalc(Sender: TObject); |
procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); |
private |
Initialized: boolean; |
procedure FillComboboxes; |
function HistoricDate: TDate; |
end; |
var |
Form1: TForm1; |
implementation |
{$R *.dfm} |
uses |
Math, VtsCurConvDLLHeader; |
const |
MaxAge = 1*60*60; |
Flags = CONVERT_FALLBACK_TO_CACHE; |
procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); |
var |
tmp: integer; |
begin |
if Key = VK_F5 then |
begin |
tmp := ComboBox1.ItemIndex; |
ComboBox1.ItemIndex := ComboBox2.ItemIndex; |
ComboBox2.ItemIndex := tmp; |
Recalc(Sender); |
end; |
end; |
procedure TForm1.FormShow(Sender: TObject); |
begin |
FillComboboxes; |
ComboBox1.ItemIndex := Max(0, ComboBox1.Items.IndexOf('USD')); |
ComboBox2.ItemIndex := Max(0, ComboBox2.Items.IndexOf('EUR')); |
Edit1.Text := ''; |
Edit2.Text := ''; |
Edit1.SetFocus; |
Edit1.Text := '1'; |
Edit1.SelectAll; |
Initialized := true; |
Recalc(Sender); |
end; |
function TForm1.HistoricDate: TDate; |
begin |
if CheckBox1.Checked then |
result := DateTimePicker1.Date |
else |
result := 0; |
end; |
procedure TForm1.Recalc(Sender: TObject); |
var |
s: string; |
d: double; |
begin |
if not Initialized then exit; |
s := Edit1.Text; |
if TryStrToFloat(s, d) and (ComboBox1.Text <> '') and (ComboBox2.Text <> '') then |
Edit2.Text := Format('%.2f', [Convert(d, PChar(ComboBox1.Text), PChar(ComboBox2.Text), MaxAge, Flags, HistoricDate)]) |
else |
Edit2.Text := ''; |
end; |
procedure TForm1.FillComboboxes; |
var |
num: integer; |
s: string; |
i: integer; |
begin |
num := AcceptedCurrencies(nil, MaxAge, Flags, HistoricDate); |
SetLength(s, 3*num+1); |
num := AcceptedCurrencies(PChar(s), MaxAge, Flags, HistoricDate); |
ComboBox1.Clear; |
ComboBox2.Clear; |
for i := 0 to num - 1 do |
begin |
ComboBox1.Items.Add(Copy(s, i*3+1, 3)); |
ComboBox2.Items.Add(Copy(s, i*3+1, 3)); |
end; |
end; |
end. |
/trunk/DLL Usage Demo/Delphi/VtsCurConvDLLHeader.pas |
---|
0,0 → 1,91 |
unit VtsCurConvDLLHeader; |
interface |
uses |
Windows, Controls; |
type |
TVtsCurConvFlags = type DWORD; |
const |
CONVERT_DONT_SHOW_ERRORS {:TVtsCurConvFlags} = 1; |
CONVERT_FALLBACK_TO_CACHE {:TVtsCurConvFlags} = 2; |
CONVERT_USE_SSL {:TVtsCurConvFlags} = 4; |
CONVERT_CONFIRM_WEB_ACCESS {:TVtsCurConvFlags} = 8; |
CONVERT_NO_INTERACTIVE_API_KEY_INPUT {:TVtsCurConvFlags} = 16; |
const |
S_VTSCONV_OK: HRESULT = $20000000; // Success, Customer defined, Facility 0, Code 0 |
S_VTSCONV_NOTHING: HRESULT = $20000001; // Success, Customer defined, Facility 0, Code 1 |
E_VTSCONV_GENERIC_FAILURE: HRESULT = $A0000000; // Failure, Customer defined, Facility 0, Code 0 |
E_VTSCONV_BAD_ARGS: HRESULT = $A0000001; // Failure, Customer defined, Facility 0, Code 1 |
function DeleteAPIKey(UserMode: BOOL; DontShowErrors: BOOL): HRESULT; stdcall; |
function WriteAPIKey(key: LPCTSTR; UserMode: BOOL; DontShowErrors: BOOL): HRESULT; stdcall; |
function WriteAPIKeyW(key: LPCWSTR; UserMode: BOOL; DontShowErrors: BOOL): HRESULT; stdcall; |
function WriteAPIKeyA(key: LPCSTR; UserMode: BOOL; DontShowErrors: BOOL): HRESULT; stdcall; |
function ReadAPIKey(key: LPTSTR; DontShowErrors: BOOL): HRESULT; stdcall; |
function ReadAPIKeyW(key: LPWSTR; DontShowErrors: BOOL): HRESULT; stdcall; |
function ReadAPIKeyA(key: LPSTR; DontShowErrors: BOOL): HRESULT; stdcall; |
function Convert(Value: Double; CurFrom, CurTo: LPCTSTR; MaxAge: integer; |
Flags: TVtsCurConvFlags; HistoricDate: TDate): Double; stdcall; |
function ConvertW(Value: Double; CurFrom, CurTo: LPCWSTR; MaxAge: integer; |
Flags: TVtsCurConvFlags; HistoricDate: TDate): Double; stdcall; |
function ConvertA(Value: Double; CurFrom, CurTo: LPCSTR; MaxAge: integer; |
Flags: TVtsCurConvFlags; HistoricDate: TDate): Double; stdcall; |
function AcceptedCurrencies(WriteTo: LPTSTR; MaxAge: integer; Flags: TVtsCurConvFlags; |
HistoricDate: TDate): Integer; stdcall; |
function AcceptedCurrenciesW(WriteTo: LPWSTR; MaxAge: integer; Flags: TVtsCurConvFlags; |
HistoricDate: TDate): Integer; stdcall; |
function AcceptedCurrenciesA(WriteTo: LPSTR; MaxAge: integer; Flags: TVtsCurConvFlags; |
HistoricDate: TDate): Integer; stdcall; |
function DownloadNow(Flags: TVtsCurConvFlags; HistoricDate: TDate): HRESULT; stdcall; |
implementation |
const |
curConvDLL = 'CurConv.dll'; |
function DeleteAPIKey; external curConvDLL name 'DeleteAPIKey'; |
{$IFDEF UNICODE} |
function WriteAPIKey; external curConvDLL name 'WriteAPIKeyW'; |
{$ELSE} |
function WriteAPIKey; external curConvDLL name 'WriteAPIKeyA'; |
{$ENDIF} |
function WriteAPIKeyW; external curConvDLL name 'WriteAPIKeyW'; |
function WriteAPIKeyA; external curConvDLL name 'WriteAPIKeyA'; |
{$IFDEF UNICODE} |
function ReadAPIKey; external curConvDLL name 'ReadAPIKeyW'; |
{$ELSE} |
function ReadAPIKey; external curConvDLL name 'ReadAPIKeyA'; |
{$ENDIF} |
function ReadAPIKeyW; external curConvDLL name 'ReadAPIKeyW'; |
function ReadAPIKeyA; external curConvDLL name 'ReadAPIKeyA'; |
{$IFDEF UNICODE} |
function Convert; external curConvDLL name 'ConvertW'; |
{$ELSE} |
function Convert; external curConvDLL name 'ConvertA'; |
{$ENDIF} |
function ConvertW; external curConvDLL name 'ConvertW'; |
function ConvertA; external curConvDLL name 'ConvertA'; |
{$IFDEF UNICODE} |
function AcceptedCurrencies; external curConvDLL name 'AcceptedCurrenciesW'; |
{$ELSE} |
function AcceptedCurrencies; external curConvDLL name 'AcceptedCurrenciesA'; |
{$ENDIF} |
function AcceptedCurrenciesW; external curConvDLL name 'AcceptedCurrenciesW'; |
function AcceptedCurrenciesA; external curConvDLL name 'AcceptedCurrenciesA'; |
function DownloadNow; external curConvDLL name 'DownloadNow'; |
end. |