Welcome to MSDN Blogs Sign in | Join | Help

jaredpar's WebLog

Code, rants and ramblings of a programmer.

Syndication

News

Now Reading

Expert F#

What's a better book to read when learning F#?

Essential WPF

Thus far the best book I've read on WPF. Gets right down to working with WPF and the goals/history.

Purely Functional Data Structures

Reading this book makes me feel like I'm back in college. It will really get your mind going and is best read with a whiteboard handy.

Blog Roll

Eric Lippert
Dustin Campbell
Jon Skeet
Coding Horror
Brian McNamara
Hub FS
Full List

Browse by Tags

All Tags » C++   (RSS)
Type safety issue when assigning CComPtr<T> instances
Recently while making a bug fix to our selection tracking code I discovered an unexpected behavior with CComPtr<T> instances.  The crux of the fix included creating a new tracking mechanism exposed via COM in the type ISelectionTracking.  Read More...

Posted Wednesday, November 04, 2009 8:00 AM by Jared Parsons | 1 Comments

Filed under: ,

Questions not to hinge a C++ interview on
People love to chat about how to conduct a C++ interview on newsgroups .  Eventually these topics will shift into a discussion about what questions a candidate must know in order for them to get a hire from a particular interview.  Unfortunately Read More...

Posted Tuesday, April 21, 2009 8:00 AM by Jared Parsons | 7 Comments

Filed under: ,

Redefining Success
Spent about an hour debugging a bit of code today.  I was attempting to read data from a particular source and kept getting back failure codes.  After some debugging I discovered the data didn't actually exist in the source I was reading from.  Read More...

Posted Friday, October 24, 2008 8:00 AM by Jared Parsons | 1 Comments

Filed under: ,

Where does the * go?
This is a more amusing than functional debate I enter into from time to time. On a line where you declare a pointer type in C++, where should the * go? Next to the type (i.e. Type* p1;) Next to the variable name (i.e. Type *p1;) Who cares For the moment Read More...

Posted Thursday, September 04, 2008 8:00 AM by Jared Parsons | 5 Comments

Filed under: ,

Bit by void*
Recently I got bit by void* again because of another C++ quirk I didn't think through.  I had a class which wrapped a void* which could be one of many different structs.  The structs were POD and didn't have any shared functionality hence I Read More...

Posted Monday, June 16, 2008 8:00 AM by Jared Parsons | 6 Comments

Filed under: ,

do {} while(0) what?
A recent check in of mine raised a few eye brows during reviews. I checked in a few macros which ended with/contained a "do{}while(0)" and people were curious as to why. In my experience there are two main uses for it. Insert an empty statement with no Read More...

Posted Wednesday, May 21, 2008 8:00 AM by Jared Parsons | 3 Comments

Filed under: ,

Saved by PowerShell
Recently I made a very large update to our code base.  Our code base lacked a standard way of guarding entry and exit points into the various components.  Having said guards is useful for error handling, tracing, reducing redundancy, etc ...  Read More...

Posted Wednesday, May 07, 2008 8:00 AM by Jared Parsons | 0 Comments

Filed under: ,

C++ Programming Books
I was reading a post on Coding Horror the other day about programming books and how developers don't read enough of them.   I readily agree with the first two points in the article that 1) most programming books suck and 2) books are sold by weight Read More...

Posted Thursday, May 01, 2008 8:00 AM by Jared Parsons | 0 Comments

Filed under:

Gotcha: CComAutoCriticalSection and copy constructors
While investigating a crash during a suite run I found the stack walk included the destructor for a CComAutoCriticalSection . This is a fairly reliable class so I immediately suspected my code. I did a couple of quick checks for a double free and didn't Read More...

Posted Thursday, April 24, 2008 8:00 AM by Jared Parsons | 0 Comments

Filed under: ,

Thread Local Storage template
Thread local storage is another method of synchronization between threads. It is different that most synchronization cases because instead of sharing state between threads it enables developers to have independent, thread specific pieces of data which Read More...

Posted Monday, April 21, 2008 1:52 PM by Jared Parsons | 1 Comments

Filed under: , ,

Gotcha: CComPtrBase<T> assignment
Today what started out as a crash due to a pure virtual call turned into finding a gotcha in CComPtrBase<T>. Essentially the code in question boiled down to the following. Can you spot the problem? void GetAStudent(CComPtrBase<T> &spStudent) Read More...

Posted Tuesday, April 08, 2008 11:44 AM by Jared Parsons | 2 Comments

Filed under: , ,

Reference values in C++
Reference values are a powerful feature of C++ but I find they have one significant detractor. A developer can not look at an API call and determine if a parameter is being passed by reference or value (VB has the same problem). IMHO this is one item Read More...

Posted Thursday, April 03, 2008 10:24 AM by Jared Parsons | 2 Comments

Filed under: , ,

API Problems: CComObject::CreateInstance
CComObject::CreateInstance is a light weight method for creating instances of COM objects in your code. Unfortunately the design of the API makes it easy to introduce subtle errors into your code. The two problems are it encourages manually ref counting Read More...

Posted Friday, March 28, 2008 7:38 PM by Jared Parsons | 2 Comments

Filed under: , ,

Multiple paths to IUnknown
ATL has a lot of great tools for COM programming and CComPtr is a good example. It's a smart pointer class which manages the reference count of an underlying COM object. One of it's limitations though is it will only work properly when the inheritance Read More...

Posted Friday, February 22, 2008 1:21 AM by Jared Parsons | 0 Comments

Filed under: , ,

Mixing SEH and C++ Exceptions
Recently I had a half day adventure trying to catch a SafeIntException in code I was writing. The particular function involved a bit of math with user controlled values. Writing a bunch of IfFailGo's with several TryAdd style API's was getting tiresome Read More...

Posted Friday, January 11, 2008 5:18 PM by Jared Parsons | 1 Comments

Filed under: ,

More Posts Next page »
Page view tracker