views:

671

answers:

3

I created an application in VS 2008 Express as an MFC app just to take advantage of the easy GUI creation. I might re-do this app in pure win32 since no other MFC classes are used (just a button and a text box, the button fires off the main program, all win32). My only question that determines whether I stay in MFC or port it over to pure win32 is this:

How difficult is it to deploy an MFC app? What do I need to do (in VS 2008) to make sure it works on another machine?

+7  A: 

Statically link MFC and it's just another .exe.
You can just give that to the user or create an installer with either the microsoft .msi tool or a regular setup.exe with something like innosetup.

Edit - the error message in your comment is about another dll that is part of a 3rd party library. You can't (easily) take a DLL and incorporate it into your app. the licensing may also require you to ship their DLL as a separate lib.

Martin Beckett
How do I statically link? I looked in the project Properties -> Link but could not find anything.
Zombies
somewhere in the linker options it says "use MFC in dynamic library" change this to select "use MFC in static library"
Martin Beckett
Project Properties -> Configuration Properties -> General -> Use of MFC = "Use MFC in a Static Library"
demoncodemonkey
Thanks dcm - I was on a Linux machine and posting from memory
Martin Beckett
Hm, I did all of this buy I am getting: The Application failed to start because cv110.dll was not found. Re-Installing the applicaiton may fix this problem. I simply took the exe and attempted to run it on another machine...
Zombies
cv110.dll isn't MFC it's part of OpenCV image library. You will have to supply this (and any other openCV dlls) along with your app.
Martin Beckett
ps. Have you looked at just using highgui (the simple OpenCV display widget) rather than using MFC?
Martin Beckett
A: 

You can use Visual Studio Merge modules. These can be added while building the installer. Merge modules provide all the dlls, files required to run your application.

Vinay
A: 

hi sir i am try to execute program in vb2008 with opencv but i was not run error

this application has failed to start because cv110.dll was not found. Re-installing the application may fix this program

susheel
post this as a new question
Martin Beckett