Jump to content

Anders Melander

Members
  • Content Count

    2561
  • Joined

  • Last visited

  • Days Won

    133

Everything posted by Anders Melander

  1. Anders Melander

    OleSetClipboardData and delayed rendering

    The clipboard will synthesize some formats from others (e.g. CF_TEXT from CF_UNICODETEXT) but only if the target asks for that format and only if the source hasn't already provided it. See Synthesized Clipboard Formats. Did you remember to specify zero for the hMem parameter of SetClipboardData? - and do you handle the WM_RENDERFORMAT and WM_RENDERALLFORMATS messages?
  2. Anders Melander

    OleSetClipboardData and delayed rendering

    Works for me. Here's what I'm seeing when I copy to the clipboard using the Drop Target Analyzer from the D&D Component Suite: I copied to the clipboard (blue bullets) and after a while (3.6 seconds) I pasted from the clipboard. The red bullets indicates the calls made from the drop target to the drop source. The list on the right are the data formats requested by the drop target. As you can see there are no calls made on the IDataObject until I paste from the clipboard. Here's the corresponding view from the drop target (the Drop Source Analyzer): Maybe you have an application running which monitors and reads from the clipboard?
  3. Anders Melander

    Fail faster than calling Connected := True?

    Why not just set the database connection timeout to the desired max. Connecting to the server with some other method fileshare/port 3050/whatever amounts to the same thing. The only reason they can get the result faster is that they have a smaller timeout defined.
  4. Anders Melander

    Fail faster than calling Connected := True?

    I think your only option is to lower the connection timeout if you want it to fail faster. The timeout is there for a reason so lowering it will also mean that you become less resistant against connection issues. Don't try to use the file system to verify the existence of the DB server. The server might not have the required ports open or the file sharing service available. Perfectly normal (and good sense) for a DB server. You could try to do a ping against the server but again, there's no guarantee that the ICMP service is available and you will still have the same problem of not knowing if lack of response means the server is down or if it's simply a transient connection issue.
  5. Anders Melander

    'as' operator??

    I think Pascal Analyser is wrong in this case. If PaPInAddr is a pointer type then 'is' and 'as' can't be used since these only operate on object types (i.e. object references/pointers).
  6. A memory mapped file can not be expanded. By design. Of course you can emulate expansion by closing the current view, expanding the file and then mapping the file again, but that is not a safe operation as any existing pointers to the old view will now be invalid.
  7. A search on my HD for TMemoryMappedStream found a few different implementations. The attached one, by Dmitry Streblechenko, looks to be the cleanest and it has no dependencies. dstreams.zip
  8. Anders Melander

    Love your competitor :-) ..... ?

    *cough* Visual J++ *cough*
  9. Anders Melander

    Love your competitor :-) ..... ?

    Anyone can file a lawsuit and if you have to resort to that in order to keep your employees then maybe the competitors isn't the problem you ought to focus on.
  10. Anders Melander

    Are there any experiences with www.experts-exchange.com ?

    Experts Exchange... the MySpace of QA sites
  11. Anders Melander

    Love your competitor :-) ..... ?

    BS indeed. Borland/Delphi was never any threat to Microsoft and certainly not to their Windows division. It would actually have been counter productive for the Windows division to sabotage any Windows application. - and they didn't "steal" Anders Hejlsberg or hire him to hurt Borland. They wanted his talent and he went by his own choice and for his own reasons. Borland didn't own him and if they got hurt by his departure that was their own fault.
  12. Anders Melander

    MAP2PDB - Profiling with VTune

    Nice! Any idea about who the author is?
  13. Anders Melander

    IDE search and regular expressions

    I don't think you can match a regex across lines as you'd either need to specify the /s regex option (. matches newline) or use the \n meta character and the IDE's regex doesn't support either. I do wish they would replace the IDE regex engine with something more complete.
  14. It's just data. Under the question "What do you do when you get stuck on a problem" I filled in "Masturbate". I hope they use that for a good cause 🙂
  15. The code you've shown is using VCL drag/drop. You can't use that to drag between applications. What kind of data are you transferring? If you just want to react to the action of dragging one label to another (in two different instances of the same application), then you can either register a custom clipboard format (see the CustomFormat examples) and drag that or you can just "misuse" the text format and drag some magic text string. It's really very simple: Put a drop target and a drop source component on the form. Register the label as a drop target and do what ever you need to do in the OnDrop handler. In the label OnMouseDown handler use DragDetectPlus to detect the start of a drag and then initiate the drag on the drop source. If you don't want the user to be able to drag from and drop on the same label, then disable the drop target when you start the drag and enable it again when the drag is done. If you can get 1-3 working within the application then it will also work between two different instances of that application.
  16. In case anyone else wonder what to specify for the Development Environment, we have to type in "Delphi", "C++ Builder" or "RAD Studio" (RStudio is something else).
  17. Anders Melander

    nil v self in form create??

    Regardless of how it affects the instance ownership, if the Form has Position=poOwnerFormCenter then the Owner should be specified Otherwise it will fall back to poMainFormCenter.
  18. Anders Melander

    Getting Exception stack trace in 2021

    You probably read it here: https://wiert.me/2017/08/02/delphi-call-stack-from-exception/
  19. Anders Melander

    Getting Exception stack trace in 2021

    Potato, Phothatho
  20. Anders Melander

    Showcase @Emba - should i?

    Download source: 1 minute. Browse through source: 3 minutes Write wise-ass response here: 15 seconds. As far as I can tell there are no 3rd party dependencies, it's VCL and Delphi Pro should be sufficient. The project files (dpr, dproj) seems to be missing though so good luck building it...
  21. Anders Melander

    How and when install the Patches.

    Did you read this pinned topic:
  22. Anders Melander

    Micro optimization: Math.InRange

    No. As Stefan pointed out, if AMin is smaller than AValue... IsInRangeEx(0, 1, 2); ...you will get an Integer Overflow.
  23. Anders Melander

    Micro optimization: Math.InRange

    ... can cause overflows. Consider the extremes.
  24. Anders Melander

    How can I make a fsStayOnTop form the active form?

    TForm.SetFocus maybe. Otherwise I would think TForm.Show would activate the form - regardless of it being already visible.
×