Solved

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

Posted on 2004-03-25
2
179 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 125
iSeries FTP Exit Program 8 135
sumNumber challenge 16 122
sum13 challenge 24 106
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

785 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