The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

UI for a quick-and-dirty hack job... where do I start?

I have a buddy who insists on using Outlook Express as his email client, and it keeps locking up because the virus scanner goes into a coma if there are too many messages to scan.  Once a week or so he needs me to telnet in to his POP3 server and delete a bunch of his mailing list collections and forwarded jokes so OE can download the rest.  It occurred to me we would both be happier if he could do this on his own, so I should automate the process: grab the headers, present a picklist of message title/sender/subject, let him flag the ones he can live without, and delete them.  How hard can that be, considering that I know nothing about Winsock programming and the only languages in which I am proficient are decades-old console languages like Turbo Pascal and Clipper?

Learning Winsock was the easy part - I love Google [tm] - but now I'm in a quandary about the UI.  I wrote it in plain procedural C (did I mention I'm a dinosaur?).  The only kind of UI that I know how to do is console-based, moving the cursor around the screen with DOS interrupts (handled through Pascal and Clipper standard function calls).  Although my Free Pascal compiler has a sockets unit, it doesn't work very well and all the support forums have people complaining about the limitations.  So at this point, my choices are:
  - learn how to work around the socket limitations, recode my existing POP3 functions, and continue in Pascal
  - learn how to code for the Windows GUI (I did manage to get a "Hello, World" messagebox to work using Petzold's book) and come up with some flashy control... maybe a checkbox?
  - buy an expensive RAD package like Visual Whatever and create a 26-meg EXE with a list of third-party DLL dependencies the size of the New York City yellow pages
  - show up here and get someone else to do my thinking for me

I stumbled across this site doing a search for "user interface design", which led me to Joel's hilarious yet dead-on accurate story about the dough bins and the frustrated power user.  That's great advice in general terms about what users like to see, but right now I need more concrete advice:  What's the best way to present a picklist of anywhere from zero to a billion messages that will return back to the calling routine a list of which message numbers he flagged?

I don't care how platform-dependent the solution is, as long as I can write it on my NT4 box and run it on his XP and/or Win98 system.  As I say in the subject line, this was intended to be a quick-and-dirty exercise and I've already lost a couple of weeks of sleep just trying to grok winsock programming.

Any books, websites, FAQs y'all can suggest that will get me started on the learning process would be most welcome, along with biased speculation, inflammatory advocacy, and general ridicule.

{sigh} I miss gotoxy() and @ Y, X SAY...
Peter B. Steiger Send private email
Tuesday, November 02, 2004
 
 
I don't know, but you may be reinventing the wheel.

All you seem to be asking for is a pop3 client that shows headers and lets you delete messages serverside without downloading them.

It would surprise me if this hasn't been done.
I am Jack's wheel whacker
Tuesday, November 02, 2004
 
 
Look up the windows console API. An easy way is to find "AllocConsole" in MSDN, and look up the related functions. They should be easy to work out if you've used gotoxy and friends from Turbo C/Pascal.

Alternatively, add a list box to your dialog, with the multiple select style. List boxes can be easily filled, and the list of selected items easily retrieved when the OK button is clicked (or whatever).
Tom_
Tuesday, November 02, 2004
 
 
Jeremy Stein Send private email
Tuesday, November 02, 2004
 
 
Sounds to me like you'd be better off working with a higher level language if you've spent two weeks just getting to grips with a low level networking API. Perl, Java, Python all have easy to work with, high level APIs for networking and add-on libraries easily available to handle all the details of POP3 and they all have easy to work with GUI toolkits. I would guess Java would have the lowest barrier to entry for your needs. Or just google for 'POP3 client' or 'mail client' or pursuade your friend to switch to a less broken mail reader :-)
Laurie Harper
Tuesday, November 02, 2004
 
 
Delphi can cut standalone .EXEs and sometimes free trial versions are made available here:

http://www.borland.com/products/downloads/download_delphi.html

The trials may retain some reduced functionality after a period.

I have a noncommercial "personal version" of Version 6 which only contains a Client Socket and a Server Socket instead of the full range of Internet components, but you indicate you are quite at home with sockets. The standard GUI components are all there so you may be able to hook something together quite quickly with this Pascal syntax RAD.
trollop
Tuesday, November 02, 2004
 
 
Thanks for the suggestions, gang.  Jack's Wheel Whacker, I'm sure there are plenty of programs out there that would do pretty much what I have in mind; my desire to write one myself was the result of thinking that (1) I could throw it together in a couple of hours and (B) it would be a great learning experience.  Well, I was half right...

Laurie - in my defense, the two weeks it took me to write a half decent mail fetching routine were all done between 9PM and 2AM.  I guess I can't code in my sleep like I did in college!

Tom - yes, the wincon API was exactly what I was looking for.  Thanks!

Trollop - I actually have an old box of Delphi 2 or some similarly early version lying around.  I forgot I had it until you mentioned it... my company bought it for me when we were considering Delphi as the next generation for our DOS-based Clipper apps, then decided to go another direction instead.  What the heck, it's worth a try.  But no more of those 2AM sessions for me.
Peter B. Steiger Send private email
Tuesday, November 02, 2004
 
 
Most ISPs also offer a web based interface to your mail account so you can just hop on a web page and delete your messages that way.
Matthew Lock Send private email
Wednesday, November 03, 2004
 
 
If you know C++ and want to do a GUI app without spending your money on VC++ to do it with MFC, I highly recommend wxWidgets ... Pretty straight-forward API, barely any learning curve, and it's been around for a decade so there is a lot of development effort behind it for future improvements.

As an added bonus, your apps will run on linux and macintosh, if your buddy gets sick of windows and switches to linux w/ gnome or (heaven forbid) a mac, your app won't have to be rewritten (though it wouldn't be needed in that case since thunderbird doesn't crash like outlook :) )
Pete Send private email
Wednesday, November 03, 2004
 
 
How about you just make him install Thunderbird or a different virus scanner?

Or just write a console app, surely he can live with that? just present a list of the messages to be deleted in a console box and prompt to enter numbers for those to delete, eg 1,2,3-6

Any more than that seems like way too much of an effort for an ugly hack as a favour for a friend, if you haven't done any GUI development.
Concerned
Thursday, November 04, 2004
 
 
How much is your time worth? Just tell him to switch email programs, get a CDR if he doens't have one already and re-install windows, or to buy a different off-the-shelf virus scanner.
Ben Absky
Thursday, November 04, 2004
 
 
It seems like if the original application was written in pure C, one of the easier GUI toolkits to interface with it might be Tcl/Tk. 

I recognize that it isn't currently as in vogue these days compared to other cross-platform toolkits like Qt and WxWindows, but it still seems like one of fastest ways to create "quick hack" GUIs and has a fairly simple interface to C.  This last year it looks like its native look and feel has improved to be on or near par with other toolkits with the Tile extension.

In addition, deployment as a single file executable is reasonably possible using several different techniques (starkit/starpack, mktclapp, compiling interpreter into C program, etc.)
Connor Berry
Monday, November 08, 2004
 
 
Google MailWasher

Thursday, November 11, 2004
 
 
I'd guess you've got more than enough options here to get the job done.  I did something similar to this for my own email using a .Net component called ChilkaDotNet Mailman.  It let me do what you're talking about in just a few lines of code -- and I'd be happy to send them along it you're interested.
D. Lambert Send private email
Friday, November 19, 2004
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz