Thursday, November 29, 2012

Using google test with MFC applications

The problem

In order to test an MFC application with the google test framework you need a customized main function. The main function provided by the google test framework itself does not suffice as it doesn't initialize MFC properly and your application fails to start.

The solution

To solve this problem, google test allows us to create our own main function. Here's one that works-for-me. Please let me know of you come up with something more elegant.

2 comments:

  1. Thank you very much. This worked like a charm.

    ReplyDelete
  2. That is exactly what I needed. Thanks!

    ReplyDelete