Tuesday, July 20, 2004
Delphi Basics..
I am not Danny, nor is Danny, I
Monday, July 19, 2004
Mark Edington is now blogging
Saturday, July 17, 2004
Message methods in Delphi for .NET
TBaseClass = class(TWinControl) procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; end; TNewClass = class(TBaseClass) procedure WMLButtonDown(var Message: TMessage); message WM_LBUTTONDOWN; end; ... procedure TBaseClass.WMLButtonDown(var Message: TWMLButtonDown); begin inherited; { special processing here } end; procedure TNewClass.WMLButtonDown(var Message: TWMLButtonDown); begin inherited; { more special procesing here } end; It seems that the compiler will generate a raw call to the inherited method when it sees the "inherited" keyword without doing anything with the paramter. The ancestor's message handler will now treat the TMessage parameter as if it were a TWMLButtonDown message cracker. This wreaks havoc on the .NET runtime, but not in the way one would expect. One would possibly expect exceptions like invalid casts. However there is actually no telling what might happen. It actually react just as randomly as if you'd taken a random Integer value and cast it to an object reference then proceeded to call methods or dereference it. Now, of course the above code doesn't pass PEVerify, and had I actually thought to do that I would have seen the problem. So for all you component developers out there moving your Delphi components to Delphi 8 for .NET, just keep this in mind. You should declare your descendant message methods to match the ancestor's declaration (even though it is not required in Delphi for Win32). Yes, Danny and I are going to be working on some solutions to this delima for a future Delphi for .NET release.
Thursday, July 15, 2004
Busy days...
Wednesday, June 30, 2004
To float or not.. redux..
What I always wanted to know, but were afraid to ask: Why is the default Form position poDesigned and not poDefault?This will take a bit of a history lesson. When we were designing Delphi (back in, oh, 1993), we had already chosen the "floating" designer as the design-time model. We had a specific design goal for the user experience that when they hit the "run" button, it simply felt like the application simply "switched" from design-mode to run mode. We used the high-speed compilation to our advantage. By defaulting to poDesigned, the application would simply have the appearance of simply "turning-on" since it didn't appear to physically move on the screen. There was a lot of internal debate on this very topic, but frankly, the product demoed *very* well with the poDesigned. In fact sometimes it was actually difficult to convince folks that we had actually compiled the application and that there is now a stand-alone .EXE on disk.
As Marc has written the argument of the out of screen forms is so simple to fix without an embedded form designer as I can't even believe you count that as an argument for the embedded designerSure. However, one thing you have to remember is that a design-form is a live instance of a VCL form. So, when you set the Left/Top properties, the form will physically move on the screen, and the module is marked as modified. We go to tremendous lengths to not modify any file as a side-effect of opening it in the IDE. Of course there are potential solutions, but few are minimal, or non-invasive.
Thanks for the feedback on the look of the blog. I'll still be tweaking it as I can get to it.a) A somewhat wider right text margin, (I keep worrying that I'm missing nonwrapping text)
b) Scalable text size...
Tuesday, June 29, 2004
To float to not to float...
The embedded designer makes for a cleaner, more controlled environment. You always know where the designers are located, you are insulated from your co-workers that have screens with laser-printer resolutions placing the design form at some location that is someplace off screen. The designer also can display the border style of the form in the actual style that it will end up being rendered as. And, there is just a feeling that everything is more organized and more "under-control" with the embedded designer. There isn't this haphazard arrangment of windows with all your other applications peeking at you from between the cracks.
In the other camp, there are some things that the top-level "floating" designer does that simply cannot be done as easily with the embedded designer (and by extension, a single-window docked IDE). You can design a form that is at or near the actual screen resolution much easier since there is no "frame-overhead" for each designer. You can arrange the forms in such a manner that you can see several at once, which in the case of inherited VCL forms, is very helpful when modifying an ancestor form so you can see the live-updates on all the descendants and determine if moving the "OK" button will obscure something on any of the descendants. While, personally I prefer to dynamically position the forms at run-time, you can set the form position to "poDesigned" and manually arrange all your forms in the locations in which you want them to appear at run-time. Then there are the issues regarding the more frequent use of multi-monitor systems where developers will use the primary display to position the design-time forms, and use the secondary display for the menus, code-editor, OI, and other design-time/editing support windows.
Now before you start warming up your flamethrowers and start indiscriminately spewing expletives regarding your disdain for one style or another, just understand, that this issue has been heard loud and clear and we are looking into ways to address the issue for a future Delphi product release.
Friday, June 25, 2004
New Skin...
Wednesday, June 23, 2004
Welcome...
Monday, June 7, 2004
Anders Hejlsberg still evokes all manners of awe..
Chris Sells' post, My First Presentation For A Distinguished Engineer, underscores the level of respect and awe that Anders Hejlsberg still commands as a Distinguished Engineer at Microsoft. It is just interesting when other folks seem to be thoroughly enthralled and "star-struck" about the fact that Anders requested a technical briefing. I worked very closely with Anders during the early days of Delphi (and TPW 1.5 and Borland Pascal 7.0), and I must say that he is certainly a very charismatic and approachable person. He has an uncanny knack of being able to tell you when an idea was complete bovine scatology, yet your ego and self esteem remained completely intact. In fact, while Danny and I were at the Windows 64-bit briefings back in March, Anders had specifically requested that we try and meet for lunch. Unfortunately, he is also a very busy man and we were unable to connect. Anders is certainly deserving of all the accolades he receives.