If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Odd Dialog creation... when deleting unused line of code

Yes, we can step through all the code without a problem. When we run it in the IDE, it works fine. When we compile it and run the EXE, it moves the dialog to the corner.

What I think I need to do.... I need to create a log file that will run in the EXE and "write" out at certain places the value of ???? to watch for when it changes. I am thinking with that, I can narrow down the section of code that may have the issue(s) for now. Problem is, because we don't specifically address the dialogs creation location... I am not 100% sure where it gets the default positioning info from that it uses.

Right track, wrong track????? At this point and way too much time going after this problem... I am at a loss. I need to make some other fixes to the program but don't want to lose my "repeatable" error.

Re: Odd Dialog creation... when deleting unused line of code

So, I have to ask again, any more suggestions/recommendations?

Unless you give us the code to debug, everything that has been stated to you is what anyone here would have done already.

It's simple -- a dialog is placed at an X,Y position on the screen. There is only one way to do that, regardless of the layers of MFC or code. The dialog template that is being read by the Windows OS to position the dialog is either incorrect or corrupted. There is no other way for a dialog to show up on the screen in a certain position (if you claim you had no control over the dialog).

Even had another experienced C++ programmer look at the code

And these experienced C++ programmers cannot solve a problem that is easily duplicated at startup?

Re: Odd Dialog creation... when deleting unused line of code

Yes, we can step through all the code without a problem. When we run it in the IDE, it works fine. When we compile it and run the EXE, it moves the dialog to the corner.

What I think I need to do.... I need to create a log file that will run in the EXE and "write" out at certain places the value of ???? to watch for when it changes. I am thinking with that, I can narrow down the section of code that may have the issue(s) for now. Problem is, because we don't specifically address the dialogs creation location... I am not 100% sure where it gets the default positioning info from that it uses.

Right track, wrong track????? At this point and way too much time going after this problem... I am at a loss. I need to make some other fixes to the program but don't want to lose my "repeatable" error.

Thanks again...

You could try building a release version with debug info in it and debugging and see if you can reproduce the problem. You could always add CenterWindow in OnInitDialog, but you could potentially hide another problem by doing that.

Re: Odd Dialog creation... when deleting unused line of code

Have you tried rearranging the variables (shuffle the variables around m_bFlag)? With a bit of luck it might produce something that's easier to detect like a access violation. It's been a long time since I used VC6 but I guess that it's capable to attach to the exe when (if) it has crashed?

If your budget doesn't allow for Boundschecker or somthing similar it might allow for pc-lint (http://www.gimpel.com/html/index.htm). I've used it in many projects and it's quite good in finding suspicious areas of the code.

Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
- Brian W. Kernighan

Re: Odd Dialog creation... when deleting unused line of code

Originally Posted by pbrama

...When we run it in the IDE, it works fine. When we compile it and run the EXE, it moves the dialog to the corner.

When you run it "in the IDE", you are still running the compiled and linked executable.
Are you saying that the same exe file that runs OK from IDE behaves differently when simply double-clicked from Explorer?
Or are you talking about the differences between Debug and Release configurations?