-
Content Count
1167 -
Joined
-
Last visited
-
Days Won
16
Everything posted by FPiette
-
Help Understanding SQL Parameters Utilization
FPiette replied to Gary Mugford's topic in General Help
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. -
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.
-
@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.
-
@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.
-
Installing ICS v8.58 on CBuilder 10.1
FPiette replied to Anubis_68's topic in ICS - Internet Component Suite
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. -
Several F2084 Internal Error on Delphi 10.4.2
FPiette replied to Davide Angeli's topic in Delphi IDE and APIs
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). -
Several F2084 Internal Error on Delphi 10.4.2
FPiette replied to Davide Angeli's topic in Delphi IDE and APIs
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. -
Several F2084 Internal Error on Delphi 10.4.2
FPiette replied to Davide Angeli's topic in Delphi IDE and APIs
I use D10.4.2 every single days without any problem. -
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
-
What is your actual skills with Delphi? What kind of application do you want to write? Which platforms are you using?
-
What is the best way to precisely time/trigger threaded events
FPiette replied to Yaron's topic in Windows API
I don't know but it is easy to know: call GetCurrentThreadId (Windows api) from hte main thread and from the callback. -
What is the best way to precisely time/trigger threaded events
FPiette replied to Yaron's topic in Windows API
I don't know what you draw on screen, but have you considered off-loading everything to the GPU? Much like a game. -
Rearrange implementation modifies empty lines at end of method
FPiette posted a topic in MMX Code Explorer
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. -
Rearrange implementation modifies empty lines at end of method
FPiette replied to FPiette's topic in MMX Code Explorer
Thanks. Merci. -
What is the best way to precisely time/trigger threaded events
FPiette replied to Yaron's topic in Windows API
Use a multimedia timer via the Win32 API timeSetEvent() or CreateTimerQueueTimer() function. -
Rearrange implementation modifies empty lines at end of method
FPiette replied to FPiette's topic in MMX Code Explorer
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. -
compiling DCU without creating EXE
FPiette replied to Dave Novo's topic in RTL and Delphi Object Pascal
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. -
You should not access the UI from a thread.
-
OverbyteIcsTicks64 missing include file
FPiette replied to EugeneK's topic in ICS - Internet Component Suite
Add the folder to the IDE options library path or to the project options library path. -
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).
-
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.
-
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.
-
How to gracefully get rid of the use of dictionaries?
FPiette replied to Shrinavat's topic in General Help
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; -
How to gracefully get rid of the use of dictionaries?
FPiette replied to Shrinavat's topic in General Help
@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... -
The external sources where much much more used.