Solved

Dialog mysteriously dissapears when building release version while working fine in debug version.

Posted on 2004-03-25
2
182 Views
Last Modified: 2013-11-20
Hi everyone,
I am quite new to the mfc framework and do not even know how to display the code MS hides from me :(
This is however not the question.
I designed and programmed a little tool based on the viewex sample comming with VS.net.
This worked fine (Several views on 1 document).
Then I desided to take a small part of that tool, wanting to distribute it without the other parts of the software.
So I build a dialog based application.
The problem is that a dialog I want to display from the first one does not display in the release version.
It does so fine in the debug version. I am somewhat suprised about this problem.
Is this something a beginner runs into or is it something else?

You can download the debug version here: http://hippler.bio.upenn.edu/dnat/downloads/debug.exe
And the release version is here: http://hippler.bio.upenn.edu/dnat/downloads/release.exe
If you press "Customize Triplets" in the two dialogs, you will see the problem.
You may wanna see some source code:
http://hippler.bio.upenn.edu/dnat/downloads/tripletdlg.hpp
which is the dialog that should display when "Customize Triplets" is pressed.
http://hippler.bio.upenn.edu/dnat/downloads/dnatranslatordlg.hpp
which is the dialog that calls the above (rest of the dialog is unchanged as provided by the mfc wizard).

I would be glad to understand the problem, since I may run into it again. I am planning on releasing
different parts of the above mentioned software which seem to be useful by themselves (for biologists, that is ;-)

Thank you for reading so far.
I am glad for any suggestions to solve or work around this problem.
Jens.

0
Comment
Question by:allmer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
SteH earned 90 total points
ID: 10677975
In the declaration of the dlg you have
class CTripletDlg : public CDialog
{
[snip]
private:
      CString triplet[125]; // space for 125 strings from 0 to 124!
[snip]
}

But in DoDataExchange you use 0 to 125 so 126 strings. This will/can result in a memory access violation.

void CTripletDlg::DoDataExchange(CDataExchange* pDX)
{
[snip]
      DDX_Text(pDX, IDC_TRIP124, triplet[124]);      DDX_Text(pDX, IDC_TRIP125, triplet[125]);      
[snip]      
}

It might be pure luck that you have not fall over it in debug mode.

HTH


0
 
LVL 5

Author Comment

by:allmer
ID: 10680002
Thank you HTH,
it probably was pure luck that this didn't cause any problem with debugging.
What I also learned today i that I can do debugging while setting the configuration
to release modus. This brought up another error. A fscanf access to a FILE that did
not open in the first place.
Well, I guess there is always space for improvement.
Thanks again SteH.
Jens
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question