![]() |
Tip: Beware of the MFC-version in VS2008 SP1 |
Post Reply ![]() |
Author | |
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() Posted: 11 March 2009 at 5:11am |
I believe the "Codejock Deployment" tool should take the new MFC-version into account. Something like "Do you want to link Toolkit.dll to the latest MFC/CRT version?" The problemSome new projects link to the new (bloated) MFC version:
#define _BIND_TO_CURRENT_VCLIBS_VERSION 1 // First in StdAfx.h
This makes your exe dependent on MFC 9.0.30729.1, but the codejock lib/dll links to the old (better) version: 9.0.21022.8. After extensive testing, I have seen that this new version is not backwards compatible!
Later, when you compile your Setup project using VS 2008 SP1, it will only add the latest (9.0.30729.1) Merge Module (found in %PROGRAMFILES%\Common Files\Merge Modules). This adds some extra 10 MB to your final MSI file and your executable will not run if the older MFC version is not present in the system.
Resolution A - use the old MFC-version
1) Before your install VS 2008 SP1, make sure to copy the merge modules and store them on a safe place:
Microsoft_VC90_CRT_x86.msm
Microsoft_VC90_MFC_x86.msm
Microsoft_VC90_MFCLOC_x86.msm
policy_9_0_Microsoft_VC90_CRT_x86.msm
policy_9_0_Microsoft_VC90_MFC_x86.msm
policy_9_0_Microsoft_VC90_MFCLOC_x86.msm
2) Install SP1.
3) Make sure your Codejock applications do not define _BIND_TO_CURRENT_VCLIBS_VERSION - anywhere!
4) Make sure your deployment project uses your own merge modules (from the VS 2008 installation).
5) Remove all BCG-includes (AfxControlBars.h etc). Use CWinApp instead of CWinAppEx etc.
Resolution B - use the new MFC-version
1) Install SP1.
2) Recompile the Codejock lib/dll with _BIND_TO_CURRENT_VCLIBS_VERSION defined!
Resolution A requires some more work, but resolution B means 10 MB of useless sh*t in your MSI (BCG ribbon images etc). I'm certainly going to stick with the old version.
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
ABuenger ![]() Newbie ![]() ![]() Joined: 02 February 2006 Status: Offline Points: 1075 |
![]() ![]() ![]() ![]() ![]() |
Resolution C - Link everything statically ???
|
|
Codejock support
|
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Doesn't help if you define _BIND_TO_CURRENT_VCLIBS_VERSION. (This problem is not Codejock specific.)
The main problem is that VS 2008 SP1 has not got the MSM-files you need. (Blame Microsoft!)
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
terrym ![]() Senior Member ![]() Joined: 13 April 2007 Status: Offline Points: 836 |
![]() ![]() ![]() ![]() ![]() |
We have VS 2008 SP1 and do not get this extra 10mb??? Also we have tested on new installs of OS's without any errors in our applications, however we do have a strange problem that only seems to be happening on XP Home Edition whereby our application crashes when calling:
pFrame = CreateNewFrame(pDocument, NULL);
from within CSingleDocTemplate
Any ideas anybody (sorry its off topic, but got a few customers complaining :()
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Right... Try this:
Create a new MFC application (using SP1). Link statically and build a Release-exe. The size will be around 1732 kB. Then replace "CWinAppEx" with "CWinApp" and remove the "#include <afxcontrolbars.h>" in your StdAfx.h. After compilation the exe size is around 418 kB.
And this is for static linking! If you link dynamically, you have to include all MFC/CRT libraries in your distribution, which is around 10 MB.
To verify that your installation works you have to install it on a clean Windows 2000/XP machine! As soon as you install a program which deploys MFC, your installation test will give you false positives - since MFC is not removed upon deinstallation!
Regarding the crash; need more info. Stack trace?
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
terrym ![]() Senior Member ![]() Joined: 13 April 2007 Status: Offline Points: 836 |
![]() ![]() ![]() ![]() ![]() |
Ok we link dynamically and supply the VS 2008 SP1 Redist so it installs all required files, and have tested on Windows 2000, XP, Vista and 7 without issue. However this problem is totally strange with CreateNewFrame but we cant give a stack trace as we cant get to happen on our XP Home, it only happens on several of our customers. All of which have XP Home.
It simply crashes with above message and thats it, and we then tried to remote debug, but the remote debugger lol for VS 2008 does not work on XP Home as it says not compatible lol.
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Look out for AntiVirus such as Norton. Especially if you use some kind of hooks (skin manager?).
What does GetLastError() give you?
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
terrym ![]() Senior Member ![]() Joined: 13 April 2007 Status: Offline Points: 836 |
![]() ![]() ![]() ![]() ![]() |
As I say it crashes in CreateNewFrame which is called within OpenDocumentFile, once CreateNewFrame is called then it crashes within this windows function and never returns. So impossible also to do GetLastError etc.
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |