Tuesday, June 19, 2007

Installing Visual Studio 2005 SP1


Did you try installing SP1 for Visual Studio without any errors? If not or if you are still did not start the installation some of the following details will help.

The list of things that Microsoft had fixed in Visual Studio 2005 SP1 is located at http://support.microsoft.com/?kbid=918526.

Most of the time the setup will fail due to the insufficient disk space. So before trying to install the SP1 check whether you have at least 6.3 GBs of free disk space. If you have installed VS in other partition than Windows I recommend to check for free disk space in both partitions.
Another common error which can happen when installing this is,

Error 1718. File FileName was rejected by digital signature policy.

This error is due to the Software Restriction Policies (also known as SAFER) that exist in the operating systems that came after Windows XP. This was introduced to help users avoid running unsafer files. SAFER will be used by Windows Installer to check the file signatures to confirm that the files were not tampered. Note that this error can happen when installing any large Windows installer package or Windows installer patch.

This error occurs when there is no contiguous piece of virtual memory to accommodate the file. Then the Windows installer will fail to validate the file and result in this error.

There are few things you can do to fix this,

1. You can edit the registry to make the PolicyScope value to 1 before you install the package.

2. By changing the SAFER settings to allow administrators to install the package.

3. Installing the hotfix if you are running Windows 2003,

For any of this you can get more information from Microsoft by visiting http://support.microsoft.com/?kbid=925336.

Apart from that Visual Studio SP1 release note can be found at http://support.microsoft.com/?kbid=928957.

Also I suggest that you refer Heath Stewart's articles for more installation tips. Heath is Technical Lead working at Microsoft http://blogs.msdn.com/heaths/archive/tags/VS+2005+SP1/default.aspx.

Even though I had no luck recovering the applications without formatting the system which crashed with the failed installation of Visual Studio SP1, I guess you will have much more luck after reading these articles.

Wednesday, June 13, 2007

Have you tried Google Analytics?

Google Analytics is a free tool provided by Google which will analyze your web site usage. It will monitor your site and will generate reports such as
* number of users visited
* number of minutes spent on the site
* peak times
* place where users came
* what explorer used, etc.
This list is simply a short list of features. See for your self by visiting,

https://www.google.com/analytics/home.

You can log in using your GMail Id and password. Then you have to add your site to analytics and it will give you a script file which you needs to put in to your site. That's all to worry then Google will do the reporting to you.
Happy analysis.

Tuesday, June 12, 2007

World's Smallest Mobile Phone - WatchPhone


Have you seen the cool gadget SMS M 500. This is a watch with basic phone functionalities. This will include facilities and features such as

* Full SMS and MMS functionality
* MP3 Support AAC/MP3 and MP4 Support Video Playing
* Touchscreen with Built-in Stylus
* Memory: 128MB Built-in Memory
* Battery: 400mAh, Talk Time 200 Minutes, Standby Time 80 Hours
* USB: For Data Transfer and Recharging
* Bluetooth 2.0
* Date/Time
* Last Number Redial
* Recent Calls
* Missed Calls
* File Manager
* 199 Contacts
* Multi Languages
* Flight Mode
* Email
Roughly this will be priced around A$ 1000 (Australian Dollar 1000).
For the full details please visit the manufacturer SMS Australia at http://www.mymobilewatch.com/watch_specification.php.
Clearing Windows History


Have anyone tried removing items in Windows history as in Run window history items, most recent documents, web browser history, most recent applications like stuff?
As usual, a bizzare requirement of deleting the Run window history came to me.

After some wondering here and there I found that there is a registry position where the Run window history is recorded. You can find that entry at

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU

in the registry editor. (To open Registry Editor go to Run window and type RegEdit.)
All the history entries dropped in the Run window will be in the list. If you wants to edit or delete an entry you can edit or remove them using the registry editor.
In some scenarios this list will be empty even though there are items in the Run history. In such a case there is an option you can set so that the next restart will erase all the history items. This method is really good if you want to start fresh removing al history items. This will remove Run history, recent programs, recent documents, internet browser history, etc by one shot.
Interested, ok so to do this first open the registry editor. Then go to the following location

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

Now you need to add a Binary Value named ClearRecentDocsOnExit (Edit -> New -> Binary Value), then make the binary value of that to 1 (Edit -> Modify Binary Data).
The next time you shutdown or restart Windows it will take little longer to shutdown because it is clearing the history items. After you start again you will be free of your history items.

If you always want to start fresh at each restart keep the setting as it is. If you just needed to clear the history at that point like me you have to either delete the value we made or have to make the binary vale 0 so it will not clear the history at each restart. If you needs to change this find the ClearRecentDocsOnExit value and modify the value to read 0 so windows will keep your activity history.
Back in Sri Lanka

Came back to home sweet home. Even though the country is having problems at the moment it feels nice to be here in my motherland.
On my way back I enjoyed Singapore little bit.
If you would like to know more please see my photo album named Singapore. I think Singapore airport is one of the best airports in the world providing great facilities to travellers. From the airports which I have been I can say Singapore is the best. Their idea of having themed parks inside the airport is a brilliant idea. Also I heard that they are building there new terminal (Terminal 3) with much more features. So I guess anyone going to Singapore won't be disappointed.

Wednesday, May 09, 2007

Watched Spider Man 3 on IMAX

Spider Man 3 was released 3rd of May 2007. I had a chance to watch it in Melbourne IMAX theater. This was my first IMAX experience. I feel great to watch Spider Man on its release day.

It was a great movie experience. The speciality in IMAX is it is having very large screen and also the sounds system is also complicated and powerful. The screen is made out of tiny holes so that sound can come through the screen. When you watch you will feel as if you are in the movie. I think the experience is worth the extra money spent.
If you would like to know more about IMAX, pay a visit to their site www.IMAX.com.

Adding and Auto Sizing the background image of a MDI Form in .NET

Some months back I faced a problem of resizing an image on one of my tablet PC device applications. The image was on a Multiple Document Interface (MDI) form. Recently only I remembered this and did some research on this, and thought that better to put an entry.
People who have tried should be knowing that we cannot simply add an image to a form and make it automatically re size when the form changes it's size.
In a normal form we can put a picture box and make it fill the entire screen and can set the image properties to always stretch the image. This will re size the background image when ever you re size the form.
But in MDI forms this is not possible. Whatever control you put on a MDI form will appear on top of all other controls, hiding even the child forms that are open. I have found two elegant methods which can be used.

Method 1 -
Insert the following code into the MDI form code. Here we are using Paint event of the MDI form.

Private Sub frmMDI_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
' Always the MDI form will be the last control in the control collection. The following will take the MDI forms reference so we can access the properties of it.
Dim varControl As Control = Me.Controls(Me.Controls.Count - 1)
' Loading the background image required to place on the MDI.
Dim varImage As Image = Image.FromFile("E:\Projects\Tablet\Arjuna\Images\Background-Landsc.jpg")
' Resize the image and assign it to the MDI form background.
varControl.BackgroundImage = New Bitmap(varImage, Me.Width, Me.Height)
End Sub


Method 2 -
Insert the following code into the MDI form code. Here we are using Resize event of the MDI form.

Private Sub frmMDI_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
' Loading the background image required to place on the MDI.
Dim varImage As Image = Image.FromFile("E:\Projects\Tablet\Arjuna\Images\Background-Landsc.jpg")
' If there are no space, no point of drawing so exit the sub procedure.
If Me.ClientSize.Width = 0 OrElse Me.ClientSize.Height <= Me.StatusBar1.Height Then Exit Sub
' Creating the bitmap image which is used as the background image.
Dim varBitmap As New Bitmap(Me.ClientSize.Width, Me.ClientSize.Height - Me.StatusBar1.Height, Imaging.PixelFormat.Format24bppRgb)
' Getting the drawing surface of the bitmap (varBitmap).
Dim varGraphics As Graphics = Graphics.FromImage(varBitmap)
' Sets the interpolation mode of the graphics object. Interpolation mode determines how intermediate values between two endpoints are calculated
varGraphics.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
' Draw the image on the bitmap.
varGraphics.DrawImage(varImage, 0, 0, varBitmap.Width, varBitmap.Height)
' Assign the bitmap as the background image of the MDI form.
Me.BackgroundImage = varBitmap
End Sub

If you don't have a status bar in your MDI form just remove the codes that are coloured Magenta.

Method 1 does have some problems like, it is visible when the background image re sizes and also I found that if you make the form small sometimes the background image will not be re sized.
So I prefer Method 2.