Solved

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

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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. …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now