Visual Studio 2008 and 2010 Oddness

by Codewiz51 18. July 2011 08:37

I cleaned up my hard drive several weeks ago.  One task that I accomplished was removing a splattering of Windows SDK installations.  I think I had six different versions installed.  It certainly felt good and freed up some disk spaced consolidating everything to Windows SDK 7.1.

Except, I tried to build a setup package of a program I had completed.  It would not builld.  Both VS 2010 and VS 2008 informed me that it could not find the msi installer AND the WindowsSDKDir was pointing to an invalid location.  Hmm...

Not to fear.  I did a repair of VS 2008 and VS 2010 and all is well.

One thing I did learn, do not repair VS 2008 SP1 from the installation media: "Do not repair VS 2008 SP1 from installation media".  I followed the same logic when repairing VS 2010.  Repair the systems from the Add-Remove programs menu item (when using XP.)

Unfortunately, I am back to 3 installed versions of the Windows SDK, but that's OK.  Everything is working now and I am not going to mess with it.

Tags: , , , ,

Life | Programming

Working with ATL's CComGITPtr Class

by Codewiz51 16. March 2011 19:43

I've been working on a series of articles regarding threading and ATL 9.  I recently decided to update Microsoft's sample multithreaded IConnectionPointImpl implementation, called IConnectionPointImplMT.  You can read about the original work on the Microsoft Support WebSite: SAMPLE: ATLCPImplMT encapsulates ATL event firing across COM apartments.  The template uses the Global Interface Table (GIT) to marshal the ATL event interface to a thread that is not executing in the primary thread of the STA.

The component was written for ATL 3.0 and will not compile when used with ATL 9.0.  I decided to update the component to compile with ATL 9 and Visual Studio 2008.

In the course of modifying the code, I decided to use CComGITPtr to handle implementation of IGlobalInterfaceTable. This decision proved more difficult to implement than I first realized.  The problem is, CComGITPtr is revoke happy.  If you do not call Detach after calling Attach, you will end up wondering why you cannot use a GIT cookie more than once.  I finally had to go through the template source to understand that Detach is the only way to clear the pointer without revoking the interface.  You must also be careful that the pointer does not go out of scope before you Detach it, or the interface associated with your GIT cookie will be revoked.

The moral of this story: If you call Attach, you had better call Detach or your interface will be revoked from the GIT.

Here's the updated ATLCPImplMT.h. Update: I uploaded a version of the header that would not compile.  I also found some bugs when I attempted to use the class in a true multi-threaded environment.  This is the latest version.

ATLCPImplMT.1.7z (2.58 kb)

Tags: , ,

Programming

Windows 7 and VS 2008

by Codewiz51 20. January 2011 20:26

The last few days have been one of disease and pestilence in my household.  The stomach flu struck us with a vengence.  First the baby came down with it.  We struggled mightly to keep her hydrated during the ordeal.  Then my daughter got sick and finally I was came down with symptoms.  It was just not much fun to live here.

I found out tonight that I was a bit sloppy with my work on DCDFLIB.  I've been working on Windows XP, but over the holidays I "upgraded" to Windows 7; tonight, I finally dusted off VS 2008 and began cleaning up routines in the library.  After compiling, I initiated testing and BOOM!  The DLL image was wrong.  I searched the internet for a bit and realized I would need to set up x86 and x64 environments for both my test program and the statistics library.  After a bit of project modification, I was back to testing on Windows 7.

The moral is, make sure all of your components are targeting the same environments when working with managed C++ and C#.

Tags: , ,

Programming

A Small Gripe About Visual Studio 2008

by Codewiz51 5. February 2010 09:15

I switch often between c++ and web development in VS 2008.  There is a command line switch that allows you to switch environments. 

Here's the command line switch:

devenv.exe /ResetSettings settingsFile.vssettings

My short cut setting ends up looking like the following for C++

"D:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"
  /ResetSettings "C:\Some Dir\My Documents\Visual Studio 2008\Settings\c++-2009-06-04.vssettings"

My web dev startup looks like:

"D:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"
  /ResetSettings "C:\Some Dir\My Documents\Visual Studio 2008\Settings\Web-2009-06-19.vssettings"

Unfortunately, starting up VS 2008 this way takes time.  Lots of time.  I've been playing with VS 2010 beta, and it seems to have the same issue.  Why change settings?  Try opening a web project with C++ settings and you will see what I mean.  Menu options are missing.  I played around with customizing the environment, but I am not enough of a VS 2008 whiz to get it the way I want it.  Perhaps I'll dive into it some rainy Saturday now that football season is over.

Looks like the real solution would be to have VS 2008 setup on two different VMs.  My D drive is always mapped to virtual machines anyway, so everyone has access to the VSS database.  All it takes is time, a few Gigs of RAM and a TByte of disk, right? Cool

Tags:

Programming

Reconditioning My Development Environment

by Codewiz51 12. January 2010 08:19

I was assigned to a project in San Antonio by my company for half of 2009. Now that I am back home, I've been getting my development environment reconditioned:

  • Install all necessary updates for Windows XP
  • Install all necessary updates for Windows Vista
  • Update platform SDK's for Windows XP.
  • Install the Visual Studio 2008 Feature Pack (for TR1 extensions) on the Vista VM
  • Install XNA and Silverlight tools
  • Check in all files to VSS 2005
  • Analyze and repair VSS 2005 databases
  • Make sure that WinROTT and DCDFLIB compile
  • Unit test compile output
  • Backup www.codewiz51.com web site to my hard drive

More...

Tags: , , ,

Life | Programming

Disclaimer

This blog represents my personal hobby, observations and views. It does not represent the views of my employer, clients, especially my wife, children, in-laws, clergy, the dog, the cats or my daughter's horse. In fact, I am not even sure it represents my views when I take the time to reread postings.

© Copyright 2008-2011