Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we unit test our c++ COM code without registering the dlls?

We are trying to add unit testing to out legacy c++ COM application. We also need our build machines to be able to runt he unit tests to ensure each build hasn't introduced errors. However we don't want the build machines to have to register the com dlls so that one build machine can build multiple versions in parallel. We assumed that we could change to using registration free com with manifest files, but i am having a very difficult time getting that to work. Not on our code base yet but just on the basic example provided by Microsoft.
I've been using this page http://msdn.microsoft.com/en-us/library/ms973913.aspx#rfacomwalk_topic8 and it simply won't work, when i try to run with the dll unregistered to use the manifest files, i get the "Class not registered error"

The samples they provide work fine (using c++ com server and c++ client), however when i rebuild them they don't work.

We are using Visual Studio 2013 and so it looks to me like there has been a large change in the way that registration free com works, which makes this tutorial incompatible with the newer compiler.

Can anyone point me to resources on using registration free com with the latest version of visual studio? To further complicate things in our own app when i get there we are using VS 2013 but targeting the 2010 compiler, hopefully that won't make to much difference.

Also if there's a better way of running c++ unit tests on com components without registering than manifest files i would like to hear about those as well.

Thanks for your help.

like image 441
John C Avatar asked Jun 23 '14 11:06

John C


1 Answers

Probably too late for the OP but for anyone else that comes across this question, there is an article by Samuel Jack on this here... which may or may not help future readers...

See http://blog.functionalfun.net/2012/09/a-quick-guide-to-registration-free-com.html

like image 141
0909EM Avatar answered Sep 28 '22 23:09

0909EM