Jump to content

programmerdelphi2k

Members
  • Content Count

    189
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by programmerdelphi2k

  1. programmerdelphi2k

    No one can help

    take care about "memory" usage with working with "TStream" like this!
  2. programmerdelphi2k

    No one can help

    Unidirectional is used to specifics DB that support it! old-Fashion... or for quick access to records info without needs see any others!
  3. programmerdelphi2k

    No one can help

    you record in question is = 60MBytes (text + pictures, etc...)? I think that this is not problem at all for "out of memory" it's necessary more info: it's possible you "upload your UNIT + FORM" in zip file for analise?
  4. programmerdelphi2k

    No one can help

  5. programmerdelphi2k

    No one can help

    FireDAC: The Unidirectional property is synchronized with IsUniDirectional. then, just 1 record on memory! what is seen on screen it's another history!
  6. programmerdelphi2k

    No one can help

    normally, to read or save a BLOB you would use some like this ... better, TStream ... not TMemoryStream! in fact, the BLOB fields (data) are not loaded when in "select'ing", just a BLOB ID is known! now when read your blob then, the "data" will be known!
  7. programmerdelphi2k

    Warnings after Build/Compile

    try "delete" the xxxx.DPROJ file, then, your IDE will create a new file for you! --- note: if you use any config specific, of course, it will be delete too! but you can re-do it!
  8. programmerdelphi2k

    No one can help

    "Description" field: what type on DB and size?
  9. programmerdelphi2k

    No one can help

    hi @limelect can you upLOAD just SQLite DB with NONE-records, just structure?
  10. programmerdelphi2k

    backup and restore database sqllite

    after Android 11, you can not use all folders, only public or from your app install!
  11. programmerdelphi2k

    Using attributes on aliases

    type TMyGUID = TGUID; // your "alias" that way TMyHlpToTGUID = record helper for TGUID function MyFunc: string; end; TMyHlpToTMyGUID = record helper for TMyGUID function MyMyFunc: string; end; procedure TForm1.Button1Click(Sender: TObject); var x: TMyGUID; begin x := TMyGUID.Create('123...'); x.MyMyFunc; // MyMyFunc "hide" MyFunc now... helper to same type-base TGUID! end; { TMyHlpToTGUID } function TMyHlpToTGUID.MyFunc: string; begin result := 'Hello'; end; { TMyHlpToTMyGUID } function TMyHlpToTMyGUID.MyMyFunc: string; begin result := 'World'; end; end. as "TMyGUID" is, in fact, "TGUID" (yet), then your attributes should works in "TGUID" not in "TMyGUID" as showed in your "blog post", the real type is "TGUID", then, you needs works with it, not "TMyGUID"
  12. programmerdelphi2k

    backup and restore database sqllite

    FDSQLiteBackup1.Database := 'c:\db.sdb'; FDSQLiteBackup1.DestDatabase := 'c:\db.backup'; FDSQLiteBackup1.DestMode := smCreate; // <--- FDSQLiteBackup1.Backup;
  13. programmerdelphi2k

    DL a file from the web

    in short: it's a bug without wings, thinking it flies high!
  14. programmerdelphi2k

    TClientDataset gives access violation when open

    when using "TClientDataset" you can needs a "Midas" dll, if you dont compile with MidasLib in your project! program Project1; uses MidasLib, // <--- adding this, you'll dont needs DLL to MIDAS on target PC Forms, Unit1 in 'Unit1.pas' {Form1}; {$R *.res} begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end.
  15. programmerdelphi2k

    Custom TListBoxItem Live Bindings Advice

    ok, now I think that understand a little more your question! first, basically, all components in FMX is not data aware, like in VCL (DBEdit, DBGrid, etc...) all is done using LiveBinding tech, or by code! create a LiveBinding by code it's very complicated, but it's possible, of course! basically, you'll use a TAdapterBindSource component to create your "LOAD" data!!! you can use yourself "Class" to read/store your infos, like TPerson ... FName, FLastName, etc...) naturelly, you'll have create your logic to updates, saves, read, etc... now, to create your LiveBinding "to binds controls", it's another history... depend of your "necessity" or "complexity" here, it's a part complicated to "open" this black-box really can needs much code BindSourceDB FMX is your DataSource in VCL! You'll note that there is not code using LiveBinding because it works like a "Observer Pattern", send and receiving messages Regarding the use of "styles", you can either use the "Bitmap Style Designer" (Tools menu) to create your styles, or you can do it all in code (needless to say it will be painful) Basically, the styles mechanism works as a proxy, that is, the property definitions are passed to the final components in a trust relationship, that is, there is compatibility between the object that defined the style and the object that will receive the style. In FMX, a style is not the same thing as a "SKIN" (something purely visual), for example! A style is, firstly, "a behavior" (by having a reaction to a user action), and, secondly, a visual appearance! But it's not something out of this world, however, it can be quite complicated to do everything in code! Be aware that the engine that applies the style, looks for some keywords, and that it cannot be translated into other languages, for example! Ex. the name of an object inside style, must be unique, because it will be the one that will receive the updates.
  16. programmerdelphi2k

    Custom TListBoxItem Live Bindings Advice

    First, you should choice between VCL or FMX frameworks! each one have your propose distinct for generate your GUI, same than the components have a similar appearance, including some properties/methods! VCL to MSWindwos only! = 1 platform basically, this the MSWindows world, then, think in this world! FMX to MSWindows, Linux, macOS, (mobile Android, iOS ) = multiplatform! more flexible components usage! basically, any component can be a container to anothers components! then, you can put a "TImage" in your TListbox item, or TLisView item for example! currently, games are created using this framework, because your caracteristics to draw your graphics on screen of course, a skilled developer will question this point, as a lot can also be done in VCL and third party libraries!!! at general, think that "two frameworks distinct in much aspects", but with similar propose! at general, do mix two propose! after this, you can choice how to show your list? TListBox = vertical arrangement of data, in 1 colum TListView = vertical arrangement of data, in more than 1 column (using property ViewStyle) at general, two components has its indications of use, for example: TListView used used to display a much larger amount of data than TListbox... (now what is "large amount of data", it's up to you to define it) any way, both components are not data aware, that is, they are totally dependent on the "LiveBinding" or any other means that the programmer wants to interact with the data on the screen Now, between TClientDataset and FDMemTable, for sure, FDMemTable it is much more flexible, and the FireDAC framework works practically with any current data source, whether using Database driver, ODBC (for text files, csv, Excell, etc...), you will even find it very easy to use for the pretense of using JSON, although this is not the focus of FireDAC! But there are classes to make the job easier. FDMemTable works natively with XML, JSON, FDS (FireDAC in binary mode) - saving or reading data from a dataset Whether for MSWindows or other platforms, you can choose FireMonkey without fear of making a mistake!
  17. programmerdelphi2k

    Attempt to release mutex not owned by caller

    and me, dont talk with you! ... just these time!
  18. programmerdelphi2k

    Attempt to release mutex not owned by caller

    "TLockGuard = class( TInterfacedObject)" is not a "interface at all", but a obj (type TObject) interfaced (using IInterface as its ref-counter)! then, when creating a new obj based on "TInterfacedObject" class, you'll get a "TObject interfaced", and needs define when destroy it... using "FREE" is the variable was defined as "var X : TLockGuard". Else, if it was defined as "var X : IInterface", then, the refcount into in action! where "nil" will go decrement its ref-counter! implementation {$R *.dfm} type TMyHack = class(TInterfacedObject); type TLockGuard = class(TInterfacedObject) end; var ALock: IInterface; // } TLockGuard; procedure TForm1.FormCreate(Sender: TObject); begin ALock := TLockGuard.Create; // Caption := TMyHack(TInterfacedObject(ALock)).RefCount.ToString; // 1=Interface, 0=class end; initialization ReportMemoryLeaksOnShutdown := true; finalization ALock := nil; // based on a Interface // ALock.Free; // based on a class
  19. programmerdelphi2k

    Attempt to release mutex not owned by caller

    if your new class inherited from "TInterfacedObject" defined as: => class(TObject, IInterface), then, would necessary or: add a new custom-interface (your) on class definition: TLockGuard = class(TInterfacedObject, IYourInterfaceCustom) or use a default, like IInterface, maybe "IUnKnown" then, you can just nil'ED to call the "destruction"
  20. programmerdelphi2k

    TClientDataset gives access violation when open

    my tip: verify all points where your "query/clientdataset" is used! try verify if exists any try to access/changes state (open/close/edit/etc...)! it's not easy think if none code is showed
  21. programmerdelphi2k

    Attempt to release mutex not owned by caller

    constructor Create(mtx: TMutex; name: String = ''); the "obj" Mutex is not been created on this class, but only "Acquired", then needs "free or release" on the "origin" not in this class! I believe that would be this: type TLockGuard = class(TInterfacedObject) private FMutex: TMutex; public constructor Create; destructor Destroy; override; // procedure MyTaskNeedsAMutex; end; { TLockGuard } constructor TLockGuard.Create; begin FMutex := TMutex.Create(); end; destructor TLockGuard.Destroy; begin FMutex.Free; inherited; end; procedure TLockGuard.MyTaskNeedsAMutex; begin FMutex.Acquire; try // do the task finally FMutex.Release; end; end;
  22. programmerdelphi2k

    How to open a file in the already running IDE?

    my bet would be "verify if a [process] is running and call it with your params", else, run the process! that way, you avoid any Conflict of interests!
  23. programmerdelphi2k

    FMX Resize / StartWindowResize

    Look, "StartWindowsResize" is called JUST 1x in all framework FMX, and this called is done in "procedure TCommonCustomForm.MouseDown"!!! try "Find in files" by "StartWindowResize" in your RAD sources and see for youself! other hand, "resize" procedure is called by "any try of resize your forms", be using mouse or by code! until when creating a form your "resize event/procedure" can be called!!! another thing, forget the direct relationship between VCL and FMX!!! two frameworks works distinctly in almost all, sometimes until in RTL functions! my tip: use a "flag" to prevent any situation like "start/stop" a task for example! Form.RESIZE: Occurs immediately after the form is resized LFlagExecuteVideo = true; Form.Paint: Occurs when the form is redrawn. = LFlagExecuteVideo = false;
  24. programmerdelphi2k

    problem on update sdk ndk in delphi 11

    read my comment
  25. programmerdelphi2k

    Global Variable value "resets"

    For sure, I dont know! Because each case is a case! It would be +/- : uses System.Generics.Collections; type TMyObjList = TList<string>; // example using "strings", but can be any others types, including other objects // TMyObjList = TList<MyType>; var MyObjList: TMyObjList; ... // to start jobs, you would create a list MyObjList := TMyObjList.Create; // .... // // accessing items you would have protect it before any read/write to avoid conflicts // using TMonitor, TCriticalSection, etc... // xxxx.Lock( MyObjList ); // MyObjList.Add('message...'); MyObjList.Items[ 0 ]; MyObjList.Remove('message...'); MyObjList[ 0 ] := 'message...'; // after read/write you release the object xxxx.UnLock( MyObjList ); //.... // // at end "all" (for example, end app) you can destroy the list MyObjList.Free; better would be have yourself "class" to easy acess to your list
×