Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-03-25
2
Medium Priority
?
186 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 360 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month9 days, 14 hours left to enroll

927 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