Thursday, December 10, 2015

Value was either too large or too small for a UINT32 TFS Check in error

When attempting to check in code through TFS in visual studio 2012 or 2013 sometimes I get the following error message "Value was either too large or too small for a UINT32". 


Most of the time this is solved by doing a "Save All", but sometimes I've noticed that I still get this error after doing a "Save All". If this happens you can solve it but doing a "Close All Documents"


This will most likely bring up another save dialog for some files which presumably didn't get saved by the "Save All". After doing the "Close All Documents" and "Save" (if asked for),  you should be able to check in without a problem.

Friday, October 30, 2015

Windows 10, where is my trusted "Choose your desktop background"

Hi, just a short blog post about a little annoyance I have with Windows 10. After upgrading to Windows 10 my desktop slideshow setting kept functioning as before. But today, for the first time since upgrading, I wanted to add an other image to my selection. This is when I noticed that the old "Choose your desktop background" was no longer available in the Personalization Control Panel Item. After some googling I found that the, for me, easiest solution was executing the following command (Win + R): "control /name Microsoft.Personalization /page pageWallpaper". You can store it as bat file or create a new shortcut on your desktop. The advantage when you create the shortcut is that you get the nice icon for free ;-) After clicking the shortcut you get the old "Choose your desktop background" back.


By the way, this was the background I wanted to add, Sunset on Mars by Mushstone



Friday, October 2, 2015

And now for something completely different

For once I would like to write about something non technical. This post is more targeted at Dutch speaking people as it's to promote two comics in Dutch drawn and written by my brother Bart Proost
One comic is an, almost historical correct, comedy/adventure about Alexander the Great. The other is a graphic novel based on the story of Nobody's Boy/Sans Famille/Alleen op de wereld. If you're interested in comics, have a look at his facebook pages or website www.alexanderdegrote.com for a lot more info.







PS: This is still mostly a technical blog so to include something technical. The game at http://alexanderdegrote.com/games-nieuw/ was created by me using construct 2 and spriter for the "animation". These are fun and easy tools to create a game without a lot of effort. Maybe I'll do a separate post about these tools in the future.

Tuesday, September 29, 2015

It doesn't always needs to be a complicated solution... EWS “The request failed. The remote server returned an error: (401) Unauthorized"

After following this MSDN article about configuring impersonation for EWS. I was ready to go test my newly created user with impersonation rights. I already had an other account with impersonation rights which worked just fine with the following piece of code.

 Try  
      Dim svc As New ExchangeService()  
      svc.Url = New Uri("https://outlook.office365.com/EWS/Exchange.asmx")  
      svc.Credentials = New WebCredentials("svc_user@domain.com", "xxxx")   
      svc.ImpersonatedUserId = New ImpersonatedUserId(ConnectingIdType.SmtpAddress, "peter@domain.com")  
      Dim mail As New EmailMessage(svc)  
      mail.From = "peter@domain.com"  
      mail.Subject = "Test Peter svc user"  
      mail.Body = "Test Body"  
      mail.ToRecipients.Add("tom@domain.com")  
      mail.Save()  
      mail.SendAndSaveCopy()  
 Catch ex As Exception  
      MsgBox(ex.ToString)  
 End Try  

But with my newly created svc_user I kept getting the following error: "The request failed. The remote server returned an error: (401) Unauthorized". Enabling the traces on my service calls gave no extra info. After googling this error I found a lot of MSDN pages with a lot of different possible solutions, but all to no avail.
After a tip from a colleague I did what I should have done a lot sooner. Navigate to https://portal.office.com and tried logging in with the svc_user. I got nice clear message stating that my password had expired or that I should change my password on first usage. After doing this everything worked just fine and I felt a bit dumb for spending a couple of hours on this issue :-)

Saturday, September 26, 2015

Getting started with SQL

If your looking for an interesting course to start learning SQL this might be it. Courtesy of codecademy
https://www.codecademy.com/courses/learn-sql

Edit 06/06/2016

another nice resource is

Wednesday, September 16, 2015

SQL Server triggers, how to only log rows where values have actually changed.

In SQL Server inside a trigger if you want to check if a row has actually changed, you would think you could use COLUMNS_UPDATED but this only returns which columns are included in an update statement. It doesn't check if the actual values changed. A nice solution I've found is to make use of the SQL EXCEPT operator and a CTE. Here's a sample that you may find useful.


 ...  
 FOR UPDATE  
 AS  
 declare @rijen int  
 ;with ChangedData as   
      (  
      select deleted.column1, deleted.column2, deleted.column3, deleted.column4 from deleted  
           except  
      select inserted.column1, inserted.column2, inserted.column3, inserted.column4 rom inserted  
      )  
 select @rijen = count(*) from ChangedData  
 if @rijen > 0  
 begin  
 ...  
 end  

Tuesday, June 30, 2015

Mysterious error: "System.OutOfMemoryException: Error creating window handle" in a MDI environment

After setting up log4net, which I can strongly recommend. I noticed that one, and only one of my users kept getting the following error message:

 System.OutOfMemoryException: Error creating window handle. ---> System.NullReferenceException: Object reference not set to an instance of an object.  
   at System.Windows.Forms.NativeWindow.WindowClass.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)  
   at System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam) ...  

After spending hours of investigating and trying to reproduce the error, which I didn't succeed in, I finally found a solution for the problem. After changing the following piece of code

 Dim objBeheer As New FrmMyForm  
 objBeheer.MdiParent = Me  
 objBeheer.WindowState = FormWindowState.Maximized  
 objBeheer.Show()  

to the following piece of code

 Dim objBeheer As New FrmMyForm  
 objBeheer.MdiParent = Me  
 objBeheer.Show()  
 objBeheer.WindowState = FormWindowState.Maximized  

the problem was solved. The only thing changed is where the windowstate is set. It still baffles me why only one user got this error. All other users never got this error and they're all working in the same Citrix environment. But in the end of the day the error is solved and there are less errors being logged in my log4net logs :-)