Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 08/27/23 in all areas

  1. This isn't true. Your class function calls the default constructor and that performs memory allocation. Free must be called. Instances of classes are heap allocated.
  2. Naming the constructor "Create" is just a convention. You can name it anything you like. Thus naming the constructor "From" will not make a difference. Here's your problem: Pascal isn't case sensitive so that code does nothing. Prefix your parameter names with "A" (i.e. name them AItem and AColor in this case) to avoid problems like that. FWIW, if you want to avoid memory allocation (i.e. allocate your object on the stack instead of the heap), make it a record instead.
  3. Ranja AZ

    Please need help for some java lines program to Delphi

    Thank you! The issue is resolved now. following code: procedure TForm2.Button2Click(Sender: TObject); var OpenResult : JMxResult; begin OpenResult := TJMxResult.Create; OpenResult := mSM62K2DriverApi.open(StringToJString('/dev/ttyS0'),115200); Memo1.Lines.Add(JStringToString(OpenResult.getMsg)); end; procedure TForm2.Button3Click(Sender: TObject); var OpenResult : JMxResult; begin OpenResult := TJMxResult.Create; OpenResult := mSM62K2DriverApi.close; Memo1.Lines.Add(JStringToString(OpenResult.getMsg)); end; procedure TForm2.FormCreate(Sender: TObject); begin CanPrint := True; DeviceEnginex := deviceEngine; Printerx := deviceEngine.getPrinter(); DeviceInfo := deviceEngine.getDeviceInfo(); POSModel := JStringToString(DeviceInfo.GetModel()); TJGeneralDdi.JavaClass.ddi_device_poweron; sleep(1000); mSM62K2DriverApi := TJSM62K2DriverApi.JavaClass.init; end; Regards.
  4. Arnaud Bouchez

    mORMot 2.1 Released

    We are pleased to announce the release of mORMot 2.1. The download link is available on https://github.com/synopse/mORMot2/releases/tag/2.1.stable The reference blog article was just published at https://blog.synopse.info/?post/2023/08/24/mORMot-2.1-Released Here is an extract of the release notes: Added (C)LDAP, DNS, (S)NTP clients Command Line Parser Native digest/basic HTTP servers authentication Angelize services/daemons manager TTunnelLocal TCP port forwarding SHA-1/SHA-256 HW opcodes asm 7Zip dll wrapper OpenSSL CSR support PostgreSQL async DB with HTTP async backend (for TFB) LUTI continous integration cross-platform farm Changed Upgraded SQLite3 to 3.42.0 Stabilized Mac x86_64/aarch64 platforms Lots of bug fixes and enhancements Any feedback is welcome! 🙂
  5. Back to On-Topic: @PizzaProgram If I were you, I would check the creation and destruction of ressources. It's mentioned already -- heading over the stream of messages led me to the fact it may got lost. Concentrate on the image/ressource creation and destruction - not on strings and ICS in the first place. GDI has been a problem in my company since MFC got popular (I know that MFC is not Delphi, but they share some problems - mostly hard to find bugs). Reuse your resources, resize if memory is a concern, do not recreate them. If this helps, you know how to keep the business running and you won time to solve the real problem. GDI and non-UI Threads are "special" friends... If I'm completely wrong, slap me.
×