Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VS2008 C++ MFC
Hello all,
I started porting to MFC feature pack to my exiting application to get better UI support. I made following changes .
 
Modify the base class.
CWinApp to CWinAppEx
CMDIFrameWnd to CMDIFrameWndEx
CMDIChildWnd to CMDIChildWndEx
 
Added following line of code in InitInstance
InitContextMenuManager();
InitShellManager();
InitKeyboardManager();
InitTooltipManager();
CMFCToolTipInfo ttParams;
ttParams.m_bVislManagerTheme = TRUE;
theApp.GetTooltipManager()->
SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,
RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);
 
code build successfully, but while launching the application i am getting crash just after login dialog apperes. while debugging i found OnInitDialog works fine. But after the oninitdialog returns , it gave exception .i dont know where exactly the crash happens .
LoginDlg oDlg(strUserName, bstrLanguage,bstrDomainName);
	
if(oDlg.DoModal() == IDOK)
{.....}
 
//OnInitDialog Code 
BOOL LoginDlg::OnInitDialog() 
{
CDialog::OnInitDialog();
 
CoTranslateWindow(GetSafeHwnd()); 
 
.........
 
return true ;
}
i am getting exception like
Unhandled exception at 0x7787703d in MyApp.exe: 0xC0000005: Access violation writing location 0x0000000000030ff8.
 

Problem Event Name:	APPCRASH
  Application Name:	MyApp.exe
  Application Version:	5.23.0.0
  Application Timestamp:	506d7f93
  Fault Module Name:	mfc90u.dll
  Fault Module Version:	9.0.30729.4967
  Fault Module Timestamp:	4b6bc34c
 
 
I know it is very abstract, but please help me .
 
Regards
BitsMax
Posted 4-Oct-12 2:11am
bitsmax469
Edited 4-Oct-12 2:36am
v2
Comments
Richard MacCutchan at 4-Oct-12 9:26am
   
From the above it's impossible to guess what may be happening. You need to put some more breakpoints in to see where the crash occurs.
bitsmax at 5-Oct-12 1:07am
   
Hello Richard,
I know it is very much difficult to guess what is happening ,
May be some person who done porting MFC feature pack , can provide me some suggestions, may be they have faced same kind of problems .
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I went through a lot of headaches in my first conversion to the Feature Pack.
 
I ended up just letting the wizard generate a fresh new framework and merging my older code into it.
 
In my view, it was important to understand why the manual conversion was failing so much as getting the code upgraded quickly, so I could get back to writing code.
  Permalink  
Comments
bitsmax at 5-Oct-12 1:04am
   
Hello Jack,
For me its not possible to generate a new framework and merge the code , as mine code too complex and large . It will be a great help if you share some suggestions and precautions in porting MFC feature pack.
Regards
BitsMax
JackDingler at 5-Oct-12 9:11am
   
I'm gonna call BS on this, as the last projects I did this with were huge, complex had many features that never should've gone into a properly written GUI application.
 
I don't have your code, nor am I familiar with it, so I can't identify what you're doing that is incompatible with the Feature Pack. In the projects I ported, these things only became obvious during the merge, when my newly merged code quit functioning.
 
The structure of your project files may have some issues, and your manifests. You might compare those against an MFC Wizard produced project.
 
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You could try to activate all check boxes in the "VS->Debug->Exceptions" dialog
and then launch the debugger again:
 

 
Compare also your sequences with their version generated by VS-Wizard for a sample Smile | :)
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 735
1 OriginalGriff 385
2 CPallini 240
3 PIEBALDconsult 150
4 Magic Wonder 131
0 OriginalGriff 5,835
1 Sergey Alexandrovich Kryukov 5,198
2 CPallini 4,740
3 George Jonsson 3,167
4 Gihan Liyanage 2,470


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 4 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100