Solved

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
cat dog challenge 18 127
Macro to save highlighted rows as a separate file 5 45
Expand to include initial dialog with two choices. 9 80
Authenticate using sesu from script 7 60
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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…
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 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