File tree Expand file tree Collapse file tree 3 files changed +14
-17
lines changed Expand file tree Collapse file tree 3 files changed +14
-17
lines changed Original file line number Diff line number Diff line change 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;
12
2
13
3
uses
14
4
SysUtils,
18
8
{ $I Definition.Inc}
19
9
20
10
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
21
14
PyInit_DelphiVCL;
22
15
{ $IFDEF MSWINDOWS}
23
16
{ $E pyd}
Original file line number Diff line number Diff line change 4
4
<AppType>Library</AppType>
5
5
<Config Condition="'$(Config)'==''">Release</Config>
6
6
<FrameworkType>None</FrameworkType>
7
- <MainSource>Delphi .dpr</MainSource>
7
+ <MainSource>DelphiVCL .dpr</MainSource>
8
8
<Platform Condition="'$(Platform)'==''">Win64</Platform>
9
9
<ProjectGuid>{7E56095C-46B8-4F28-87A2-EEA8D9D2448D}</ProjectGuid>
10
10
<ProjectVersion>19.1</ProjectVersion>
40
40
<Base>true</Base>
41
41
</PropertyGroup>
42
42
<PropertyGroup Condition="'$(Base)'!=''">
43
- <SanitizedProjectName>Delphi </SanitizedProjectName>
43
+ <SanitizedProjectName>DelphiVCL </SanitizedProjectName>
44
44
<DCC_ImageBase>00400000</DCC_ImageBase>
45
45
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace)</DCC_Namespace>
46
46
<GenDll>true</GenDll>
92
92
<BorlandProject>
93
93
<Delphi.Personality>
94
94
<Source>
95
- <Source Name="MainSource">Delphi .dpr</Source>
95
+ <Source Name="MainSource">DelphiVCL .dpr</Source>
96
96
</Source>
97
97
<Excluded_Packages/>
98
98
</Delphi.Personality>
112
112
<Overwrite>true</Overwrite>
113
113
</Platform>
114
114
</DeployFile>
115
- <DeployFile LocalName="Delphi .dll" Configuration="Release" Class="ProjectOutput">
115
+ <DeployFile LocalName="DelphiVCL .dll" Configuration="Release" Class="ProjectOutput">
116
116
<Platform Name="Win64">
117
- <RemoteName>Delphi .dll</RemoteName>
117
+ <RemoteName>DelphiVCL .dll</RemoteName>
118
118
<Overwrite>true</Overwrite>
119
119
</Platform>
120
120
</DeployFile>
Original file line number Diff line number Diff line change @@ -15,18 +15,22 @@ implementation
15
15
gModule : TPythonModule;
16
16
gDelphiWrapper : TPyDelphiWrapper;
17
17
18
+ // This must match the pattern "PyInit_[ProjectName]"
19
+ // So if the project is named DelphiVCL then
20
+ // the function must be PyInit_DelphiVCL
18
21
function PyInit_DelphiVCL : PPyObject;
19
22
begin
20
23
try
21
24
gEngine := TPythonEngine.Create(nil );
22
25
gEngine.AutoFinalize := False;
23
26
gEngine.UseLastKnownVersion := False;
24
- // Adapt to the desired python version
27
+ // Adapt to the desired python version - Will only work with this version
25
28
gEngine.RegVersion := ' 3.9' ;
26
29
gEngine.DllName := ' python39.dll' ;
27
30
28
31
gModule := TPythonModule.Create(nil );
29
32
gModule.Engine := gEngine;
33
+ // This must match the ProjectName and the function name pattern
30
34
gModule.ModuleName := ' DelphiVCL' ;
31
35
32
36
gDelphiWrapper := TPyDelphiWrapper.Create(nil );
You can’t perform that action at this time.
0 commit comments