View Issue Details

IDProjectCategoryView StatusLast Update
0037567pas2jstranspilerpublic2020-08-14 12:33
Reporterhenrique Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformMakestubOSWindows 
Fixed in Versiontrunk 
Summary0037567: Dll interface error
DescriptionWhen I called the run procedure, I was giving an "external exception" error because of the writeln I had in the DLL's interface.

I attached the adjustment I made.
TagsNo tags attached.
Fixed in Revision46425
Attached Files

Activities

henrique

2020-08-13 18:51

reporter  

Interface.patch (1,963 bytes)   
From f9ef102122b642df9a90732189e193196500bd33 Mon Sep 17 00:00:00 2001
From: Henrique Gottardi Werlang <henriquewerlang@hotmail.com>
Date: Thu, 13 Aug 2020 09:12:55 -0300
Subject: [PATCH] Ajuste interface.

---
 utils/pas2js/libstub.pp     | 10 +---------
 utils/pas2js/stubcreator.pp | 10 +++++-----
 2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/utils/pas2js/libstub.pp b/utils/pas2js/libstub.pp
index 7033b9c568..ab5fb4a103 100644
--- a/utils/pas2js/libstub.pp
+++ b/utils/pas2js/libstub.pp
@@ -123,15 +123,7 @@ end;
 Function ExecuteStubCreator(P : PStubCreator) : Boolean; stdcall;
 
 begin
-  Result:=False;
-  try
-    TStubCreator(P).Execute;
-    Result:=True;
-  except
-    On E: Exception do
-      Writeln('Exception ',E.ClassName,' ',E.Message);
-    // Ignore
-  end;
+  Result:=TStubCreator(P).Execute;
 end;
 
 Procedure GetStubCreatorLastError(P : PStubCreator; AError : PAnsiChar;
diff --git a/utils/pas2js/stubcreator.pp b/utils/pas2js/stubcreator.pp
index 96a19ba84c..39e0ce4aec 100644
--- a/utils/pas2js/stubcreator.pp
+++ b/utils/pas2js/stubcreator.pp
@@ -80,7 +80,7 @@ type
   Public
     Constructor Create(AOwner : TComponent); override;
     Destructor Destroy; override;
-    Procedure Execute;
+    Function Execute: Boolean;
     Procedure GetLastError(Out AError,AErrorClass : String);
     // Streams take precedence over filenames. They will be freed on destroy!
     // OutputStream can be used combined with write callbacks.
@@ -227,22 +227,22 @@ begin
     Include(O,woForwardClasses);
 end;
 
-procedure TStubCreator.Execute;
-
-
+function TStubCreator.Execute: Boolean;
 begin
   FLastErrorClass:='';
   FLastError:='';
+  Result := False;
   if Defines.IndexOf('MakeStub')=-1 then
 
   Try
     DoExecute;
+
+    Result := True;
   except
     On E : Exception do
       begin
       FLastErrorClass:=E.Classname;
       FLastError:=E.Message;
-      Raise;
       end;
   end;
 end;
-- 
2.28.0.windows.1

Interface.patch (1,963 bytes)   

Michael Van Canneyt

2020-08-14 12:33

administrator   ~0124879

Applied, thank you very much !

Issue History

Date Modified Username Field Change
2020-08-13 18:51 henrique New Issue
2020-08-13 18:51 henrique File Added: Interface.patch
2020-08-14 12:33 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-08-14 12:33 Michael Van Canneyt Status new => resolved
2020-08-14 12:33 Michael Van Canneyt Resolution open => fixed
2020-08-14 12:33 Michael Van Canneyt Fixed in Version => trunk
2020-08-14 12:33 Michael Van Canneyt Fixed in Revision => 46425
2020-08-14 12:33 Michael Van Canneyt Note Added: 0124879