Skip to content

Renamed the Delphi module to DelphiVCL #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleaned up rename to DelphiVCL
added some comments about proper naming
  • Loading branch information
JimMcKeeth committed Oct 20, 2020
commit b570aef9baf915d7d40019466ecb5485ad4067db
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