-
Content Count
343 -
Joined
-
Last visited
-
Days Won
4
Posts posted by Cristian Peța
-
-
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)
Quote- Sets, records, and static arrays of 1, 2, or 4 bytes are passed as 8-bit, 16-bit, and 32bit values. Larger sets, records, and static arrays are passed as 32-bit pointers to the value. An exception to this rule is that records are always passed directly on the stack under the cdecl, stdcall, and safecall conventions; the size of a record passed this way is rounded upward to the nearest double-word boundary.
-
24 minutes ago, sp0987 said:dt := Now; // Returns error "Invalid date to Encodedate"
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?
-
44 minutes ago, Fudley said:if I put a button on a form it doesn't show up
But it is into dfm? Do you see it at design time or only at runtime is missing?
-
41 minutes ago, Fudley said:If I put a showmessage at various points like formactivate - nothing happened.
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.
-
54 minutes ago, tobenschain said:Created, Copied and Deleted
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.
-
1
-
-
-
1 hour ago, tomye said:i can't get detail error message, beacuase it calls .so library file
Dave asked if you looked for messages into the log, not the error in debugging.
-
5 minutes ago, McGuffin said:I have a private IP
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?
-
On 4/25/2024 at 9:38 AM, Die Holländer said:In the early BASIC times, like for the ❤️ ZX-Spectrum ❤️ there were
no functions or procedures but instead they introducted a way to
jump to another part of the source and return to the next line after
the jump. The statements: Gosub and Return.
ZX-Spectrum BASIC was like an easier assembler where you use CALL and RET (Z80 assembler).
-
3 hours ago, nevez said:How can I compile my project with x86_64 architecture via Rad Studio?
There is not Android x86 platform in Delphi. For debugging you can use Android devices or better Windows 32 for non Android specific things.
-
5 minutes ago, dummzeuch said:And for convenience, use a global variable to store the state ... gd&r
If not multi threading then it can be.
-
11 minutes ago, A.M. Hoornweg said:"Take control on entry and restore on exit" would be very cumbersome in the case of DLL's written in Delphi. It would need to be done in every exposed function / method.
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.
-
12 minutes ago, A.M. Hoornweg said:My question is about threads literally running simultaneously on different CPU cores, does each core always have an independent FPU + FPCR so one thread cannot jeopardize another ?
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.
-
runFullTrust
in FMX
Here something on this them:
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.
QuoteApps using the FullTrust entrypoint can call any API they want. Usually this is your main Win32/.Net executable. I’ll refer to these applications as FullTrust apps.
-
43 minutes ago, David Schwartz said:So what DO you do in a case where, say, you might use an object to collect an accumulation of data that is provided by multiple sources?
It's often done for contextual state management over time...
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.
-
1
-
-
-
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?
-
2
-
-
Simply don't share dll memory with the exe.
https://docwiki.embarcadero.com/RADStudio/Sydney/en/Sharing_Memory
-
On 3/22/2024 at 7:22 PM, david_navigator said:I was hoping there was something that the OS could deal with.
29 minutes ago, david_navigator said:@Kas Ob. could you explain in a little more detail about the memory manager please ?
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.
Changes in System.sysutils.pas were not reflecting in other unit in Delphi 11
in General Help
Posted
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.