September 2005 - Posts

VB.NET and STAThread / MTAThread - Windows 2000

I ran into a strange issue today at a client involving a large VB.NET project.  One user on a Windows 2000 machine was having the app lockup when trying to open a SaveFileDialog.  After doing some searching, I ran across a solution for C# apps where if the app was running in MTAThread model it would occur.  Because WinXP supplies it's own message pump for it's Common Dialogs, but Win2000 does not, the solution was to make sure that [STAThread] was specified for the main function.

The odd thing is that VB.NET is setup to run as STAThread as default.  Nevertheless, I stated explicitly in the VB app to run as [STAThread] and the issue went away.  Not sure how / why the VB app got out of it's default mode, but something odd going on there that I'll have to investigate further.

So in summary if you are running a .NET app on Windows 2000 that has either:

  1. Common Dialogs hang when opening
  2. Copy / Paste throws an exception (this is the other problem I ran into)

You  may want to check the apartment threading model.

 

Sending Large Files with YouSendIt

I just found this nice free service where you can send files up to 1GB in size.  YouSendIt.com simply asks for an email address to send to, file to send and optionally the from and a message.  The recipient receives a notification email with a link to download the file.  The files stays on their servers for 7 days after which it is deleted.    They also have a secure site using HTTPS for those that need it.  Pretty handy little service.  They allow you to prepopulate the to address if you wanted to link from your website say.  They seem to make their money through advertisments on the page the recipient goes to pick up the file (although sometimes I don't seem to get an ad)

Just so I don't sound too much like an commercial for them.  I have been a bit disappointed with their support.  I emailed them twice asking about the possibility to prefill not only the recipient field but also the from, file and message through a querystring parameter and have yet to even receive an aknowledgement email, perhaps I've been too impatient, but even though this is a free service, it would be nice to recieve some sort of acknowledgement that they at least received my email.

Posting Here Again Perhaps

I may start posting here again soon, possibly cross posting between here and DevAuthority. Here is my Technorati Profile