saeiddavoody 0 Posted November 9 (edited) Hi, I had installed the EmbeddedWB component on Delphi 10.4 . It had worked successfully both on 32bit and 64bit application. Now I ported the component to Delphi 12.2. It works on 32bit application but on 64bit, when the EmbeddedWB1.Navigate statement runs, the application crashes and closes. What are the changes on WebBrowser since Delphi 10.4 to 12? And How should I found and fix the problem? EmbeddedWB-Delphi12.rar Edited November 9 by saeiddavoody Share this post Link to post
DelphiUdIT 181 Posted November 9 This is a works derived from old github repository. Most of the definitions are included in new IDE (like SHDocVw of IDE that have more complete defines). For example, this is something differents: Embedded define from SHDocVw_EWB (look var PostData): IDE define from SHDocVw (look const PostData): Since those project come from very old one, I think it's really difficult to define what is the issue: the lack of source code for your app, related to how you use the component, then does not help. Share this post Link to post
saeiddavoody 0 Posted November 9 (edited) 42 minutes ago, DelphiUdIT said: This is a works derived from old github repository. Most of the definitions are included in new IDE (like SHDocVw of IDE that have more complete defines). For example, this is something differents: Embedded define from SHDocVw_EWB (look var PostData): IDE define from SHDocVw (look const PostData): Since those project come from very old one, I think it's really difficult to define what is the issue: the lack of source code for your app, related to how you use the component, then does not help. Thank you for answer, My sample project has only one statement without any other codes. Please see the attached sample. On 32bit platform there is no any problem. The problem is only in 64bit. WebBrowser2.rar Edited November 9 by saeiddavoody Share this post Link to post
DelphiUdIT 181 Posted November 9 (edited) EDIT: READ NEXT POST I try to debug it, but something goes wrong in the source (compiled system unit) of IDE. There is no chance (or better I was not able) to let it works or diagnose what is the problem. The only thing that I catch is that is generated an error (0xc000041d), in Microsoft that means: Link in Italian: https://support.microsoft.com/it-it/topic/errore-ntstatus-0xc000041d-si-verifica-quando-si-fa-clic-su-un-collegamento-in-un-applicazione-basata-sul-web-in-internet-explorer-10-in-windows-8-o-windows-server-2012-49b8cfdd-a841-06ce-ae60-8c04ff74a2f3 If you use the IDE standard component TWebBrowser all works. Edited November 9 by DelphiUdIT Share this post Link to post
DelphiUdIT 181 Posted November 9 (edited) UPDATE: IT WORKS DOING SO: But this is only an "escamotage" because this means that in your components there are something not working with WIN64 convention ... normally are the pointers ... Edited November 9 by DelphiUdIT Share this post Link to post
saeiddavoody 0 Posted November 9 (edited) 6 minutes ago, DelphiUdIT said: UPDATE: IT WORKS DOING SO: But this is only an "escamotage" because this means that in your components ther are something not workin with WIN64 convention ... normally is the pointers ... Probably the problem is related to the changes made in Delphi 12 or 11, because it works correctly in Delphi 10.4 even on the 64-bit platform. Edited November 9 by saeiddavoody Share this post Link to post
DelphiUdIT 181 Posted November 9 (edited) 14 minutes ago, saeiddavoody said: Probably the problem is related to the changes made in Delphi 12 or 11, because it works correctly in Delphi 10.4 even on the 64-bit platform. The changes that were done are the enable of ASLR and High LOAD in all projects (old and news). WIthout this the component works, OR BETTER SEEM TO WORKS. Don't put you hand over the fire about this. Like I told the component is derived from very old projects, and it's near the true that is not "fully" compatible with x64 tech. The full project should be take in care and updated to x64, looking everywhere in the code. EDIT: to better explain, in the x32 the pointers are 4 bytes long, where in x64 are 8 bytes. If you don't use the "high memory" is possible that all works ... but really always ? Look there: https://docwiki.embarcadero.com/RADStudio/Athens/en/Converting_32-bit_Delphi_Applications_to_64-bit_Windows Edited November 9 by DelphiUdIT Share this post Link to post
DelphiUdIT 181 Posted November 9 16 minutes ago, saeiddavoody said: Probably the problem is related to the changes made in Delphi 12 or 11, because it works correctly in Delphi 10.4 even on the 64-bit platform. Put those two define lines in a DPR file of your application after "program" section in 10.4 and buld it with x64: program ..............; {$SETPEOPTFLAGS $40} //SET ALSR ON (Address space layout randomization {$SETPEOPTFLAGS $020} //SET HEVA ON (HIGH ENTROPY VA) You will see (should) the same issue. Share this post Link to post
PeterBelow 238 Posted November 9 4 hours ago, saeiddavoody said: Hi, I had installed the EmbeddedWB component on Delphi 10.4 . It had worked successfully both on 32bit and 64bit application. Now I ported the component to Delphi 12.2. It works on 32bit application but on 64bit, when the EmbeddedWB1.Navigate statement runs, the application crashes and closes. What are the changes on WebBrowser since Delphi 10.4 to 12? And How should I found and fix the problem? EmbeddedWB-Delphi12.rar Can you not just ditch it and use TEdgeBrowser supplied with Delphi instead? Share this post Link to post
Angus Robertson 574 Posted November 9 Indeed, the EmbeddedWB component wraps the old Internet Explorer stuff which is long obsoleted by Edge, it still works for Microsoft APIs, but not for Google APIs, you need to use Edge. Angus Share this post Link to post
saeiddavoody 0 Posted November 9 3 hours ago, PeterBelow said: Can you not just ditch it and use TEdgeBrowser supplied with Delphi instead? My project is a bit old and relatively large. I have written many functions and codes related to EmbeddedWB. Replacing TEdgeBrowser takes a long time. Of course, I will do this in the future, but I don't have the time now. Share this post Link to post
zed 14 Posted November 10 I have the same problem with EmbeddedWB. There is something bad in the component initialization code, because application start crashing after you add just one EmbeddedWB unit to your uses list. unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.OleCtrls, EmbeddedWB, // !!! System.SysUtils; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin // var EmbeddedWB1 := TEmbeddedWB.Create(Self); // EmbeddedWB1.Navigate(ExtractFilePath(Application.ExeName)+ '..\..\test.htm'); end; end. Share this post Link to post
zed 14 Posted November 10 I found it! fix for mouse hook: https://github.com/sasgis/embeddedwb/commit/b8f659042e0a6b30ab824a89c4ee24b4961648cc fix for win64 typecasts: https://github.com/sasgis/embeddedwb/commit/fe9e776a51ca7534853811841d66047f835a7bdf Function SetWindowLong must be replaced with SetWindowLongPtr with proper type cast. Function GetWindowLong must be replaced with GetWindowLongPtr. Share this post Link to post
saeiddavoody 0 Posted November 10 1 hour ago, zed said: I found it! fix for mouse hook: https://github.com/sasgis/embeddedwb/commit/b8f659042e0a6b30ab824a89c4ee24b4961648cc fix for win64 typecasts: https://github.com/sasgis/embeddedwb/commit/fe9e776a51ca7534853811841d66047f835a7bdf Function SetWindowLong must be replaced with SetWindowLongPtr with proper type cast. Function GetWindowLong must be replaced with GetWindowLongPtr. Hi, Do you install and test the updated component in 64 bit platform? It seems that there are some problems yet. Share this post Link to post
zed 14 Posted November 10 (edited) No, I don't use it in the IDE at design time. I create EWB at runtime and it seems to work fine. Edited November 10 by zed Share this post Link to post
Brandon Staggs 279 Posted November 11 On 11/9/2024 at 9:27 AM, PeterBelow said: Can you not just ditch it and use TEdgeBrowser supplied with Delphi instead? Much easier said than done if you have a large legacy application built around Trident. If you are using a lot of synchronous javascript calls the refactoring job to work in the asynchronous Edge browser is no small refactoring task. Obviously it would be a worthwhile thing to do, IMO, but of course that needs to be balance against other concerns... Share this post Link to post