View Issue Details

IDProjectCategoryView StatusLast Update
0037545pas2jsrtlpublic2020-08-11 15:34
Reporterhenrique Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformMakestubgOSWindows 
Fixed in Versiontrunk 
Summary0037545: Added stdcall.
DescriptionAdded stdcall in functions that inherit from IInterface, so no build errors occur, but in Pas2Js, gives an un implemented warning.

Can I leave it at that, or is there another way to do it?
TagsNo tags attached.
Fixed in Revision46363
Attached Files

Activities

henrique

2020-08-11 14:57

reporter  

Classes.patch (1,824 bytes)   
From a83d40f6e79b3386d0688fe9fc82de1b76cad921 Mon Sep 17 00:00:00 2001
From: Henrique Gottardi Werlang <henriquewerlang@hotmail.com>
Date: Tue, 11 Aug 2020 09:52:33 -0300
Subject: [PATCH] Adicionado o stdcall

---
 packages/rtl/classes.pas | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/packages/rtl/classes.pas b/packages/rtl/classes.pas
index d1dd67d..a81b0e6 100644
--- a/packages/rtl/classes.pas
+++ b/packages/rtl/classes.pas
@@ -216,10 +216,10 @@ type
   private
     FOwnerInterface: IInterface;
   protected
-    function _AddRef: Integer;
-    function _Release: Integer;
+    function _AddRef: Integer; stdcall;
+    function _Release: Integer; stdcall;
   public
-    function QueryInterface(const IID: TGUID; out Obj): HRESULT; virtual;
+    function QueryInterface(const IID: TGUID; out Obj): HRESULT; virtual; stdcall;
     procedure AfterConstruction; override;
   end;
 
@@ -591,15 +591,15 @@ type
     procedure ValidateContainer(AComponent: TComponent); virtual;
     procedure ValidateInsert(AComponent: TComponent); virtual;
   protected
-    function _AddRef: Integer;
-    function _Release: Integer;
+    function _AddRef: Integer; stdcall;
+    function _Release: Integer; stdcall;
   public
     constructor Create(AOwner: TComponent); virtual; reintroduce;
     destructor Destroy; override;
     procedure BeforeDestruction; override;
     procedure DestroyComponents;
     procedure Destroying;
-    function QueryInterface(const IID: TGUID; out Obj): HRESULT; virtual;
+    function QueryInterface(const IID: TGUID; out Obj): HRESULT; virtual; stdcall;
     procedure WriteState(Writer: TWriter); virtual;
 //    function ExecuteAction(Action: TBasicAction): Boolean; virtual;
     function FindComponent(const AName: string): TComponent;
-- 
2.28.0.windows.1

Classes.patch (1,824 bytes)   

Michael Van Canneyt

2020-08-11 15:33

administrator   ~0124763

pas2js does not give a warning, it gives an error.

Solved it as follows:
I let the stub creator define MAKESTUB.
In the classes.pas the stdcall is enclosed in {$IFDEF MAKESTUB}, this way only makestub sees the stdcall.

Michael Van Canneyt

2020-08-11 15:34

administrator   ~0124764

Do not forget to update both the makestub and the pas2js rtl.

Issue History

Date Modified Username Field Change
2020-08-11 14:57 henrique New Issue
2020-08-11 14:57 henrique File Added: Classes.patch
2020-08-11 15:33 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-08-11 15:33 Michael Van Canneyt Status new => resolved
2020-08-11 15:33 Michael Van Canneyt Resolution open => fixed
2020-08-11 15:33 Michael Van Canneyt Fixed in Version => trunk
2020-08-11 15:33 Michael Van Canneyt Fixed in Revision => 46363
2020-08-11 15:33 Michael Van Canneyt Note Added: 0124763
2020-08-11 15:34 Michael Van Canneyt Note Added: 0124764