Hi, I’m VCL and I’m WinForms

 
VCL: Hey, WinForms how’s it going?


WinForms: Oh, being here on Vista is great. VCL, what’s up with your Form?


VCL: Yeah, that. That’s my new SheetOfGlass property, part of my native support for Windows Vista UI in Delphi 2007.


WinForms: Ah, so you’re specific to Windows Vista. Well, not me.


VCL: Well, no. With just one Delphi executable you’re good to go on Win98/ME, 2000, XP, 2003 and Vista.


WinForms: Just one file?


VCL: Ah yeah, what about you?


WinForms: Uh, well…, I need the .NET framework 2.0. And that needs IE 5.01. Oh, and Windows Installer 3.0 (except for Windows 98/ME, which requires Windows Installer 2.0 or later). Though Windows Installer 3.1 or later is recommended. Oh, whatever, here‘s the rest.


VCL: Yowza.


Hey, it’s Friday afternoon before a long weekend and with all the “I’m a…” ripoffs I just couldn’t resist. :-)

Creative Commons License
This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

26 thoughts on “Hi, I’m VCL and I’m WinForms

  1. I’m calling shenanigans…

    Citing all the things a winforms app needs for glass under vista isn’t really relevant, since all that comes with vista.

    It would be equally fair to claim that your VCL glass app needs VISTA as a deployable option too…

  2. Its nice to see many of the win32′ers point of view, I dont dispute that .net has a big set of librarys behind it, but to use them you need to have installed it all, where as win32, you can just compile them into your exe and ship that knowing all you need is inside..

    So many .net’ers say but ours does all *this* built in.. but its not *built in*!, .net is a major bunch of libraries yes, but Id like to argue its no more built in than shipping DLLs with your app to make it work, its not built in, you need to have installed the 200mb framework before it will run..

    Anything relying on a major bunch of external libraries can add a that potential for them to be missing, removed, corrupted, not the ones you used…

    I think theres room for everything, these days it is more likely that a computer has .net, but, if it doesnt?? if you wanted to create an installer that installed all the potential bits over raw windows your app needed, my win32 app installer is about 2mb, which includes a helpfile thats bigger than the exe! if it were .net, the app would do no more than it does now, it probably wouldnt be that different to have written, but Id have to include the .net stuff so the installer would be like 202mb..

    On the other hand, my app can go on a USB key and be used where ever the key is.. no matter what the windows was.. and whats installed..

    no .net app could claim that.

  3. The sheet of glass looks quite nice, but I noticed some painting issues which would stop me from using it.

    The icon at the top left needs to anti-aliased and there is a black border background around the button. Did you forget to set a few properties or are these bugs in the VCL? If so are you guys going to fix this in a next release?

  4. Jan,
    Of course, the icon is the stock Delphi icon which can and should be replaced by the developer with something more relevant to the application. I’ll investigate the non-client drawing and see if there is an issue there, controls on Glass need DoubleBuffered set to true so the text isn’t transparent though it’s possible more needs to be done to make the drawing look even better.

  5. Good that there is .NET and VCL.NET which gives Delphi developers access to both. Would have been nice if you mentioned that as a constructive alternative as well instead of just criticizing :-)

    I would not want to miss the flexibility .NET gives me, but I also love the VCL-way to write client apps with Delphi.

  6. Liz -> While it is true that dotNet is a new feature to the OS, it is unfair to characterize it like you have. Apps can quickly develop OS version dependacies and these can EASILY sneak their way into Delphi apps if you use things like toolbars, imagelists, and even listviews.

    Every version does something new.

    And in all fairness, you can’t just run your win32 app on any system either. It has to be preloaded with windows, not linux, unix, bsd, or any of apple’s OS variants.

    So ya, dotNet isn’t universal yet, but neither is windows.

    And as for corruption… I’m betting any of your app use at least 4 or 5 libraries in a windows system that can become corrupt.

    Again, I don’t argue that dotNet isn’t everywhere, but I think that denigrating it because of that is mighty silly.

    Steve -> yes, enjoy your long weekend, I had mine last week (<cough> canuck! <cough>)

  7. If I were VCL, I wouldn’t bet my future upon just some glass frame support – that’s just the tip of an iceberg. It’s what below that makes a framework worth to be used – and in many areas (RTL, containers, Unicode support, etc.) VCL is unluckily far behind .NET now because development slept for a looooooooooooooooooong time. Vista support is welcome, but don’t get too proud – you have a lot of work to do to bring VCL up to the top of the hill – and .NET won’t leave that place easily.

  8. Delphi: Hi there, who are you?

    WF: Oh I’m Work Flow.

    Delphi: What do you do then?

    WF: Well I can save users a lot of time during the design and implementation of business processes and take care of things like persistance, delayed running, parallel execution, etc.

    [KNOCK KNOCK]

    Delphi: Who is it?

    WF: Oh look, it’s my friend WCF.

    Delphi: WCF? Who’s that?

    WCF: I’m Windows Communication Foundation.

    Delphi: And what do you do?

    WCF: Well, not much. I just offer a complete framework for developers to entirely seperate their business logic from the communication logic, allowing minor things such as reliability, security, interaction with different technologies, etc to be handled with small configuration files, without users needing to develop and accomodate their design to different types of interaction with both new and legacy system.

    Delphi: Hmmm…. well that’s cool.

    WF/WCF: So, anyway Delphi, what do you offer?

    Delphi: Well……

    Delphi: Btw, did I tell you I can run an app on Vista without the .NET framework? And it has glass support too!!!!!

    WCF: That’s cool, sorry Delphi, we gotta get out of here. Meeting our friend WPF.

    Delphi: WPF? What’s that?

    [Narrator: Exactly Mr. Delphi, what is that? And where is WF and WCF? Don't you think you should have worried about this "minor" things some years ago instead of boosting the lack of DLLS' you need to run an application (obviously you don't need any of the Win32 system DLL files either right?)]

  9. Well, Steve, is nice to have it, of course, but if this is all…

    You must steer where .NET is sensible (ie. performance and resource consumption due its VM architecture) and implement the .NET advantages on the native side. You are lag behind now, but OTOH you have the advantage that you can learn from the other’s experience and your time to market should be much shorter when it comes to implement the other’s findings. Also, you have time to spare for new in-house findings.
    But don’t forget that the Delphi killer was (and is and will be, *if* will be) the pride. IMHO, I think that we all must know who we (really) are, and where we are because then we’ll know what to do. And don’t be afraid of .NET. You must afraid of Steve Trefethen because no one can harm Steve Trefethen except Steve Trefethen.

    Now, back to work and "Wii have something to learn from Nintendo". We have _many_ things to do.

    hth.

  10. Seems there are a few [loud, opinionated, the glass is half empty] people out there without much of a sense of humor. For the record, I thought your post was funny and a nice reminder of what a great product Delphi is.

  11. Hi Charles,

    When when you have so million lines of code, users demanding new functionality like those described and no path to offer them via Delphi, it’s kind of hard to have a sense of humour. It’s hard to laugh at jokes like this when you’ve lost business due to lack of faith of your customers in the tools you use to provide them solutions.

    If Borland offered us this now, then yes, this would be funny and my comment would be out of place.

  12. For Charles Vinal & User with a touch with reality: If I were a Fortran programmer working at NASA and I were closed in my lab for 20 years with all the things needed for a decent life I would agree with Charles. But I’m not. You see, Charles, the great pain is that, in deed, Delphi is a great product *theoretically* and is rather obvious that the Pascal syntax is better than sscanf, printf, ++>>^ and other cryptic symbols of C/C++/Java/C# family of languages (Steve, you have another sensible point on which you must steer – improve the existing Pascal language). But many _human_ factors excercited in the past a great (negative) pressure over _technical_ ones (Perhaps you know what I’m mean) and now the present CG team must pay for this. You see, the one which wrote *User with a touch with reality* expressed one of the biggest problems here. Borland lost the contact with reality and did things which theoretically are very wise ones (Kylix, Delphi 4 Net), but in practice they fail because they didn’t want to listen to the community. Someone (Edsger Dijkstra) said that "The people who are best at programming are the people who realize how small their brains are." The best programmers are humble. You must realize that the community are better than you. You must listen to them. After all, for them you’re working, isn’t? Just for the record, on how the thinking must shift one of the best blog posts can be found at http://hallvards.blogspot.com/2007/05/use-full-fastmm-consider-donating.html
    (Well perhaps our "User with a touch with reality" was speaking a little bit, oh well… but who can blame him? And, also, can you prove that he doesn’t have "a touch with reality"?

    You see, reality is our game. Reality is rather a person, not a blind existence. And we fight with our perceptions about reality.

    my 2c.

    (I’m sorry if I’m harmed someone…)

  13. All interesting comments and I’m not sure what the best way to respond is but here goes. Delphi is a tool it’s not a pre-canned solution. When applied correctly it can be a very powerful tool that allows you to quickly solve problems in an elegant way. As with any job using the best tool is will always be considered a wise decision. Clearly all tools have their limitations and CodeGear is working to expand the usefulness of Delphi and the addition of Vista support to the VCL is a small, though useful example. Mind you that support it was done without breaking backwards compatibility with BDS 2006 which is something I think Delphi users can appreciate.

    For me, this post more underscored the fact that Microsoft is moving so quickly that they somehow forgot Windows Vista UI support in their frameworks including WinForms and MFC. The funny thing is that I don’t think the did forget, their not like that. They’re far more calculating and it’s entirely possible that the delayed inclusion of Windows Vista support in WinForms as a way to push away from WinForms to XAML though time will certainly tell. I think the same is true for the MS AJAX library in that it may well take a back seat to Sliverlight which is perhaps why the MS AJAX control library isn’t part of the core AJAX bits nor officially supported.

    Unmanaged C++ is another story and one where I believe Microsoft may be in the midst of a mea culpa which is why various blogs at MSDN are now talking about MFC’s new Vista support in the forthcoming release of Orcas expected sometime late this year. That video is clearly a bear hug to the seemingly forgotten masses of unmanaged C++ developers. If you haven’t read this post please do as you’ll see that with all the tech pouring out of Redmond no one wants to blog about exactly how you drag VB customers into .NET one form at a time. Why is that? That’s easy, it’s mundane, not flashy, boring and just plain not fun though reality.

    I think attempting to draw conclusions about access to WF or WCF or the mirad MS alphabet soup is not only an apples to oranges (or worse) comparison but misses the point of this post completely. VCL and WinForms are the only two technologies mentioned and they’re frameworks geared towards delivering Windows UI applications. Though if you’re coming from pre-.NET MS technology you’re looking at a complete rewrite to move to WinForms with XAML right around the corner.

    All that said, I’ll be the first to agree that the Delphi compiler is behind WRT .NET which IMO is something CodeGear needs to address asap. Once that’s done a lot of these avenues into all this new MS technology open up.

    I’ll wrap it up here but as always thanks for reading. I think dialog like this, good or bad, is in my mind positive and means people are talking, thinking and passionate about the issues.

  14. I don’t know how wild I am about the SheetOfGlass feature, but the theme support for the TreeView and ListView certainly look better in Delphi.

    Was SP1 for Vista applied to this copy of Visual Studio?

  15. VS.NET 2005 Version 8.0.50727.867 (vsvista.050727-8600) with Update for MS VS2005 KB932232

    I think you have to install SP1 when running VS.NET 2005 on Vista.

  16. Bruce,
    Btw, I’ll agree that the SheetOfGlass isn’t something that I think is generally useful. The Glass support in the VCL allows you to define a non-glass client area on the form as well.

  17. Steve,
    This suggests Delphi has better Vista theme support then WinForms. Is this the case?

    That would be kind of cool. :)

  18. This suggests Delphi has better Vista theme support then WinForms. Is this the case?

    no. it is not the case. delphi’s current "aero" support is fairly poor, and is very much a kludge.
    this blog post is "truthfull" in the same way as those apple mac adverts are "truthfull".

  19. Do you have any specifics?

    sure. first, in delphi you have the problem that is caused by the hidden form created by the VCL’s application object. This form plays havok with a Vista applications ability to properly minimize/maximize itself. It also causes problems with the Vista taskbar and Task switcher.

    one of the workarounds is that the programmer must explicitly set the extended style of the Application’s main form. ex:

    //——————————————————————————
    procedure TfrmMain.CreateParams(var Params: TCreateParams);
    begin
    inherited CreateParams(Params);
    Params.ExStyle := Params.ExStyle and not WS_EX_TOOLWINDOW or WS_EX_APPWINDOW;
    end;

    //——————————————————————————
    procedure TfrmMain.WMSyscommand(var Message: TWmSysCommand);
    begin
    inherited;
    case (Message.CmdType and $FFF0) of
    SC_MINIMIZE:
    begin
    ShowWindow(Handle, SW_MINIMIZE);
    Message.Result := 0;
    end;
    SC_RESTORE:
    begin
    ShowWindow(Handle, SW_RESTORE);
    Message.Result := 0;
    end;
    else
    inherited;
    end;
    end;

    now, because VC++/C# does not have a hidden Application proxy form, it does not suffer from this kludge.
    There are other (more serious) problems, such as Delphi’s Memory Manager leaks while running under Vista, VCL components not redrawing properly when placed on a form with the new GlassFrame property enabled….

  20. In my Delphi 2005 when i try to start a VCL Forms it says that: "the project already contains a form or module named Unit1". I do not know how to solve this problem. Any ideas?

Comments are closed.