Skip to content

Commit

Permalink
Cleaned up rename to DelphiVCL
Browse files Browse the repository at this point in the history
added some comments about proper naming
  • Loading branch information
JimMcKeeth committed Oct 20, 2020
1 parent 69e6d14 commit b570aef
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
15 changes: 4 additions & 11 deletions Modules/DelphiVCL/DelphiVCL.dpr
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
library Delphi;

{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
library DelphiVCL;

uses
SysUtils,
Expand All @@ -18,6 +8,9 @@ uses
{$I Definition.Inc}

exports
// This must match the pattern "PyInit_[ProjectName]"
// So if the project is named DelphiVCL then
// the export must be PyInit_DelphiVCL
PyInit_DelphiVCL;
{$IFDEF MSWINDOWS}
{$E pyd}
Expand Down
10 changes: 5 additions & 5 deletions Modules/DelphiVCL/DelphiVCL.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<AppType>Library</AppType>
<Config Condition="'$(Config)'==''">Release</Config>
<FrameworkType>None</FrameworkType>
<MainSource>Delphi.dpr</MainSource>
<MainSource>DelphiVCL.dpr</MainSource>
<Platform Condition="'$(Platform)'==''">Win64</Platform>
<ProjectGuid>{7E56095C-46B8-4F28-87A2-EEA8D9D2448D}</ProjectGuid>
<ProjectVersion>19.1</ProjectVersion>
Expand Down Expand Up @@ -40,7 +40,7 @@
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<SanitizedProjectName>Delphi</SanitizedProjectName>
<SanitizedProjectName>DelphiVCL</SanitizedProjectName>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace)</DCC_Namespace>
<GenDll>true</GenDll>
Expand Down Expand Up @@ -92,7 +92,7 @@
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">Delphi.dpr</Source>
<Source Name="MainSource">DelphiVCL.dpr</Source>
</Source>
<Excluded_Packages/>
</Delphi.Personality>
Expand All @@ -112,9 +112,9 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Delphi.dll" Configuration="Release" Class="ProjectOutput">
<DeployFile LocalName="DelphiVCL.dll" Configuration="Release" Class="ProjectOutput">
<Platform Name="Win64">
<RemoteName>Delphi.dll</RemoteName>
<RemoteName>DelphiVCL.dll</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
Expand Down
6 changes: 5 additions & 1 deletion Modules/DelphiVCL/uMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,22 @@ implementation
gModule : TPythonModule;
gDelphiWrapper : TPyDelphiWrapper;

// This must match the pattern "PyInit_[ProjectName]"
// So if the project is named DelphiVCL then
// the function must be PyInit_DelphiVCL
function PyInit_DelphiVCL: PPyObject;
begin
try
gEngine := TPythonEngine.Create(nil);
gEngine.AutoFinalize := False;
gEngine.UseLastKnownVersion := False;
// Adapt to the desired python version
// Adapt to the desired python version - Will only work with this version
gEngine.RegVersion := '3.9';
gEngine.DllName := 'python39.dll';

gModule := TPythonModule.Create(nil);
gModule.Engine := gEngine;
// This must match the ProjectName and the function name pattern
gModule.ModuleName := 'DelphiVCL';

gDelphiWrapper := TPyDelphiWrapper.Create(nil);
Expand Down

0 comments on commit b570aef

Please sign in to comment.