Digiwar - the Yeep-blog

November 18th, 2006

Windows Vista

So on friday Windows Vista was available for download at MSDN. Actually, it was available thursday night, so I got lucky and downloaded it before the big rush I guess.

After I got the download in, I burned it to DVD and started installing it on my laptop. Now, I use this laptop for work. I develop webapplications and webservices for both .NET 1.1 and .NET 2.0 on it. So I need both Visual Studio 2003 and Visual Studio 2005 working. Can you see where this is going?

The first hurdle I encountered was the vast difference in the interface. I wanted to install IIS, but it took me a while before I found it. In hindsight it’s pretty logical, but I was thinking too much in Windows XP. Windows Vista comes with IIS7, which is different then IIS6 or IIS5 (both of which look remarkebly the same from the management interface point of view). I spend some time looking at the options, then added a webapplication and worked to get it running correctly. As with IIS6 I had some trouble getting all the security setup correctly. Then I spend a lot of time getting it to run on ASP.NET 1.1. Apparently, by default, it runs on ASP.NET 2.0 and even an ASP.NET 1.1 application will, in fact, be run on ASP.NET 2.0. There is some sort of backwards-compatibilty in there to make it work. But I really wanted it to work in ASP.NET 1.1. So I had a lot of tweaking to do, but after a few hours of Googling, trying and cursing, I was able to make it work.

What you have to do is install .NET 1.1, then add the ASP.NET .1. ISAPI filter DLL to the “ISAPI and CGI restrictions” part of the configuration and set it to ‘allow’. Then select the ASP.NET 1.1 Application pool and your done. In my case I also needed to comment out some stuff in the globalk web.config and the local web.config. I’ll see how I can make it run with both ASP.NET 1.1 and ASP.NET 2.0 later, when I fix my remaining problems.

So, the website was working. Not to get Visual Studio 2003 up and running.
The thing is, it’s not supported. That’s right. Microsoft puts great pride in their ‘backwards compatibilty’ layers, some of which stop Windows from utilizing it’s full potential, but they won’t make VS2003 work on their new OS. By the way, do wanna now what old development enviroment did they spend time on? Visual Basic 6.
That’s no joke. Apparently the reason is that migrating from .NET 1.1 to .NET 2.0 is easier then VB6 to something else. And in that they are correct, however that doesn’t help me a s developer at all! If operations won’t install .NET 2.0 on the production machines, then I can’t update the codebase. So I’ll need to run VS2003.
To make things even more interesting, even VS2005 isn’t fully supported(!!!!!!!!!!!!!!!) Even after you install servicepack 1 (which is currently in beta) there will still be ‘issues’.
So let me get this straight….even though Vista was in development for over 5 years, they can’t make an application they released last year compatible? And here I thought Steve Balmer thought developers where so important.

Currently I can’t get VS2003 to open a web project. It’s complains that the source directory does not match the IIS share. And from what I read on the internet, this isn’t even supposed to be the problem. The real problem is related to debugging.

It’s really simple. If I can’t get VS2003 to work with Vista, I can’t upgrade and I’ll go back to Windows 2003 Server. Then only after we upgraded all .NET 1.1 applications to .NET 2.0 and Microsoft got their act together to get VS2005 working perfectly on Vista, can I upgrade to Vista. And this goes for my home machine too. Sure I play games on it, but I also develop some stuff as a hobby. If I can’t run VS2005, I’m not upgrading anytime soon. Shiny aero glass windows or not.

[Last played: Testament - The Haunting]

July 19th, 2006

InternetGetCookie/InternetSetCookie (WinInet) changed with Internet Explorer 7

So last week I was implementing the Google Authentication for Installed Applications in Feed Vortex and after I solved the cross-thread GUI access problems I ran into a new batch of problems. You see, Google authenticates using cookies, but when you use the Google Authentication API for desktop applications you only get the value that needs to be stored in the cookie and not the cookie itself. Since I P/Invoke the WinInet functions, I needed to store the cookie using the InternetSetCookie API and then the WinInet APIs themselves will figure out what cookie to get.

But it wasn’t so simple. Using Fire Fox I noticed that Google stores its cookies with the domain “.google.com” and the path “/”. But when I try to do that I get error 12006 (ERROR_INTERNET_UNRECOGNIZED_SCHEME). Allright, so I add “http://” to the front, but then I confronted with error 123 (ERROR_INVALID_NAME). This confused me. But then I remembered I was running IE7 Beta 3 on my desktop, so I put the code on my laptop which still uses goold old IE6 and it works.

One of the changes for IE7 is their more secure URL cracking methods. But apparently IE7 also updates the WinInet.dll, which other applications use. So it’s new security fixes will have effect on other applications, not just applications that use an embedded IE, but all applications that use WinInet. So I spend half a day figuring out what to do. And in the end I found out that using “http://www.google.com” as the cookie domain works as well.

[Now playing: The Project Hate MCMXCIX - With Desperate Hands So Numb]

July 12th, 2006

Treeview boldness

This is something I’ve had on my “to-write”-list for some time now.

When I started working on Feed Vortex I wanted to have a treeview with the feeds you we’re subscribed to and when you’d have unread articles the feed would have its name in a bold font and the number of unread articles would be in paranthesis behind the name of the feed.

It was pretty simple: just get the font object from the treenode, make it bold and put it back. Easy as that.

Until I looked at the treeview. The longest feed label seemed truncated. I first thought this had to do with the window I had put the treeview on, but this wasn’t the case. It turns out that the treeview determines how much space it should reserve for its labels only when you create it, or add a new treenode to it. Basing it on the font it has at that time.

So the solution was actually pretty simple. Create the treeview with a bold font by default and then add a treenode with a regular font. The other way around doesn’t work. Also, just to be sure, I added some additional spaces to the end of the label, just to make absolutely sure I have enough space left to display the label when I set the font to bold.

[Last played: Nightwish - Beauty Of The Beast]

April 19th, 2006

Google Reader SID, how to get it

When I announced I was going to write my own Google Reader front-end, I also mentioned I might put the Google Reader API specs on this website. I haven’t done this so far, so this might be a good time to start.
I’m not going to put up a page with it just yet, but I am going to document some of the things as blog entries.
One of these things is how to get the Google SID of the logged on user.

Before I can cover the obtaining itself, I must first tell you how Google Reader knows if you are logged in or not. While others, like NewsGator, might use a username and password combination in the API calls, Google Reader works through cookies. At least, far as for as I know it does, there might be another way, but I don’t know it. One of the things I’ve seen people say is to just add the username and password in the URL when doing an API call, much like you would when accessing FTP from your browser. However, one of the security updates for IE included removing the ‘@’ as valid input when entering an URL in IE. This makes it impossible to add the username/password to the URL. FeedME uses the WinInet functions from Windows and these might not share the same URL cracker that IE does, but I just want to be sure I don’t shoot myself in the foot when Windows Vista comes out and they also secured the WinInet DLL there.
So cookies it is. Since I use WinInet it’s actually pretty easy. It shares the cookies with IE, so if you’ve logged into Google from IE, FeedME can use that cookie. If I used the .NET HttpWebRequest class (and its related classes) I wouldn’t share the cookies, but there is a work-around. Why don’t I use the standard .NET classes? Read this and you’ll understand.

Okay, so if you have the right cookie, you’re logged in, if you son’t, FeedME sends you to the login page using the embedded browser and allows you to log in from there. FeedME doesn’t even know your username and password!
But being logged in isn’t enough, some of the stuff I want to do, like download your list of feeds requires me to know your user ID, or as I’ve begun to call it, your Google SID. And that’s where I ran into a problem.

At first I would just ask for your reading-list, which basically is all the articles from all the feeds you are subscribed to. This call was based on the cookie and didn’t need to Google SID. In one of the XML nodes that came with that list, even if it was empty, was a string with the Google SID in it. So I parsed it and I was done. However, now the XML changed and now I need to find a new way.

My first try was to see if maybe the Google SID moved somewhere else, but the only place I could see it was in the ID of the list. I think the ID can change very easily, so I don’t want to be dependent on that.
The only other place I saw the Google SID was in the labels and states of articles. You see, every article can have labels and states. These are just text strings that have a special meaning within the Google Reader. These labels or states have your Google SID in them. So I can parse then and be done, but I figured that maybe sometimes you don’t have a single article on your reading list.
To test this I created a new Google account and lo’-and-behold, no articles and no Google SID. Damn!

But the webbased Google Reader interface appears to know my Google SID. So into the javascript I went.
Unfortunatly the Javascript from Google is compressed. And rightly so! I read somewhere it saves them bandwidth in the order of several GB per day. But the compression made the javascript indecipherable, so another dead end. Time to Google!

I found a lot of info on Google and the cookies, but nothing which helped me. I found someone else who had run into the same problem as me and had resorted to request the Google Reader UI page first and parse that for the Google SID. This was something I already considered, but only as a last alternative.
And I also found a Ruby script by Ben Ferrari, with which to delete all your Google Reader subscriptions. He used the SID value of the Google cookie, but this is encrypted. I thought he might know how to decrypt it, so I read the source. No decryption, but I did notice that he did some API-calls for which he would need the Google SID, but instead of the Google SID he would use a hyphen (’-'). Intrigued by this I tried it and it worked!!

Thank you Ben!!

Ofcourse _now_ I look at the Google Reader blog en see that one of their tips also uses a hyphen instead of a Google SID. Ah well…

[Last played: Lacuna Coil - The Game]

April 18th, 2006

Writing a plug-in architecture in .NET

So I wanted FeedME to be versatile. I want it to be able to use any back-end. So for that to be possible I need to create a plug-in architecture so you can easily write a DLL that provides a new back-end to FeedME. The plug-in architecure is basically just a list of functions FeedME will assume are there and will want to use. The best way to achieve this is by defining interfaces.
So I went on happily defining all kinds of functions in different interfaces. Then I decided that I only wanted singleton classes.
For those that don’t know, a singleton is a type of class that get’s instantiated only once. You keep on using the same instance throughout the lifetime of the process.
You do this by defining a class whose constructor is private and which has a static Create() function. The class also has a static variable that simply contains an instance of it’s own class. So the create function just returns this reference and so everytime you call Create(), you get the same class reference. Ofcourse it can be implemented in some other ways, but I just wanted to explain what a singleton is.

So, I wanted to define a static Create() function in the interface, but you cannot do that.
Allrighty….so then I tried making an abstract class that implements the interface which has a static Create function. And again, not possible. Well it’s possible to create the abstract class, but in order for a derived class to implement it’s own Create() function I need to mark it “virtual” and that’s not allowed on a static function.

*sigh*

So I just made the normal interface and put in the comments/documentation that the class must behave in a singleton manner.
I did define a factory interface with Create() functions, but they are just not static.

That’s what I’m missing right now, some way of enforcing design pattern usage for classes that derive from a base class or who implement an interface. I would like that even more then LINQ.

Another issue I ran into was how to instantiate the class whose name you don’t know. In “old” days you’d create a DLL which had a C function in it that created the class for you. But in .NET you can’t have a stand-alone function, they’re always part of a class. But then I remembered that’s what reflection is for. You can just look in a DLL and see what classes are in there and implement which interface. So all I need to do is enumerate through the classes in the DLL until I find the one that implements the interface I need.
Sounds simple, but I have not yet implemented it, so I don’t know if it truly is that simple. I’ll know soon enough :-)

[Last played: Lacuna Coil - Devoted]

March 9th, 2006

I will not REST until this problem is solved

The Google API for Google Reader has not been released. At least officially. I found a real good head-up at Niall Kennedy’s weblog. The information there is more then enough to get you started. The information in the main article is not complete though. You can find out some more tidbits in the comments and I also found some more stuff while working on FeedME. It hadn’t occured to me how easy it actually is to get some information about the API. I figured, it’s a web application, so all the interesting communication happens at the server itself, no way I can get to that. I had even downloaded the javascript file Google Reader uses for it’s work when it occured to me that, yes, this is a web application. It’s a web 2.0 (I really hate that term, but now everybody should know what I mean) application. It uses Ajax, which means that all communication with the server backend originates from my own machine! Add Fiddler and you’ve got a neat protocol-sniffing-setup :-)
I’m thinking about doing a page on the Google Reader API to put all the info I have at one location.

Anyways this is not about the Google Reader API, at least not in depth. What I am going to write about is the HttpWebRequest, WebResponse and the Uri classes of the .NET framework 2.0.
These were the classes that I wanted to use for communicating with Google. The are built for that purpose! In fact, they worked perfectly for the first API I incorperated, the call to download your subscription list. After I had that working and had a really basic GUI I was ready to move on to the next thing: Downloading the articles for the feeds I’m subscribed to.
The Google Reader API is a REST API (or at least based on some REST principles). This means is uses simple HTTP GET and HTTP POST commands to communicate with XML. Okay, so this also covers SOAP, but the thing with REST is that it doesn’t have predefined XML to use. It’s all up to the implementation. Whereas SOAP has everything standardized except the data itself.

Getting your subscription list is just sending a GET at a specific URL, let’s say: “http://www.google.com/reader/api/subscriptions/” (This isn’t the real URL, just an example). You’ll then get some XML back that describes your subscriptions. Simple to do with HttpWebRequest.
To get the articles of a specific feed, you need to add the URL of the feed to the URL. An example (also not real): “http://www.google.com/reader/api/feed/http://www.digiwar.com/feeds/”
This would give you the articles from this website that Google have in their Reader database. Now here I ran into a problem.

The HttpWebRequest class takes, or converts your string into, a Uri object. The Uri object is a real useful class that does all kinds of useful stuff to the URL you supply. Like checking if it’s a valid URL, removing contradicting directory paths or removing those pesky doubles slashes some people put in their URLs by accident. Do you see the problem already? If not, I’ll give you 5 minutes to think about it.

Take your time.

You got it? Good. So you aggree with me that I was really frustrated that my HttpWebRequests ended up going to “http://www.google.com/reader/api/feed/http:/www.digiwar.com/feeds/” instead of the correct URL. Nothing I could do would help. I tried double-double slashes, tried escaping them, tried encoding them as “%2F”. Nothing worked. I did a lot of Googling on the subject, inquired in newsgroups. Nowhere did I find an answer. So what did I do? I wrote my own HttpRequest, HttpResponse and Url classes.

The Url class was really simple. It just houses a few strings and does some parsing in the constructor. It does no validation whatsoever.
The HttpRequest and the HttpResponse class where a bit harder. For them I P/Invoked a lot of WinInet functions. One important thing learned here: If you ever need the P/Invoke signature of a Win32 function, or at least a good pointer in the right direction, just google for “dllimport “. Also visit pinvoke.net, it’s really useful.

And ofcourse, after I had everything up and running (beautifully I might add) some one found an answer for me. Apparently if you encode the second double slash as ‘\u2215′. So you’ll end up with “http://www.google.com/reader/api/feed/http:/\u2215www.digiwar.com/feeds/” and this seems to work. I still have to test it in a realy world scenario (such as my program), but I’ve just invested a lot of time in my custom classes and it’s working perfectly, so why switch?
I might switch back to the .NET classes sometime in the future, but for now I’m content with how it is.

[Now playing: The Kovenant - Jihad]

March 7th, 2006

Writing your own news aggregator

So I took the task upon myself to write a Windows application that allows me to sync with Google Reader and allows me to read my feeds I have in Google Reader. This is not a post for plugging that application though. This is a post, or probably one of a series of posts, about the things I learned while programming the application.

But to spend just a few words on the application: I’m going to call it “FeedME”. I had thought up that name probably two years ago when me and a colleague were already considering writing a feed reader. The project never got really far, but the name stuck.

So far the application allows you to log in, retrieve the feeds your subscribed to and then the unread articles from those feeds. The articles are show in a real simple newspaper format in an embedded Internet Explorer control. That’s about it.
The biggest hurdles I crossed so far? Downloading the feeds from Google (getting the subscription list is easy, getting the articles of a particular feed is much harder, more on that later) and logging into Google.

Logging into the Google Reader is complex, but not really that hard when you think about it. The thing is you can’t just send a username and password combination to a webservic. At least not that I know of. No, you have to use cookies and then, somehow, find out the Google SID for the user. I will explain this in detail later!

So, expect some articles about the problems I encountered and how I solved them (or worked around them) in the future. And if I get it into a workable state, I will release FeedME for everyone to use. Free of charge!

Right now I’m gonna see if I can come up with a nice way to mark a seperate article as ‘read’ and ‘unread’ and how to tell Google that and how to show that in my application (no support for read articles yet).

[Last played: Static-X - Trance is the motion]

November 10th, 2005

Programmatically editting: Outlook 98 and Outlook 2000

Better than ‘97

Now it’s time for Outlook 98 and Outlook 2000 to be covered. Why two at the same time? Because aside from a difference in one registry key, they are exactly the same! Outlook 98/2000 work a lot better than Outlook 97. They have multiple Internet Mail accounts support out of the box and they even allow us to add new POP3 accounts!! So let’s dive right in!

It’s sooooo much simpeler

Where Outlook 97 had all kinds of difficult and obscure registry keys and registry values, Outlook 98/2000 take the Outlook Express model and use a syntax identical to the way Outlook Express stores the accounts.
The location in the registry where the account information is stored is also the only difference between Outlook 98 and Outlook 2000. For Outlook 98 it’s stored at HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Outlook\OMI Account Manager\Accounts and for Outlook 2000 it’s stored at HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\OMI Account Manager\Accounts. That’s it. Aside from this, they’re identical.
Underneath this key are subkeys whose name is an 8 character hexadecimal number. Underneath those subkeys are the accounts Outlook has configured. The value with the name “Account Name” contains the number the next new account should use. So this is useful if you want to add a new account. Read this number, increase it by one and write it back. Remember though, this is important, that it’s a HEXADECIMAL number. I fucked up on that one at first. You won’t notice until you add a new account for the tenth time, then weird shit(™) happens.
The key with the name “Default Mail Account” contains the number for the default mail account. This is the account that will be used for sending e-mail, unless the user specifies that an e-mail should be send from another account.

An Outlook 98/2000 account

Like I said, the syntax is identical to that of Outlook Express. The following entries are possible for a POP3 account:

  • Account Name: Name of the account as it appears in Outlook
  • POP3 Server: Server for receiving e-mail
  • POP3 User Name: Username to log into the receiving e-mail server
  • SMTP Server: Server for outgoing e-mail
  • SMTP Email Address: The e-mail address to use when sending e-mail (this will be the address used when the receiver replies)
  • SMTP Display Name: The nice name people see from whom the mail is

These are all string values (REG_SZ). There are also a few other interesting non-string values:

Connection Type (DWORD)
A value of “1″ means the account uses the same dialer settings as Internet Explorer does. A value of “2″ means the account has it’s own dialer-entry configured (or actually a name to a dialer-entry that’d better exist). Any other value means the account will connect through the LAN.

Connectoid (string)
This is only useful if the “Connection Type” has a value of “2″, because then this key contains the name of the dialer-entry Outlook will dial when sending or receiving e-mail for this account. The key can be present even if the “Connection Type” is set to something else than “2″, it’s just ignored then.

POP3 Prompt for Password (DWORD)
A value of “1″ means Outlook will ask the user for the POP3 password when receiving the e-mail for this account. A value of “0″ means it won’t. Simple.

Adding a new account

Yes! Finally! Wiht Outlook we can now ADD NEW ACCOUNTS!
To do this, just create a new subkey like I said at the start of this article and fill in the blanks! It’s that simple. One important thing to know though, is that Outlook should be closed when you do this. There will not be any problem if you won’t, but Oulook does not automagically detect the newly entered account, so it might seem like it doesn’t work. Close, Outlook, enter the account, start Outlook and it should be there and working!
The only problem is that I don’t know how to enter the password, so set the “POP3 Prompt for Password” key to “1″ and it just asks the user, who can then choose to have Outlook remember the password.

That sums it up for Outlook 98 and Outlook 2000, next up: Outlook XP and Outlook 2003 (they are even more the same).


[Now playing: The Presidents Of The United States Of America - Stranger]

October 7th, 2005

Programmatically editting: Outlook 97

A word of warning

As promised a write-up on how to edit the POP3 accounts in Outlook 97. But before we get to the goods a notice. First I must warn you that there are basically two types of Outlook 97. There is the original one (which I’ll refer to as the “gold” version) and there is one with Service Pack 1 or higher, or the Internet Mail Enhancement Pack (which is s seperate download, but later also included in SP1). There is a very important difference between these two versions. Outlook 97 gold only supports one (1) POP3 account. You can’t add more! The SP1 version allows you to add mor then 1.
Another thing you should know is that I’ve never been able o find out how to add a new POP3 account to Outlook 97 (either version). I can edit the settings of an existing account, but if I add all the right registry keys, Outlook for some reason won’t recognize the account. So in this article, only stuff on how to read an account and edit it.

Services

Unlike in Outlook Express, Outlook 97 installs each POP3 as a seperate service. A service, in this case, is a sort of plug-in for Outlook 97. Other services include Personal Folders and Exchange Server Mail. Because a POP3 account is considered a service it’s layout is much more complex. To make things even more interesting, Outlook 97 stores it’s settings on WinNT in a different key then on Win9x. In WinNT the Outlook root key is Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem while on Win9x it’s at Software\Microsoft\Windows Messaging Subsystem. Both are under HKEY_CURRENT_USER. Fortunatly, after that everything is the same.

Profiles

Then we find another difference from Outlook Express. Outlook supports profiles. Meaning you can have a profile for at home and one for in the office (for example). Each profile has it’s own services. So if you want to search through all the POP3 accounts, you’ll need to search all the profiles. Lucky for us, profiles aren’t that complicated. Under the registry key mentioned above there is a key called profiles and underneath that key are keys whose name matches the name of the profiles. Most of the time there will be only one profile and it will be called “Outlook”.
If you want to know the default profile, there’s a string value with the name “DefaultProfile” in the profiles key. It’s value is the name of the default profile, which also corresponds to the name of the registry key.

The settings

Now the fun begins. Underneath the profile key there are a bunch (or a whole damn lot) of keys with GUID names. Their names mean nothing at all! The GUIDs can be anything for as far as I know. If you want to find a POP3 account you’ll need to enumerate all the keys and see if they have an entry with the name “001e3d0b” (this name is also a GUID, just a shorter function, but it does mean something!). This should be a string value and it’s value is the name of an Outlook 97 service. In the case of a POP3 account this value should be “MailServiceEntry”. If you find a key, with this entry with the value, you’ve found a POP3 account!.

If it is a POP3 account you can also find the following settings:

  • 001e3001: The name of the account as it’s shown in Outlook 97.
  • 001e6600: The POP3 server name.
  • 001e6606: The POP3 username.
  • 001e6611: The SMTP server name.
  • 001e6605: The e-mail address this accounts uses for sending.
  • 001e6607: The display name of the mail account (who the mail is from).
  • 00036601: The connection type. This is a binary value with a size of 4 (basically a DWORD). A value of 1 means connect like Internet Explorer connects, 2 means using a dial-up connection and 0 or anything else means LAN connection.
  • 001e6631: If the connection type is 2, this contains the name of the dial-up connection to use.
  • 01023d01: This is the Template GUID (more on this below).
  • 01023d02: This is the MailEntry GUID (more on this below).

All of these are string values, wiht the exception of the 001e6631 value, which is a 4 byte binary value (not a DWORD value!!) and 01023d01 and 01023d02 which are 16 byte binary values.

Related GUIDs

As stated above you’ll also find a Template GUID and a MailEntry GUID.
If you are just changing some POP3 values, these are not interesting, if you want to add an account they are. However, since we can’t add new accounts to Outlook 97 they are not interesting (but they will be in Outlook 98). Basically they refer to another key underneath the profiles key which has some info required for the Internet Mail Service. Have a look at them if you’re interested.
Even when adding new accounts they don’t contain settings we’ll change, they just need to be present and filled with the correct information.

In closing

Well, this should be enough for you to change POP3 accounts in Outlook 97. If someone finds a way to add new accounts AND have Outlook 97 recognize the new accounts let me know, I’m interested.

Next up: Outlook 98.

[Now playing: Pantera - Planet caravan]

August 23rd, 2005

Programmatically editting: Outlook Express

A while ago I promised to give some information on how to programmatically read Outlook and Outlook Express accounts. I think it’s time to get started. So, first up: Outlook Express.

The information below works for Outlook Express 4.x up until 6.x.
All the account information for Outlook Express is stored in the registry. It’s stored in “HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts”. Every subkey in this registry key is an account in Outlook Express. It can be an LDAP account, an NNTP account, an IMAP account, an HTTP mail account or a POP3 e-mail account. I’m only going to cover POP3 e-mail accounts, but you should be able to figure out the other types.

Under each account key that contains a POP3 account you’ll find the following values (other account types have other values, although some are the same):
“Account Name”: The name of the account Outlook Express uses.
“POP3 Server”: The POP3 server.
“POP3 User Name”: The username to log on to the POP3 Server.
“SMTP Server”: The SMTP server.
“SMTP Email Address”: The e-mail address this account is for.
“SMTP Display Name”: The nice name this e-mail address has.
“POP3 Prompt for Password”: If set to 0 (zero), Outlook Express wil not ask for a password when checking mail on this account. If set to 1 (one) Outlook Express will ask the user for the password.
“Connection Type”: If set to 0 (zero), it means connect through LAN. If set to 1 (one), it means use the same connection method as Internet Explorer. If set to 2 (two), it means connect using dialup. In the last case “Connectiod” will be used.
“Connectiod”: The name of the RAS entry to use when checking mail for this account.

Setting a password for e-mail accounts is not something I have done before. It uses Protected storage and that’s pretty complex. Maybe if I figure it out one day I’ll post some info, but for so far, I don’t know myself.

But that’s not it! What if you want to add and account, or change which is the default account!
If you want to add a new account, you need to look at registry key “HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager” and then at the value named “Account Name”. This value is the name the next account key should have when you create it under “HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts”. So you read the value, create a key with the decimal representation of that value, padded with zero’s until it’s 8 characters long. Then you increase the value by one and write it back to the registry. Easy as that!

But wait, maybe you just want to change the default e-mail account! That’s even easier. Again, look at “HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager”. There’s a value there name “Default Mail Account”, it’s value is the name of the key the default account is in. There is also a “Default News Account” and a “Default LDAP Account”.

You will find more registry values in POP3 account keys, but these are the very simple basic ones. If you want to know what value denotes the POP3 TCP port, just change it in an account from inside Outlook Express and look in the registry at what changed. The above is all you need to create a working POP3 account.

Next up: Outlook 97, which I haven’t ‘cracked’ completely myself and it’s actually pretty complex. But more on that when I post the article itself.

[Last played: - ]

July 31st, 2005

Manage accounts in Outlook (Express) from a program

I’ve recently been needing for find out how to add and modify e-mail accounts in Outlook and Outlook Express. My first idea was to search Google on how to do it, but I couldn’t find anything about it (later I found out some hints have been dropped in newsgroups, so I should’ve used Google Groups). So I had to do it the hard way and figure it out myself. Now I want to show people how to do it, to save them the time it has cost me to find out. So expect a series of articles in the near future on how to add and edit e-mail accounts in Outlook and Outlook Express. Since I’m still in the middle of making the program that does this (the program won’t be released here because it’s a product for the company I work for), it can be a while since I still need to verify and test my assumptions. But the articles will be here in a few weeks.
I’ll probably start with Outlook Express and then work my way up from Outlook 97, to Outlook 98, to Outlook 2000, to Outlook XP and finally to Outlook 2003.

[Last played: Billy Idol - Romeo\’s Waiting]

July 29th, 2005

Development tools

We have a bigger development team now at work. Because of one of the many, many reorganizations at my employer, I now find myself being part of a group of developers, most of them specializing in Windows platform development. I like this better than before the last reorganization, because then I was one of two Windows developers amongs a host of *nix fanatics. All of who think Java and C are the way to go.
Anyways, with this team we’re trying to get some standard tools that everyone can and will work with. The only standard tool I used before that was CVS to store the source code of the applications I made. But in this team we’re trying to use more tools. One of the things we looked at was Microsoft Visual Studio Team System. Seeing as we’re still dealing with a lot of non-Windows projects, it wasn’t really useful for us. For as far as I could see, the only way to store the source code in the source control system of VSTS, was when it was part of a Visual Studio solution. Not really useful for Perl, PHP and Java applications. So we decided to go with Subversion.
VSTS also provides bugtracking. For that we are still looking. Currently on the examination table is BugZilla.
VSTS provides many more things, like task lists and project management, all for which we have no solution yet, but hey! It’s a start!

So, VSTS is a great product, but only if you’re working on Microsoft platform-only applications. Although I did read you should be able to extend VSTS and you should be able to plug in your own stuff, like another source control system. Maybe I’ll have a look at VSTS again when it’s new beta is released. I never liked the fact you need to install it on a Active Directory Primary Domain Controller and need to be part of that domain to be able to access it from the client side.

[Last played: Billy Idol - Romeo\’s Waiting]

May 23rd, 2005

Visual Studio 2005 Team Services beta 2

So last week I finally got Visual Studio 2005 Team Services beta 2 installed on a Virtual PC image. It took some time because I never configured a PDC, which is required for TFS (Team Foundation Services) even though I still think it’s just lazyness on part of Microsoft who use the domain authentication stuff for TFS, while they could also offer a simple (domain-less) server setup. But anyways, I got a PDC up-and-running, installed all the required parts, installed TFS and got connected from my workstation. But! My workstation is not in a domain, so even though I could connect, I could not create a project :-( Some Googling taught me this is indeed a limit in the current beta. Cross-domain authentication is not supported for some reason. Well, so much for using TFS with the Go-Live license. Now I can only just check it out, because I need to create a VPC image with VS2005 beta 2 and add it to the domain to use it. And I will not start using that for the real development work, I have a beautiful dual processor machine for that, thank you very much! I’m really hoping for a beta refresh, of a RC1 that will allow cross-domain authentication.

[Last played: - Watsgeburt]

May 10th, 2005

Visual Studio 2005 Beta 2 performs better

I wanted to give some feedback on the horrible performance by VS 2005 Beta 2 and turns out more people are plagued by it. The solutions is to delete your preferences. I did it and it works like a charm now. So now I’m slowly but surely changing the preferences to my liking, waiting for the thing to slow down to a crawl again ;-) But if it does, I’ll probably have figured out what setting causes it. Which I can then report. Which they can then fix (I hope).

[Now playing: Cradle Of Filth - Ebony Dressed For…]

April 27th, 2005

More Visual Studio 2005

So last week the official Beta 2 of Visual Studio was released and I downloaded the release immediatly. I uninstalled the february refresh of the CTP and installed the beta 2 version. It seemed a bit better. One bug I ran into with the CTP release was gone, but I still have the problem that when I’m running Visual C++ for a length of time, it really slows down. It still looks like an enormous resource leak. After about an hour it’s so slow it’s hardly usable. It seems to be related to debugging, because as long as I don’t debug and step through my code I have no problem.

I’m going to try Visual C# out sometime soon, so I hope it doesn’t have the same issues as Visual C++.

I also still have the feeling Visual C++ is being left behind feature-wise by Microsoft. I’m not talking about language features, but about editor features. The C# editor has more features then ever and the C++ editor hardly has any new features. And they still haven’t fixed the task-list!! It’s still completely useless to me. Makes you think Microsoft really wants you to switch from C++ to C#.

[Now playing: Fear Factory - Archetype]