I get access violation when running my project in windows xp lazarus / 34-Windows ---------------------------------------------------------------------- Froxter · 2025-04-25 10:12 My project is setted to run in 32bit but each time I try execute it in windows XP i get an access violation in main.pas (but i give the other codes another causes the problem) the weird thing is that running it in windows 7 and above there are not errors. I know I can just say that you need at least windows 7 to run it but I really need this thing executes in windows xp. Thank you ---------------------------------------------------------------------- Thaddy · 2025-04-25 12:36 The only easy way to get around this, is using an older version of Lazarus. The problem is that the Syn controls and other code use Windows api calls that are only available from Windows Vista and higher, not XP. E.g. High DPI. I guess nobody wants to fix that for a legacy platform. Older versions are still avalable, but do not expect newer features will work. ---------------------------------------------------------------------- Martin_fr · 2025-04-25 12:41 Quote from: Thaddy on April 25, 2025, 02:36:53 pmThe only easy way to get around this, is using an older version of Lazarus. The problem is that the Syn controls and other code use Windows api calls that are only available from Windows Vista and higher, not XP. E.g. High DPI. I guess nobody wants to fix that for a legacy platform. Older versions are still avalable, but do not expect newer features will work. If that "Syn" is about SynEdit, then which calls are that? They should be kept compatible. And afaik they run on XP inside the IDE. ---------------------------------------------------------------------- Thaddy · 2025-04-25 12:57 There seem to be calls that are only Vista and higher. If a program used to work with lower versions, then that is the case. It is not his code, but somewhere in the libraries he uses. I am not prepared to debug those. ---------------------------------------------------------------------- 440bx · 2025-04-25 13:08 @Froxter, post a screenshot of the access violation, that information could be helpful in solving the problem. ---------------------------------------------------------------------- Froxter · 2025-04-25 13:47 Quote from: 440bx on April 25, 2025, 03:08:00 pm@Froxter, post a screenshot of the access violation, that information could be helpful in solving the problem. Compiling in XP i get this ---------------------------------------------------------------------- Bart · 2025-04-25 13:59 Build your project with full debug and line info (-Criot -gl -gh -gw2). Include the units LazLogger, and LCLExceptionStacktrace in your program. Start the program with --debug-log=path\to\logfile Let the program crash Attach the log file here. Alternatively run the program in gdb, let it crash and get a backtrace. Bart ---------------------------------------------------------------------- Froxter · 2025-04-25 14:13 Quote from: Bart on April 25, 2025, 03:59:41 pmBuild your project with full debug and line info (-Criot -gl -gh -gw2). Include the units LazLogger, and LCLExceptionStacktrace in your program. Start the program with --debug-log=path\to\logfile Let the program crash Attach the log file here. Alternatively run the program in gdb, let it crash and get a backtrace. Bart I wasnt able to find the "-Criot" and make the log file ---------------------------------------------------------------------- 440bx · 2025-04-25 14:48 You're running the program from Lazarus.  In Lazarus, set the debugging options to "Dwarf with sets" or some of the other dwarf options if you prefer a different one. Run the program from Lazarus, when the access violation occurs, there should be a box that gives you information about where the access violation took place.  Take a screenshot of that box and post it here. ---------------------------------------------------------------------- Froxter · 2025-04-25 16:12 Quote from: 440bx on April 25, 2025, 04:48:43 pmYou're running the program from Lazarus.  In Lazarus, set the debugging options to "Dwarf with sets" or some of the other dwarf options if you prefer a different one. Run the program from Lazarus, when the access violation occurs, there should be a box that gives you information about where the access violation took place.  Take a screenshot of that box and post it here. also in Application.CreateForm(TfrmMain, frmMain); i get: Application = var  Application: TApplication = class (TCustomApplication) C:\lazarus\lcl\forms.pp(1988,3) Description The TApplication singleton. Application  is a unit global variable with the TApplication  instance representing the currently executing application. The value for the variable is assigned in the initialization section for the unit when the application is started. It is freed in the finalization section when the application is terminated. Use the TApplicationProperties  component to provide design-time configuration settings for properties (including event handlers) which are automatically applied to Application at run-time. oohh and also in Lazarus when i execute it in xp and going to the main form in the form editor the program crashes showing error of Access Violation ---------------------------------------------------------------------- Froxter · 2025-04-25 16:23 ... ---------------------------------------------------------------------- 440bx · 2025-04-25 16:26 The first question is: if the program doesn't compile () how do you get it to run ? did you make some change that allowed it to compile and run ? and if the answer is "yes", what was that change ? Also, the messagebox says there is a nil pointer someplace in your program. ---------------------------------------------------------------------- Froxter · 2025-04-25 16:31 Quote from: 440bx on April 25, 2025, 06:26:28 pmThe first question is: if the program doesn't compile () how do you get it to run ? did you make some change that allowed it to compile and run ? and if the answer is "yes", what was that change ? Also, the messagebox says there is a nil pointer someplace in your program. It compiles but doesnt run and maybe is one of my elements of the main form. there are panels, a toolbar, toolbar buttons, a menu, an action list, an image list, a shell tree view, 2 splitters, a lisht shell view and a page control. tab sheets and synedits are added by code ---------------------------------------------------------------------- Froxter · 2025-04-25 17:00 Update: Deleting the TShellTreeView it finally runs in XP! Im gonna try to replace the file explorer creating a new one. Thanks for the help and sorry a lot for all the inconvenience caused ---------------------------------------------------------------------- Martin_fr · 2025-04-25 17:47 Indeed, I can confirm. Even dropping a TShellTreeview onto a form gives the error (Laz 4.99). That should be reported. It should still work. ---------------------------------------------------------------------- dsiders · 2025-04-25 17:58 Quote from: Martin_fr on April 25, 2025, 07:47:57 pmIndeed, I can confirm. Even dropping a TShellTreeview onto a form gives the error (Laz 4.99). That should be reported. It should still work. I assume you mean on XP. Or Windows in general? Because it still works on Linux+QT6. ---------------------------------------------------------------------- Martin_fr · 2025-04-25 18:07 Actually, just try with the patch from the following commit please. https://gitlab.com/freepascal.org/lazarus/lazarus/- /commit/92d902d141a43d33fb971477f119929319b246e6 That should work / works for me. Let me know, so  I can add it to the 4.0 fixes branch. ---------------------------------------------------------------------- Martin_fr · 2025-04-25 18:13 The shelltreeview has a public (not published) option "UseBuiltinIcons" which defaults to true. If set, it tries to get some icon from the OS, but gets nil on XP. ---------------------------------------------------------------------- Martin_fr · 2025-04-25 18:14 Quote from: dsiders on April 25, 2025, 07:58:16 pmQuote from: Martin_fr on April 25, 2025, 07:47:57 pmIndeed, I can confirm. Even dropping a TShellTreeview onto a form gives the error (Laz 4.99). That should be reported. It should still work. I assume you mean on XP. Or Windows in general? Yes, XP. Confirming the original issue. ---------------------------------------------------------------------- jamie · 2025-04-26 22:00 I belive @wp made those changes way back to use system icon. ---------------------------------------------------------------------- wp · 2025-04-26 23:09 In a related thread (https://forum.lazarus.freepascal.org/index.php/to pic,70936.msg553261.html) the OP confirms that Martin's code does fix his issue with TShellTreeView in XP. ---------------------------------------------------------------------- Martin_fr · 2025-04-26 23:23 Great, applied to fixes branch.