ATLRX.H missing, oh where have you gone? At least in Visual Studio 2008

I pulled out some old code to work on a legacy project of mine and lo and behold I get “Error 29 fatal error C1083: Cannot open include file: ‘atlrx.h’: No such file or directory”. Not exactly a pretty error and worse, this file was part of the standard ATL includes.

So what the heck happened to my good ole’ friend? Well, the geniuses at Microsoft decided it would be better to sit on CodePlex. So, you can download it from here.

The library is called the ATL Server Library. Just download it, and set your include path in Visual Studio to point to it. Or get creative and copy the files into an existing include path in the program files folder(under the visual studio folder of course.

Happy Coding!

The cost of a code freeze and maybe a better way of doing it.

The cost of a code freeze

So you’re thinking about doing a code freeze in your company, or maybe you already are. This article discusses the pros and cons and potential solutions to the common pitfalls.

A “code freeze” is general the period of time in which developers of a team based software development project are barred from the check-in of code into the source code control repository. Code freezes are used as a way of obtaining a clean version of code for preparation of a release. A lot of companies use these for internal build releases as well that are generally provided for the Quality Assurance department.

Is a code freeze a good thing? Well, maybe. Conceptually it sounds like a great idea; tell all developers to hold off on the check-in of code for a set period of time while a build is prepared off of the active development branch of the source control system. Proponents of the standard code freeze argue that the lock down period of time is necessary in order to properly create a build that is functional. The issue that arises is really around the length of time the code freeze is truly in effect. If the standard build and assurance process lasts a few hours, the impact is relatively negligible. If in turn the process takes a day or longer, then the impact to the development cycle is truly felt.

The impact of the denial of code checkins on an active project is dependent on a number of factors; the size of the team, the lack of source code isolation of the distributed tasks, and the velocity of the tasks.  These variables interact in a non-definitive but potentially exponential way. The higher any of the values are, the more the value of the other variables affects the cost. For example, the more developers there are on a project the greater the impact of higher velocity and lack of source code isolation on the tasks.

Say you have X developers, they work on code with an isolation level that has a probability of interaction of Y (likelihood a developer is working on a section of code another developer is also working on), and they are working on tasks at a velocity of Z. Let us also assume the code freeze occurs for H hours. The variable interaction would be similar to H * ((X2 *  Z) * Y. While the math on this particular equation is very loose and up for debate, the potential impact is obvious. We can determine the true impact if we were to take on an actual experimental situation (or really put a lot more thought to it than I did) to find the actual impact.

What the above is basically showing is that the cost of the code freeze increases the longer it lasts and is dramatically more when a larger number of potential interactions (developer activities) are introduced.

What can be done about this?

The code freeze employed by some companies is the hold all code and wait until a valid build is created from the development/active branch of the source control system. The implied benefit is that developers can check in code ONLY to fix the actual build process and get the initial assurance verification tests to complete successfully. The cost of this particular method is generally not worth its benefit.

An alternative to this particular cycle is to use a form of the Branch by Purpose pattern (“The Importance of Branching Models in SCM.” IEEE Computing Practices. 0018-9162/02.) recommended by Walrad and Strom which dictates that you create source branches when the code in the branch will be used for a particular purpose; a bit self explanatory in nature. This method allows you to have a code freeze for only the period of time it takes to snapshot the branch. You can then build your releases of the branch. The developers will encounter minimal impact due to the brevity of the code freeze and defects can easily be fixed in the secondary branch and merged back into the main branch if necessary.

The utilization of my interpretation of this pattern is quite simple. The source control is created with a main/active development folder to house the current iteration of source code. You then create a quality assurance branch which you use to send copies of the main/active branch when you need to create builds to send off to the quality assurance team. This format allows the development team to continue on with work while the build team uses the QA branch to produce the QA builds. Any code changes to fix the process would be made in this branch and merged back to the main branch.

regsvr32.exe registering your ActiveX (ocx) gives you error 0x80040200..yuck.

I design and work with a lot of c++ code and write a number of ActiveX controls. I set my machine up so I can double click the OCX and it is associated with regsvr32.exe, so it gets registered. Nice and easy, right? I have been doing it for years. Double click, whammo. It’s registered.

Now let’s come to the present. Happy go lucky , easy as pie, double click my way to registered controls, is gone. BAH! I upgraded to Windows 7, I knew this OS had to have a gotcha!

So I get regsvr32.exe blowing up and giving me error 0x80040200. That’s real helpful, doesn’t Microsoft speak any ENGLISH. So I go and look up that ridiculous error code, and lo and behold…wait for it….wait…….User Access Control. UAC said, go away child, you can’t play here.

The long and short of it, I typed cmd.exe into the run box on the start menu, right clicked cmd.exe when it appeared and did a runas for Administrator. I then did the old school command line register of the ocx. Sad.

When I get froggy enough, I will write a batch file that will have the always run as admin attributes on it so at least UAC can prompt me to elevate.

So in short, regsvr32 on Windows 7 with UAC. You must find a way to make regsvr32.exe run elevated as an Administrator for it to work.

Windows 7, Cassini and Firefox run slow as molasses together…..

I have been developing on Windows 7 64-bit for a couple of weeks now and really like the Windows 7, but wow have my web applications run slow. I figured I would debug the issue later as maybe it was my data layer running slow. Each time I would execute a page refresh, load, navigate, whatever, it would take 2 seconds. Doesn’t seem like much, but when you click a button on a page 2 seconds is a very long time to watch it hang.

So, after getting sufficiently annoyed and impatient I was able to find that it was my app but was Firefox. Apparently Firefox has some sort of issue with IPv6.

The fix is amazingly simple.

  • In the address bar type ‘about:config’
  • Filter by ‘v6’
  • Disable ipv6 support.
Screenshot of option to disable/enable
Screenshot of option to disable/enable

Thanks to Peter Gregory for the help.

ASP.NET State server won’t start on Windows 7 64 bit. File is missing?

I went to launch my state server for ASP.NET to handle my local sites state information, in preparation for production, and the service just wouldn’t play nice. I tried to start it and it says the file doesn’t even exist.

Good times, right? So I went into the registry to see where it was pointing..%SystemRoot%Microsoft.NETFrameworkv2.0.50727aspnet_state.exe  (Yes, the path is visible on the service control properties as well)

I checked the disk and surprise surprise, it actually wasn’t there. However, there is this suspiciously obvious looking folder called Framework64. AHAH! You look in there and voila! It is in there.

Looks like the framework installer sucks. So I fixed the key and it magically started working. Amazing how when you point to the actual file it works,eh?

The fix is to change this:
key: ImagePath
to this:

Happy coding!

Windows 7 is officially bad ass…………

I got a virus on my Windows Vista machine that caused it to run slower than all holy hell. I decided, well, now must be the time to upgrade my OS. No one ever wants to go through the new OS nightmare of having to reinstall every program they use. Especially not a guy in the IT field that uses a whole lot more than just Office.

So, I went full out and put on Windows 7 64-bit. Oh yeah. I finally get all 4 gigs of my ram. I expected the OS to be pretty much Vista with a new name.

Luckily, its not. I have only had it installed for about a day now but I see all sorts of little changes that make my experience SOOOO much better.

The themes are really cool. The desktop background rotates a nice image  every hour or so. I definitely like the variety, but thats not my big happy change.

The UAC is a lot more friendly than it used to be. I like the prompts as it make me feel a bit in control, but in Vista I disabled UAC altogether because nothing worked when it was on. Windows 7, not a problem. I run Visual Studio 2008 and don’t have any of the Vista issues I had.

The biggest thing I found I like so far is the taskbar. I am not only able to “pin” my programs to it, which is a great timesaver, but I can pin my documents to the program as well. I open and close the same 4 documents all the time. Now, its easy to pop into the word icon and go right to my document. Great time saver.

The other major timesaver I use is the ability to see all the windows for a process when I click on the taskbar icon. It is so much easier to figure out what IE window I want to go to or explorer folder when I can see the image of it at a glance. 

Windows 7 gets my vote as a great new OS for productivity. Vista is a smelly pile of crap once you get used to the new Windows.

XP decides opening new windows is no fun….

I happen to do a lot of multi-tasking. I have 4 copies of Visual Studio 2008 open with Management Studio for 2008 open plus a number of different browser windows and explorer folders. I eventually run into this invisible wall where no new windows get created. No new tabs, links stop working, applications won’t launch etc. Whats the temporary fix? I start closing windows and boom, I can now open up new ones.

It seems Windows has a very unfriendly bouncer that says the club is full and until people decide to leave, no one gets in.

I get these awesome event log entries:

Application popup: ftpit.exe – Application Error : The application failed to initialize properly (0xc0000142). Click on OK to terminate the application.

So, what is the fix? Disclaimer, changes to your system can cause inoperability if done improperly. Advice is without warranty 🙂

The system seems to allocate memory to the desktop heap by certain system boot parameters. All handles GDI object and User objects seem to use this 48mb desktop heap.

The solution I tried and sitting around to see if works well is to change these boot params.

I am changing the reg key:

HKEY_LOCAL_MACHINESystemCurrentControlSetControlSession ManagerSubSystemsWindows
From : %SystemRoot%system32csrss.exe ObjectDirectory=Windows SharedSection=1024,3072,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16
To: %SystemRoot%system32csrss.exe ObjectDirectory=Windows SharedSection=1024,8192,2048 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16
You can read more about it on MSDN.
If this solves your problem, let me know.

The joy of watching your Polycom Soundpoint IP 650 rebooting endlessly…..

So…I was provisioning a new Polycom 650 and came across a lovely mind numbingly painful situation.

Let’s start out from the beginning. I went to the Asterisk box and created the proper [mac].cfg files in the tftp boot folder. I set the appropriate phone[ext].cfg files and the sip.cfg file. I then confirmed with my DCHP server that the option 66 setting was correct to the tftp:// address of the pbx.

So far so good. The phone boots up and then tries and load its application module. It says application loaded and then reboots. Hmm…WTF.

I do what all good IT folks do, bang my head on a couple of walls and visualize throwing the phone through various windows.

So I go back to the TFTP server and lo and behold, there is no SIP.ld or bootrom.ld. Great, someone decided to delete these.

I went to Polycom’s website, fearing they were still overly paranoid folks and not going to make their firmware available(as it was a couple years back), but was pleasantly surprised to find an entire archive. I downloaded the new split package, pretty cool to get the smaller files, and loaded it onto the TFTP site.

Phones rebooted and downloaded the new application and bootrom. All good right? Sure…that is until it rebooted continuously again. Damn. More head banging and vicious thoughts of gutting the phone.

I review the boot logs and find that its looking for a logo-600.bmp. Hmm..>Why would anybody have deleted that? Well, they did. So I make  new logo file and uploaded that to the TFTP server along with the missing SoundpointIPWelcome.wav file and the phone decides its happy again and boots up.

Why in the world does the phone REQUIRE that all misc files are present is beyond me, but that’s how it works.

So if your Polycom is rebooting continuosly AND you see boot logs on your tftp site (if not, you haven’t configured it to point right) then make sure all MISC files are available along with your SIP and BOOTROM files. One missing bitmap can cause your PBX empire to crumble.