Apr 212005
 

Perhaps this category will have obvious solutions or tips, but I’ll share them anyway: C# code snippets. This first one is about logging on to Outlook, which I needed for E-Sync. All samples give you the code with the name of the profile to logon to, or “leave the values for profile and password blank to use the default profile”. The first one means hard-coding a profile, the second one I did not get working on 2 different machines, so I guess it used to be like that but not anymore.

Here’s how to lookup the default profile in the registry, and logon to the MAPI-store.

RegistryKey myKey = Registry.CurrentUser;
myKey = myKey.OpenSubKey("SoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles");
String myProfile = myKey.GetValue("DefaultProfile").ToString();
myMAPISession.Logon(myProfile,"",true,myMV,myMV,myMV,myMV);

Don’t forget to include “using Microsoft.Win32;”.

 Posted by at 21:01
Apr 212005
 

The appointments from the ERP-application come in two flavours. A “real” appointment, with attendees and a real date and time that it occurs. And a “structure” appointment. Only very basicly defined occuring on a certain weekday (Friday, from 9:40 – 10:00 am). The “structure” appointments are filled in later, but they are used by the planning department to see what the employees have designated their timeblocks to.
E-Sync now differentiates between real and structure appointments, also marking the structure appointments as “free”, instead of busy.

What I need to do before the first release is:
– Read attendee information from the database. Their unique number is not informative enough
– Save the entered values for next time E-Sync starts (and don’t show the defaults anymore)
– Make the colors per appointmenttype configurable

The first release is planned for May, 2nd (that’s a Monday). Very exciting.

 Posted by at 01:24
Apr 192005
 

The PIA’s (Primary Interop Assemblies) for Office 2003 are now available as seperate download, so if you’re a developer, and don’t have Office 2003 (that includes the PIA’s), you can now download them and target your application at Office 2003. You can find them here. They are Microsoft .NET Framework version 1.1 assemblies.

 Posted by at 20:27
Apr 192005
 

Just wanted to let you know: nice jobofferings are welcome. Things look like I’m available per July 1st, 2005. Mail me for my resume. The function needs to be consultancy (give me a car, I’ll drive), or a non-consultancy job but in area of Enschede (Ov, NL).

Things to expect:
– Project Management (Prince2)
– Oracle DBA (6 -> 10g)
– HP-UX expertise
– Delphi or C# development

Contact me for details on either jobs (you hire me), or employment (you employ me).

 Posted by at 01:00
Apr 182005
 

I just noticed my site was hacked. The file b2evolutionconf_config.php was altered. The baseurl was set to some hacker-names. Respect for how they did that, but I must say it does not really amuse me. So the magic word: PLEASE don’t do it again.

To show that you succeeded, here’s a screenshot of what people would see:

 Posted by at 21:02
Apr 182005
 

Perry blogs about choices developers make. In this case, the choice between Delphi2005 and VS.NET 2003/2005. Is it me, or is he asking the wrong questions to have the arguments come out in favor of Delphi2005?

My take on this at the moment is that I spend a lot of time looking how the .NET framework works, whereas using Delphi2005 would give me VCL.NET, that I know since it’s similar to good old VCL. But choosing a non-VCL.NET project in Delphi2005 would give me the same problem: I’m not too familiair yet with the .NET Framework.
Other than that, I’ve found VS.NET a very mature and stable IDE, so it’s getting me things done.

Why not choose VCL.NET, you might ask? Well, I think a big feature of .NET is the freedom the developer has to choose its tools. Using VCL.NET would restrict me and others to Borland. When I use standard Windows.Forms, it does not matter whether I use VS.NET, Delphi2005, perl.NET or whatever: the code can be compiled, or with minimal effort translated. Depending on proprietary libraries/assemblies ties your hands, as most of us will have experienced to some degree in the past. Giving you a new version (VCL.NET) of a well-known trick (VCL) seems like a good idea for a developer, since you can “port” your code with no or minimal effort. But basically it’s just another way of saying: I’m bound to one tool, and one tool only.

 Posted by at 13:52
Apr 182005
 

Any developer can tell you stories how coding can be rewarding. Very rewarding. But coding is fun too. Not everything should be built for monetary reasons, but just for the fun of it.

Have a look at Coding4Fun, Microsoft’s new not-so-serious corner on MSDN. But don’t let the name fool you, some projects are actually rather serious. There’s a game-development project, a project to drive a LED-display to show what’s playing on your PC’s mediaplayer, a network/systemmonitor tool. The fun part: lot’s of source included…

 Posted by at 11:22
Apr 162005
 

Okay, I did it. Why this is so completely and utterly undocumented, I don’t know. There are no proper examples in C# (lot’s of VB.NET, but some methods take different arguments, some methods/properties don’t exist) to change the Appointment’s color (“label” in the Outlook-dialog) programmaticaly. So here goes, for your sake.


{
MAPI.Session myMAPISession = new MAPI.SessionClass();
object myMV = System.Reflection.Missing.Value;
myMAPISession.Logon("Microsoft Outlook Internet Settings",myMV,false,myMV,myMV,myMV,myMV);
MAPI.Message myMAPIMessage = (MAPI.Message)myMAPISession.GetMessage(Afspraak.EntryID,myMV);
MAPI.Fields myMAPIFields = (MAPI.Fields)myMAPIMessage.Fields;
MAPI.Field myApptLabel = (MAPI.Field)myMAPIFields.get_Item("0x8214","0220060000000000C000000000000046");
if(myApptLabel.Equals(null))
{
myApptLabel = (MAPI.Field)myMAPIFields.Add("0x8214","long",3,"0220060000000000C000000000000046");
}
else
{
myApptLabel.Value = 3;
}
myMAPIMessage.Update(true,true);
}

Now help me out: how can I change the hardcoded “Microsoft Outlook Internet Settings” to some constant or variable pointing at the default profile?

 Posted by at 01:21