Jump to content

FPiette

Members
  • Content Count

    1194
  • Joined

  • Last visited

  • Days Won

    16

FPiette last won the day on September 2 2024

FPiette had the most liked content!

Community Reputation

391 Excellent

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. FPiette

    Embarcadero needs my location?

    I never got that warning. Does it occurs each time you run the IDE?
  2. FPiette

    Embarcadero needs my location?

    Which version ? This could also be a component you've installed.
  3. FPiette

    Exception in AsyncReceive

    You can use the remote debugger. And as other said, using madExcept is an excellent choice. You'll also have a stack trace. I use madExcept a lot!
  4. FPiette

    Exception in AsyncReceive

    Is it possible for you to run the application under Delphi debugger? If you do, the debugger will show you the exact location of the exception and a stack trace. Those are the best information to understand where and why the exception occurs.
  5. FPiette

    Multithreading

    Open a new discussion with a correct the question. And add as many details as possible from your code. Without details, we cannot help much. I also suggest you create a minimal reproducible sample program which demonstrate the bad behavior you see in your actual code.
  6. Have a look at the sample OverbyteIcsConHttp.dpr in ICS distribution.
  7. The write such a function, your have to open the file and check his content to see if is what the file extension pretend. Each file has a specific internal file format, usually in a header. You have to look at the specification for each file format and write code to do more or less serious checks. There is a website which could help you : https://docs.fileformat.com/
  8. FPiette

    Screenshot a Component

    I have this code: procedure TScreenDumpForm.ScreenDump( const FileName : String); var Stream : TFileStream; c : TCanvas; r1 : TRect; r2 : TRect; b : TBitmap; j : TJPEGImage; begin c := TCanvas.Create; b := TBitmap.Create; j := TJPEGImage.Create; Stream := TFileStream.Create(FileName, fmCreate); try c.Handle := GetWindowDC(GetDesktopWindow); try r1 := Screen.MonitorFromWindow(Handle).BoundsRect; r2.Top := 0; r2.Left := 0; r2.Width := r1.Width; r2.Height := r1.Height; b.Width := r1.Width; b.Height := r1.Height; b.PixelFormat := pf24bit; b.Canvas.CopyRect(r2, c, r1); j.CompressionQuality := 60; j.Assign(b); j.SaveToStream(Stream); finally ReleaseDC(0, c.Handle); c.Free; b.Free; j.Free; end; finally Stream.Free; end; end;
  9. FPiette

    Connection refused issue

    After that happens, is the application start working again without restarting it or one it happens no other connection is accepted. If no other connection is accepted, it could be that the listen socket has been closed unexpectedly. This could happens by a bug elsewhere leading to a CloseSocket or even plain winapi CloseHandle function is called with the socket handle.
  10. You are not using a debug version of the application because there is missing details in the stack trace. Make sure you rebuild all, including the components.the debugger should show the excat line where the exception occurs.
  11. Please build using debug configuration and run with the debugger. Then when the debugger hit the exception, copy the call stack and the code around the error, and paste it here.
  12. FPiette

    Guidance on FreeAndNil for Delphi noob

    You can keep this code. It is equivalent to FreeAndNil(FMyObject). Do whatever you feel most readable for you.
  13. FPiette

    Guidance on FreeAndNil for Delphi noob

    I always use FreeAndNil, even if it is the last line of a method. Why? Because my code evolve, I can copy/paste it somewhere, add line,... If the object variable (Actually a pointer btw) is nullified, I'm sure I'll get and exception if I forgot I can no more use that object reference. The impact on performance is nearly null. But all rules can be ignored sometimes...
  14. FPiette

    ICS V9.4 announced

    Since the internal error is in OverbyteIcsWinsock.pas, I suggest you build the simplest console project using the file and produce the internal error. The project doesn't have to do real things. Since URW1111 is an internal error, compiling is enough. Then remove (comment out) code chunks in OverbyteIcsWinsock.pas until the error disappears. Then reduce the size of the offending chunk until you find the line causing the error. This is for sure a long process... Report the offending line here.
×