Jump to content

FPiette

Members
  • Content Count

    1167
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by FPiette

  1. FPiette

    Help Understanding SQL Parameters Utilization

    SQL injection is not something you - as programmer - do, it is something you prevent. It comes from having a SQL query constructed using strings entered by the user. The query you show which is built by code doesn't seems to use data entered by the user. So no problem. If - as an example - the constant "ZZ" must be changed by something coming from the user interface, then use a parameter. You'll have to make the same condition where you'll give a value to the parameter to avoid giving a parameter if the parameter doesn't exists because it is not part of the query because of the condition evaluated to FALSE. Using the same condition around parameter value assignment will solve your problem.
  2. FPiette

    Show a FMX form inside a dll from a VCL application

    IMO it is not a good idea to start learning FMX by a project mixing VCL and FMX! If you need to run on Windows and mobile, the choice with Delphi and native application is FMX framework. Another possibility is to create a frontend web application (UI) and a backend application. In that architecture, you can write the backend with VCL and the frontend (UI written in HTML, CSS and JavaScript) will run in a browser on both Windows and Mobile. This will require a lot of effort to port your current application to that architecture. Embarcadero RadServer is designed for that kind of architecture.
  3. FPiette

    Show a FMX form inside a dll from a VCL application

    @dkounalAll I can says is that my code works for what I am doing with it. In the link @Remy Lebeaugave, it is stated that it is legal but full of traps. What I do is very simple in the relationship between the VCL exe and the FMX dll but probably doing more complex things require more code. The question you have to ask yourself is "Why in the first place do I need FMX?". In my case, FMX offer 3D model rendering and animation incredibly easy. I did a quick test and it worked fine. The VCL part was required because I already had huge VCL code for the everything else in the application.
  4. FPiette

    Show a FMX form inside a dll from a VCL application

    @dkounalI have done this kind of code: In a DLL, a single FMX form showing and animating a 3D model. The DLL is loaded by a VCL application and parented to a TPanel. Everything works nice and easy except one thing: When the VCL application closes, it hangs if the FMX DLL is unloaded (FreeLibrary). I simple didn't unload the DLL which is not a problem since the DLL is an Add-on that has the same life time as the main VCL application. Anyway Window unload the DLL by itself.
  5. According to the error message, you have not compiled package IcsVclCB102Design.dpk package or if you compiled it, there is an error in path somewhere and the IDE doesn't find it.
  6. FPiette

    Several F2084 Internal Error on Delphi 10.4.2

    Are you volunteering to rework my application architecture if it's that easy - I have 100+ package projects in a project group Unless you are doing unusual coding with packages such as explicit dynamic loading of package, compiling an application to use run time package or not is a matter of a project option (Link with runtime packages).
  7. FPiette

    Several F2084 Internal Error on Delphi 10.4.2

    I never use run time packages. And if you suspect this is your problem, it is easy to suppress the use of run time packages and compile everything in a single executable. OK, executable will be bigger but will not require more memory at run time.
  8. FPiette

    Several F2084 Internal Error on Delphi 10.4.2

    I use D10.4.2 every single days without any problem.
  9. FPiette

    Scanning and printing projects.

    Do you mean something to find all DPR files on your disk? Try this on the command line: DIR /B /S C:\*.DPR To get the list in a text file, proceed like this; DIR /B /S C:\*.DPR >MyTextFile
  10. FPiette

    Delphi books

    What is your actual skills with Delphi? What kind of application do you want to write? Which platforms are you using?
  11. I don't know but it is easy to know: call GetCurrentThreadId (Windows api) from hte main thread and from the callback.
  12. I don't know what you draw on screen, but have you considered off-loading everything to the GPU? Much like a game.
  13. When I use the implementation section rearrange feature, MMX remove empty lines which separate each method. Before rearrangement, my code looks like: {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} // Some Comment procedure TForm1.Method1; begin // Some code end; {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} // Some more comment procedure TForm1.Method2; begin // Some code end; {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} There are TWO empty lines after the "end;" at the end of each method. After rearrangement, there is only one left. Is there and option to avoid this empty line removal? Thanks.
  14. Use a multimedia timer via the Win32 API timeSetEvent() or CreateTimerQueueTimer() function.
  15. Thanks Uwe. Maybe a future option? Either (best) specify the number of empty lines after the "end;", or to leave the lines as is in the source code.
  16. FPiette

    compiling DCU without creating EXE

    Probably, if you move the code to one or more run time packages, it will be faster. You can use run time package just for development. Then if you like, you can disable it for your release to keep one single executable file.
  17. FPiette

    Issues with Sleep(1) called in a loop

    You should not access the UI from a thread.
  18. Add the folder to the IDE options library path or to the project options library path.
  19. FPiette

    Safe uninstall/reinstall RAD Studio 10.3

    Uninstalling Delphi won't change your install count. If you have only one installation, no problem to do a second. But it is better to keep it when you'll really need it. Your PC doesn't boot anymore on the hard disk? Or do you have some bad sectors but it still works? What is the exact problem? (Don't answer if you are not interested in trying to fix your PC).
  20. FPiette

    Safe uninstall/reinstall RAD Studio 10.3

    What error makes you think you must reformat your machine ? I never ever had to reformat my computer and I use Windows since his beginning. I was always able to repair whatever trouble I had. If you are unsure about repairing, I strongly advice you to create a disk image using - for example - Macrium Reflect. Using that tool, you can also create a bootable media with Macrium so that you can restore your backup on a completely new hard disk. And anyway, you should create a new backup after each important change in your computer.
  21. FPiette

    Safe uninstall/reinstall RAD Studio 10.3

    As far as I know, it is unsafe. The number of installation are very restricted. I suggest that you don't reformat the machine but do a Windows repair instead.
  22. You didn't define the variable types, so I made some guessing and came with the following code: type TDirection = (dirE, dirW, dirN, dirS); TDirections = set of TDirection; var DX : array [TDirection] of Integer = (1, -1, 0, 0); DY : array [TDirection] of Integer = (0, 0, -1, 1); Opposite : array [TDirection] of TDirection = (dirW, dirE, dirS, dirN); procedure Demo; var x, y, nx, ny : Integer; Dir : TDirection; Grid : array[0..100, 0..100] of TDirections; begin x := 3; y := 5; Dir := dirN; nx := x + DX[Dir]; ny := y + DY[Dir]; Grid[nx, ny] := Grid[nx, ny] + [Opposite[Dir]]; end;
  23. @Fr0sT.Brutal given the way he defined N, S, E, W (Power of two), it is likely meant to combine them (NE = N + E). It is better stay like it is, or replaced by an "set of". But of course we don't know how he makes use of those values so it is pure speculation...
  24. FPiette

    community.embarcadero.com's forums

    The external sources where much much more used.
×