-
Content Count
443 -
Joined
-
Last visited
-
Days Won
5
Everything posted by Cristian Peța
-
Changes in System.sysutils.pas were not reflecting in other unit in Delphi 11
Cristian Peța replied to sp0987's topic in General Help
Now I see that stdcall will force to put on stack the reference to TSystemTime. Without stdcall the reference will be passed in EAX registry. Maybe D7 is not using EAX and will put the reference on stack also without stdcall. -
Changes in System.sysutils.pas were not reflecting in other unit in Delphi 11
Cristian Peța replied to sp0987's topic in General Help
Strange how it worked in D7. Maybe the garbage on the stack was useful. With stdcall TSystemTime will be passed as value directly on the stack. Without stdcall TSystemTime will be passed as reference. Do I'm missing something? https://docwiki.embarcadero.com/RADStudio/Sydney/en/Program_Control_(Delphi) -
Changes in System.sysutils.pas were not reflecting in other unit in Delphi 11
Cristian Peța replied to sp0987's topic in General Help
Are you sure DDetours is not working? Have you tried to trace into Now() to debug and see what GetLocalTime(SystemTime) is returning in SystemTime? And to see actually where the exception is raised? -
D12 suddenly changes made in design do not take in runtime
Cristian Peța replied to Fudley's topic in FMX
But it is into dfm? Do you see it at design time or only at runtime is missing? -
D12 suddenly changes made in design do not take in runtime
Cristian Peța replied to Fudley's topic in FMX
If you put a break-point on that line with ShowMessage it will stop? If yes... step into and see what next. -
This is working for me. Probably you are doing something else in your code. program Project1; {$APPTYPE CONSOLE} uses System.SysUtils, System.Variants, System.Classes, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs, FireDAC.VCLUI.Wait, FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, FireDAC.Phys.SQLiteWrapper.Stat, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client; var FDConnection1: TFDConnection; FDTable1: TFDTable; begin FDConnection1 := TFDConnection.Create(nil); FDTable1 := TFDTable.Create(nil); FDConnection1.DriverName := 'SQLite'; FDConnection1.Params.Database := ExtractFilePath(ParamStr(0)) + 'test.db'; FDTable1.Connection := FDConnection1; FDTable1.TableName := 'table1'; //Default FDConnection1.Params.Values['LockingMode'] is 'Exclusive' FDConnection1.Open; FDConnection1.ExecSQL('CREATE TABLE table1 (a INTEGER)'); FDTable1.Open; FDTable1.InsertRecord([10]); FDTable1.Close; DeleteFile(FDConnection1.Params.Database);//here is not working because LockingMode = Exclusive FDConnection1.Close; DeleteFile(FDConnection1.Params.Database);//here is working for me end.
-
That means you solved the issue using locking_mode = NORMAL? Then probably you have not closed the connection properly before trying to delete.
-
Have you checked what PRAGMA locking_mode is returning? You can use TFDQuery for this. With UniDAC implicit is EXCLUSIVE and maybe also for FireDAC. Can you delete the file before opening any connection? Better try this after a system restart (or unlock the file) because if you kill the processes in debug, for example, before the connection is closed the file will remain locked. PS: I prefer to use locking_mode=NORMAL. There is some performance penalty but I don't need any more to respond with: restart the OS.
-
Closing a table will not close the connection to the database and if you are using PRAGMA locking_mode=EXCLUSIVE then you need to close the connection to unlock the file. Using locking_mode=NORMAL and deleting the file with an open connection is not a good thing. In this case you don't need to close the table either. https://www.sqlite.org/pragma.html#pragma_locking_mode
-
Upgraded to D12 and can't call the GPU for AI inference on Android
Cristian Peța replied to tomye's topic in Cross-platform
logcat is about Android log: https://developer.android.com/tools/logcat -
Upgraded to D12 and can't call the GPU for AI inference on Android
Cristian Peța replied to tomye's topic in Cross-platform
Dave asked if you looked for messages into the log, not the error in debugging. -
Then it can be that you are in a private network with someone (a neighbor) that uses Delphi?
-
Do you have a public or a private IP from your internet provider?
-
A gem from the past (Goto)
Cristian Peța replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
ZX-Spectrum BASIC was like an easier assembler where you use CALL and RET (Z80 assembler). -
android Delphi 12.1 Android API 34 - not support architecture
Cristian Peța replied to nevez's topic in General Help
There is not Android x86 platform in Delphi. For debugging you can use Android devices or better Windows 32 for non Android specific things.- 12 replies
-
- rad studio
- platform
-
(and 2 more)
Tagged with:
-
Disabled floating point exceptions are problematic for DLLs
Cristian Peța replied to A.M. Hoornweg's topic in Delphi IDE and APIs
If not multi threading then it can be. -
Disabled floating point exceptions are problematic for DLLs
Cristian Peța replied to A.M. Hoornweg's topic in Delphi IDE and APIs
procedure Foo; stdcall; begin SetFPCR; ... RestoreFPCR; end; Do you think is so cumbersome to do this for every exposed function? The SetFPCR and RestoreFPCR you need to write for yourself but only once. -
Disabled floating point exceptions are problematic for DLLs
Cristian Peța replied to A.M. Hoornweg's topic in Delphi IDE and APIs
If FPCR would not be per core then one processes would change FPCR of all processes! This can't be. FPCR must be pe core like all CPU registers. -
Here something on this them: https://stackoverflow.com/questions/77764786/remove-runfulltrust-capability-from-flutter-windows-application And Win32 apps packaged as msix will need runFullTrust. You can avoid runFullTrust with UWP but a Delphi app will call all sort of Win32 API that will need runFullTrust. https://blogs.windows.com/windowsdeveloper/2017/07/06/calling-winrt-components-win32-process-via-desktop-bridge/
-
Delphi and "Use only memory safe languages"
Cristian Peța replied to Die Holländer's topic in General Help
The sources must register to the collector. And unregister when the source does not need the collector anymore. The collector must not be destroyed if there is an active source. This is a little like ARC for interfaces work. -
Strange bug with string literals in RAD Studio 12
Cristian Peța replied to luebbe's topic in RTL and Delphi Object Pascal
@Uwe Raabe do I need to do something more than login to see the report? -
TStringStream inconsistent results
Cristian Peța replied to Mark Williams's topic in RTL and Delphi Object Pascal
I suppose you are using TXMLDocument. Then why not using TXMLDocument.LoadFromStream and TXMLDocument.SaveToStream and let the library do the encoding work for you? -
Simply don't share dll memory with the exe. https://docwiki.embarcadero.com/RADStudio/Sydney/en/Sharing_Memory
-
The OS will free the memory when you unload the dll.
-
Why a ghost? TThread.Create() can raise an exception using resourcestring SThreadCreateError = 'Thread creation error: %s' And SysErrorMessage() return an empty string.