Saturday, 15 June 2013

visual studio 2010 - How can we unit test our c++ COM code without registering the dlls? -



visual studio 2010 - How can we unit test our c++ COM code without registering the dlls? -

we trying add together unit testing out legacy c++ com application. need our build machines able runt unit tests ensure each build hasn't introduced errors. don't want build machines have register com dlls 1 build machine can build multiple versions in parallel. assumed alter using registration free com manifest files, having hard time getting work. not on our code base of operations yet on basic illustration provided microsoft. i've been using page http://msdn.microsoft.com/en-us/library/ms973913.aspx#rfacomwalk_topic8 , won't work, when seek run dll unregistered utilize manifest files, "class not registered error"

the samples provide work fine (using c++ com server , c++ client), when rebuild them don't work.

we using visual studio 2013 , looks me there has been big alter in way registration free com works, makes tutorial incompatible newer compiler.

can point me resources on using registration free com latest version of visual studio? farther complicate things in our own app when there using vs 2013 targeting 2010 compiler, won't create much difference.

also if there's improve way of running c++ unit tests on com components without registering manifest files hear well.

thanks help.

you implement own version of cocreateinstance take dll path parameter. code (error handling , other details omitted brevity):

hresult cocreateinstancefortest(dllpath, rclsid, riid, ppv) { hinstance hinst = loadlibrary(dllpath); // todo: maybe loaded dllgetclassobject = getprocaddress(hinst, "dllgetclassobject"); homecoming dllgetclassobject(rclsid, riid, ppv); }

besides error handling, need maintain track of dlls loaded. utilize list or array in each element has tuple track this. @ point might want unload or of them.

of course, assuming these inproc com servers.

c++ visual-studio-2010 unit-testing side-by-side registration-free-com

No comments:

Post a Comment