Skip to content

Commit b570aef

Browse files
author
JimMcKeeth
committed
Cleaned up rename to DelphiVCL
added some comments about proper naming
1 parent 69e6d14 commit b570aef

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

Modules/DelphiVCL/DelphiVCL.dpr

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
library Delphi;
2-
3-
{ Important note about DLL memory management: ShareMem must be the
4-
first unit in your library's USES clause AND your project's (select
5-
Project-View Source) USES clause if your DLL exports any procedures or
6-
functions that pass strings as parameters or function results. This
7-
applies to all strings passed to and from your DLL--even those that
8-
are nested in records and classes. ShareMem is the interface unit to
9-
the BORLNDMM.DLL shared memory manager, which must be deployed along
10-
with your DLL. To avoid using BORLNDMM.DLL, pass string information
11-
using PChar or ShortString parameters. }
1+
library DelphiVCL;
122

133
uses
144
SysUtils,
@@ -18,6 +8,9 @@ uses
188
{$I Definition.Inc}
199

2010
exports
11+
// This must match the pattern "PyInit_[ProjectName]"
12+
// So if the project is named DelphiVCL then
13+
// the export must be PyInit_DelphiVCL
2114
PyInit_DelphiVCL;
2215
{$IFDEF MSWINDOWS}
2316
{$E pyd}

Modules/DelphiVCL/DelphiVCL.dproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AppType>Library</AppType>
55
<Config Condition="'$(Config)'==''">Release</Config>
66
<FrameworkType>None</FrameworkType>
7-
<MainSource>Delphi.dpr</MainSource>
7+
<MainSource>DelphiVCL.dpr</MainSource>
88
<Platform Condition="'$(Platform)'==''">Win64</Platform>
99
<ProjectGuid>{7E56095C-46B8-4F28-87A2-EEA8D9D2448D}</ProjectGuid>
1010
<ProjectVersion>19.1</ProjectVersion>
@@ -40,7 +40,7 @@
4040
<Base>true</Base>
4141
</PropertyGroup>
4242
<PropertyGroup Condition="'$(Base)'!=''">
43-
<SanitizedProjectName>Delphi</SanitizedProjectName>
43+
<SanitizedProjectName>DelphiVCL</SanitizedProjectName>
4444
<DCC_ImageBase>00400000</DCC_ImageBase>
4545
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace)</DCC_Namespace>
4646
<GenDll>true</GenDll>
@@ -92,7 +92,7 @@
9292
<BorlandProject>
9393
<Delphi.Personality>
9494
<Source>
95-
<Source Name="MainSource">Delphi.dpr</Source>
95+
<Source Name="MainSource">DelphiVCL.dpr</Source>
9696
</Source>
9797
<Excluded_Packages/>
9898
</Delphi.Personality>
@@ -112,9 +112,9 @@
112112
<Overwrite>true</Overwrite>
113113
</Platform>
114114
</DeployFile>
115-
<DeployFile LocalName="Delphi.dll" Configuration="Release" Class="ProjectOutput">
115+
<DeployFile LocalName="DelphiVCL.dll" Configuration="Release" Class="ProjectOutput">
116116
<Platform Name="Win64">
117-
<RemoteName>Delphi.dll</RemoteName>
117+
<RemoteName>DelphiVCL.dll</RemoteName>
118118
<Overwrite>true</Overwrite>
119119
</Platform>
120120
</DeployFile>

Modules/DelphiVCL/uMain.pas

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,22 @@ implementation
1515
gModule : TPythonModule;
1616
gDelphiWrapper : TPyDelphiWrapper;
1717

18+
// This must match the pattern "PyInit_[ProjectName]"
19+
// So if the project is named DelphiVCL then
20+
// the function must be PyInit_DelphiVCL
1821
function PyInit_DelphiVCL: PPyObject;
1922
begin
2023
try
2124
gEngine := TPythonEngine.Create(nil);
2225
gEngine.AutoFinalize := False;
2326
gEngine.UseLastKnownVersion := False;
24-
// Adapt to the desired python version
27+
// Adapt to the desired python version - Will only work with this version
2528
gEngine.RegVersion := '3.9';
2629
gEngine.DllName := 'python39.dll';
2730

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

3236
gDelphiWrapper := TPyDelphiWrapper.Create(nil);

0 commit comments

Comments
 (0)