Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
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
Updated 4-Oct-12 2:36am
v2
Comments
Richard MacCutchan 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 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 .

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 :)
 
Share this answer
 
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.
 
Share this answer
 
Comments
bitsmax 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 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.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900