-
Content Count
2561 -
Joined
-
Last visited
-
Days Won
133
Everything posted by Anders Melander
-
OleSetClipboardData and delayed rendering
Anders Melander replied to pyscripter's topic in Windows API
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? -
OleSetClipboardData and delayed rendering
Anders Melander replied to pyscripter's topic in Windows API
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? -
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.
-
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.
-
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).
-
TFileStream for memory mapped files
Anders Melander replied to AlexBelo's topic in Algorithms, Data Structures and Class Design
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. -
TFileStream for memory mapped files
Anders Melander replied to AlexBelo's topic in Algorithms, Data Structures and Class Design
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 -
Love your competitor :-) ..... ?
Anders Melander replied to FranzB's topic in Project Planning and -Management
*cough* Visual J++ *cough* -
Love your competitor :-) ..... ?
Anders Melander replied to FranzB's topic in Project Planning and -Management
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. -
Are there any experiences with www.experts-exchange.com ?
Anders Melander replied to Rollo62's topic in General Help
Experts Exchange... the MySpace of QA sites -
Love your competitor :-) ..... ?
Anders Melander replied to FranzB's topic in Project Planning and -Management
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. -
StackOverflow annual developer survey needs Delphi developers answering the survey
Anders Melander replied to FPiette's topic in General Help
Rule 34 -
MAP2PDB - Profiling with VTune
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
Nice! Any idea about who the author is? -
IDE search and regular expressions
Anders Melander replied to Jacek Laskowski's topic in Delphi IDE and APIs
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. -
StackOverflow annual developer survey needs Delphi developers answering the survey
Anders Melander replied to FPiette's topic in General Help
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 🙂 -
Drag and drop component between applications
Anders Melander replied to FabDev's topic in RTL and Delphi Object Pascal
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. -
StackOverflow annual developer survey needs Delphi developers answering the survey
Anders Melander replied to FPiette's topic in General Help
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). -
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.
-
Getting Exception stack trace in 2021
Anders Melander replied to Wagner Landgraf's topic in RTL and Delphi Object Pascal
You probably read it here: https://wiert.me/2017/08/02/delphi-call-stack-from-exception/ -
Getting Exception stack trace in 2021
Anders Melander replied to Wagner Landgraf's topic in RTL and Delphi Object Pascal
Potato, Phothatho -
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...
-
How and when install the Patches.
Anders Melander replied to Juan C.Cilleruelo's topic in Delphi IDE and APIs
Did you read this pinned topic: -
Micro optimization: Math.InRange
Anders Melander replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
No. As Stefan pointed out, if AMin is smaller than AValue... IsInRangeEx(0, 1, 2); ...you will get an Integer Overflow. -
Micro optimization: Math.InRange
Anders Melander replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
... can cause overflows. Consider the extremes. -
TForm.SetFocus maybe. Otherwise I would think TForm.Show would activate the form - regardless of it being already visible.