What’s New

Well it’s been a little while since I have last updated the website with new content, so I thought I would share what I have been working on.

I have been working rather intensely for the past 3 weeks on an exciting project. I can not many share details at this stage apart from how amazing it is. I am approx. 90% code complete, ready for a public beta in the coming weeks. Keep an eye out here, I’ll be sure to update when this product is available for consumption.

As for other website content: I have been looking through some of my older code dating back over the past few years and have decided to release some of it here, on the website, for people to use and learn from. I will be going through the documenting and write up stage in my spare time, but a new, open source, page will appear when I have some of these up.

I am working on a tutorial regarding the drawing namespace in .NET to help get people started with using drawing in their applications. I will also put up code for a fully functional kids drawing application, so users can see this in a more advanced state.

I have started a few more parts in the “Whats new in .NET 4″ series and documenting a few more troubleshooting stories, which will be up in the coming weeks.

Stay tuned.

Luke

Windows Live Messenger troubleshooting: The vague error code, 0x800c013a.

If your looking for a immediate solution rather than reading the details, you can download my application by clicking HERE. This application will attempt to resolve this and other issues for you, by cleaning the contact store,your user profile directories and by killing off all instances of messenger (The WLM wave 4 beta seems to not close off it’s self properly sometimes).

Every error message I remember ever receiving in Windows Live Messenger/MSN Messenger tells me something about the messenger service temporarily being unavailable. As I don’t use Messenger that often I’m not too fussed if I have wait until it decides to sign in again, which usually is apon a system restart. Occasionally I punch the error code into a search engine in the hope that someone else has experienced the same issue.

For a few weeks now on and off I have been experiencing this type of issue, where I get some error code and a message about the messenger service being unavailable. I received the error code 0x800c013a. As I have needed to rely on Messenger recently, I decided to look into the issue.

My first instinct was to click the link on the error dialog presented to me. This click took me to the Windows Live Solution Centre and a result which was in Chinese, telling me that the Solution Centre does not support my language. Whatever that means.

My second port of call was to Bing it, which turned up 2 results, none of which were useful to my particular problem.

So neither Microsoft nor the wealth of support boards out there could help me, what else could I do?

To make it easy on us, the WLM team has included connection logging. This should be on by default, but to turn it on/off or view the log: Open the Options dialog -> Select the connection tab -> Click the “Advanced Settings” button -> Edit the options in the “Windows Live Messenger” panel.

The log file is located at: %userprofile%\local settings\application data\microsoft\messenger

My log file was showing the following:

[17:37:23.04] 1a24 Messenger:Zone_Contact_Platform_Errors Local store incomplete: 0x800c013a (no ab)
[17:37:23.04] 1a24 Messenger:Zone_Contact_Platform_Errors CLoadContacts::OnStoreFailure> 0x800c013a
[17:37:23.04] 04a4 Messenger: Zone_HotmailService CHotmailService::Logoff@007AB888> hr=0x800c013a tasks=@0508B4B8
[17:37:23.04] 04a4 Messenger: Zone_HotmailService CPresenceSession::SignOut@0508BDE8> service=@0525822C hr=0x800c013a
[17:37:23.04] 04a4 Messenger: Zone_HotmailService CPresenceSession::SignOutInternal@0508BDE8> service=@0525822C hr=0x800c013a
[17:37:23.04] 04a4 Messenger: Zone_HotmailService CHotmailService::FireLogonResult@007AB888: hr = 0x800c013a
[17:37:23.04] 04a4 Messenger: Zone_HotmailService CTaskRunner::AbortTasks: running=2
[17:37:23.04] 04a4 Messenger: Zone_HotmailService CTaskRunner::_AbortTasks: aborting='Presence'
[17:37:23.04] 04a4 Messenger: Zone_HotmailService CTaskRunner::_AbortTasks: aborting='StoreAdapter'
[17:37:23.04] 04a4 Messenger: Zone_Voice (voicevideoplatformlogon.cpp:66): ERROR: [OnLogonResult called with an failure hrLogon] "" failed with 0x800C013A in .
[17:37:23.04] 04a4 Messenger: Zone_LogonState CUIManager::OnLogonResult hr=[0x800c013a] m_dwUILogonFlags=[1]
[17:37:23.04] 04a4 Messenger: Zone_UI CUIManager::OnLogonResult@00F89E90: enter
[17:37:23.04] 04a4 Messenger: Zone_LogonState CUIManager::DisplayLogonError> hr=[0x800c013a]
[17:37:23.04] 04a4 Messenger: Zone_LogonState CLogonErrorHandler::DisplayLogonErrorDialog> hrError=[0x800c013a] s_fDisplayingLogonError=[0]
[17:37:23.04] 04a4 Messenger: Zone_UI CUIManager::OnLogonResult@00F89E90: leave
[17:37:23.05] 090c Messenger: Zone_LogonState CSignInUI::OnSignInError
[17:37:25.07] 04a4 Messenger: Zone_HotmailService CHotmailService::DisconnectAndCleanupInternal@007AB888: enter

As you can see there are errors relating the local store and then WLM begins signing out, stopping services and cleaning up.

So, where is the local store data?

You can find the contact data: %userprofile%\local settings\application data\microsoft\Windows Live\Contacts\*your email address*

You can also find your profile data: %userprofile%\Local Settings\application data\microsoft\Messenger\*your email address*

So, by cleaning out the stores my problem was resolved. It looks as though something was corrupted in the store.

New Section

I, as are many of the people who come across my site, I’m sure, are the computer support person for family and/or friends. Rather than using the “reset and see if it fixes it” trick, I like to use various investigative methods such as “hacking”, troubleshooting tools and reverse engineering to find out exactly why something is not working or why it is having problems.

I am introducing a new area of the website, where I will share my experiences and methods in the hope that others will learn and be able to solve their own issues and flex their troubleshooting muscles.

Keep an eye out for a first, rather simple, Windows Live Messenger troubleshooting story shortly.

Luke.

What’s new in C# 4.0: Part 2: Windows 64-bit Support

The Microsoft .NET framework 4 includes support for identifying whether the application is running in a 64-bit process or on a 64-bit operating system.

You are able to check if you are running in a 64-bit process, by using Environment.Is64BitProcess, which returns a boolean of true if you are in a 64-bit process, or false if you are not.

You can check if the operating system in 64-bit by using Environment.Is64BitOperatingSystem, which also returns a boolean of true if you are on a 64-bit operating system, or false if you are not.

Another welcome addition is support to specify either a 64-bit or 32-bit version of the Windows Registry. You can specify either view using the Microsoft.Win32.RegistryView enumeration. For example, to open the 64-bit view of the Current User hive:

RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64);

If you specify 64-bit view on a 32-bit operating system, the 32-bit view will be returned.

Logon Screen Rotator v3.0.208.1030 available now

Hi everyone – another update. This time addressing an issue where if you came from using version 2 or from using another logon screen editing utility, v3 may not change the logon screen for you. This build will fix that issue.

Please note, if you are upgrading from an earlier version that you will need to reselect your ‘Change Interval’ under the settings tab.

Download from HERE

Logon Screen Rotator v3.0.205.1440 now available

As usual you can download from HERE. This will automatically update your older version or you can install fresh if you have no previous versions.

Changes include:
* Changing the image would not work in some circumstances, these have now been rectified.
* The updating system has been changed. (So those coming from any version 2 builds will no longer be able to access the update system, and those from prior v3 releases will have to manually launch installer.)
* Added a new schedule option, at both logon and lock screen.
* A few minor bug fixes and UI tweaks.

Logon Screen Rotator v3.0.029.2042 issue

Hi all,

I am aware of an issue that some people are having where Logon Screen Rotator will not change or is only intermediately able to change the logon screen image. This issue only applies to v3.0.029.2042. I am working on a fix and will have an update available by the weekend.

Luke

What’s new in C# 4.0: Part 1: Optional Parameters & Named Parameters

Optional Parameters

Prior to C# 4.0 the best method for optional parameters was method overloading. However, now C# 4.0 ships with the ability to have optional parameters, which are very simple to use.

The biggest impact I think this will have is in COM interop, where you used to have to specify a value for each parameter, optional or not.

Optional parameters are defined at the end of the parameter list, after required ones. Also, you may not specify any gaps in the argument list. If you provide an argument for an optional parameter, you must specify values for the previous parameters. However, if you know the name of the parameters you can get around this. For example here is a method to send an email:

private void SendEmail(string AddressTo, string AddressFrom, string Subject = "Important", string Signature = "Sent From Email Client")
{
// ...
}

So, the following call is not valid and will result in a compile error:

Incorrect

However, the following named call will work fine:

Correct

Each optional parameter you specify must have a default value, so if no argument is specified then the default value will be used. These default values must be constants. So, back to our previous method, “Subject” and “Signature” are both optional parameters:

private void SendEmail(string AddressTo, string AddressFrom, string Subject = "Important", string Signature = "Sent From Email Client")
{
// ...
}

Named Parameters

As you saw in optional parameters, another new feature is named parameters. Named parameters are helpful so you do not have to lookup the order of arguments for a method.

There is only one convention for named parameters, being that a named argument can not proceed a positional argument, however the opposite is acceptable.

Here is an example method:

private string ReverseName(string FirstName, string LastName)
{
// ...
}

We can used named parameters to change the order of the arguments:

string ReversedName = ReverseName(LastName: "Payne", FirstName: "Luke");

Using named parameters can increase readibility of your code.

Look out for Part 2, coming soon!

New Tutorials

I am in the process of writing more tutorials from a long list of general queries I recieve, I hope to put a few new ones up each fortnight.

Here is the next installment: Multi-monitor Programming in C#

You can view all of the current tutorials on my tutorial page as I wont always update the blog when there are new ones available.

Whilst I do have a list of ideas I am always looking for more so if there is something you would like to learn more about flick me an email!

Luke

Logon Screen Rotator v3 now available

Here is v3!

I have been incredibly busy lately so Windows XP support will be finished shortly. Currently Windows Vista support is available. Enjoy!

Please be sure to sent me an email if you encounter any issues: 

Download Here

Previous Page