Solved

Bugs in release version

Posted on 1997-07-16
8
296 Views
Last Modified: 2013-11-20
How do you track bugs in release version of code in MFC developer studio 4.2? No problems in debug version. Get an error of illegal memory location 0x00000000 somewhere in MFC DLLs. Any suggestions?

More info on this. Debug version works ok.Release has problem in displaying most modal dialogs. It fails due to an illegal access in CDialog constructor, somewhere in the MFC DLLS. Could it be that the MFC DLLS are corrupted and I need to install the compiler again?
0
Comment
Question by:rvenkat
  • 6
  • 2
8 Comments
 

Author Comment

by:rvenkat
ID: 1302593
Edited text of question
0
 
LVL 4

Accepted Solution

by:
mbhakta earned 50 total points
ID: 1302594
This is a patent problem  found with most VC 4.2 users. The problem starts because, MS released a number of patches for the 4.2 version, this meant a major overhaul and bug fixes to the most important components in the software viz .MFC*.DLL's. There are instances when user downloads a patch and updates his system. He finds every bug he was encountering , fixed by the boys in Redmond . Some days later he installs a couple of softwares from the net and happily uses it , the next day the boss knocks on the door and asks him 'Today is the Release date are you ready ? ' . Our man , does a final test on his EXE and gosh , his EXE is crashing.. Why ?

The problem is , not with his code  but with the packages he installed in the last few days. They overwrote his patch with older versions of VC++ 4.2 runtime files. So what is the solution ?

Link your application statically to the MFC libraries. The size of the binary might increase by about 20% but that is much better than a crash.

Try it on yours I am fairly confident this might be one reason you are facing a problem , if not a bug in one of your code implementation.

Also don't forget to download the latest patch of 4.2 for MS.
0
 

Author Comment

by:rvenkat
ID: 1302595
Thanks mbhakta for the promt response. I am addled by all the various patches listed for MFC 4.2. Can you recommend? one from this list.

These 3 patches for VC++ were listed. They all seem to be the same and dated  9/26/96
regards
RV

///////////////////////////////////////////
 <Picture>VC42B.EXE Visual C++ 4.2b Patch
This patch is a technology update for Visual C++ 4.2 which updates Visual C++ 4.2 retail installation to work with the final release of the Win32 and Activex SDKs. There are four self-extraxting files available that contain different combinations of the patch: VC42B.EXE,42BB1B2.EXE, MSDEV42b.EXE, and SDK42B.exe. You should download the proper files that best suit your needs. (6145740 bytes, published 09/26/96 )
//////////////////////////////////////////////////////////////
<Picture>MSDEV42.EXE Visual C++ 4.2b Patch
This patch is a technology update for Visual C++ 4.2, which updates Visual C++ 4.2 retail installation to work with the final release of the Win32 and ActiveX SDKs. There are four self-extracting files available: VC42B.EXE, 42BB1B2.EXE, MSDEV42B.EXE, AND SDK42B.EXE. You should download the proper files that best suit your needs. (7604341 bytes, published 09/26/96 )
/////////////////////////////////////////////////
 <Picture>VC42B.EXE Visual C++ 4.2b Patch
This patch is a technology update for Visual C++ 4.2, which updates Visual C++ 4.2 retail installation to work with the final release of the Win32 and ActiveX SDKs. There are four self-extracting files available: VC42B.EXE, 42BB1B2.EXE, MSDEV42B.EXE, and SDK42B.EXE. You should download the proper files that best suit your needs. (8447041 bytes, published 09/26/96 )
0
 

Author Comment

by:rvenkat
ID: 1302596
Hello mbhakta.
I am plagued by an RC compiler error when i try and link statically to MFC. (there is no such thing when I link to MFC DLLS). Errors are redefinition of string constants  in <afxres.h> header (nothing at all to do with string constants I've used for my own resources). This of course is included in <afxwin.h>. As far as I know its included only once thru the "stadafx.h" standard inclusion header of my project. So why am I getting this?
--------------------------------------------------
--------------------Configuration: NOTES - Win32 Debug--------------------
Compiling resources...


D:\MSDEV\MFC\include/afxres.rc (119): error RC2151 : cannot reuse string constants


D:\MSDEV\MFC\include/afxres.rc (137): error RC2151 : cannot reuse string constants
Error executing rc.exe.
NOTES.exe - 2 error(s), 0 warning(s)
--------------------------------------------------------------

I am almost in the same predicament as the protagonist in your earlier response. I can hear the knocks on the door. My release is due shortly.


0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:rvenkat
ID: 1302597
Sorry to bug u mbhakta. The above terms are defined in <afxres.h> (as a constant) and again in <afxres.rc> (as a string). They clash as redfinitions when the <afxres.rc> is compiled.
Thanks
0
 
LVL 4

Expert Comment

by:mbhakta
ID: 1302598
As it goes with the beta patch of VC++ , I suggest unzipping the largest one out of them, which will have fixes for the UI, libraries and headers. I don't remember the file names at the top of my head sorry. The error when you build in release mode looks quite funny. Now do one thing (the easiest I can think of). Create a dummy project which follows the same framework as your application (SDI / MDI / Dialog based etc.) , after creating. Go to the resources tab. Right click on the root item and select 'Resource Includes' from the popup menu. The 'Resource Inc' dlg pop's up. Copy the contents of the edit boxes into your project's 'Res Inc'. Recompile and this should work.
0
 

Author Comment

by:rvenkat
ID: 1302599
Hello mbhakta
Right off, thanks for all your sensible suggestions.  

I 've done the following and still the problem persists in the release version.

1) I updated the latest beta patch(extracted from VC42B.EXE) with deferenece to every bit of instruction in the readme .txt. No dice. Still no probs with the debug. Release bombs - even while constructing a Dialog. The release (MFC DLL version )did not have any problem about a month ago.

2)Followed your suggestions viz: creating new project and copying over the RC - include specs from EDit boxes.
Still plagued by the RC compiler error when I link to MFC as a static library.Experimeted a little further. Examined WORD PAD RC include specs (my project is similar, except its not an ole srver and has DB access built in). Harmless straight forward set of includes.Copied them over to my project. Problem with resource compiler persisted. I also tried this in an older version of my project (thereby eliminating the possibility that this was 'cause of something I did the last few months). No Dice. Problem with RC compiler persists. Tried compiling WORDPAD with the static lib. No probs.

So I have come to the painful but inevitable conclusion its something in my code. The problem is I do'nt know where to begin. Should I treat these as separate or related problems (Relase version & RC compilation with MFC static libs)?

Let me sound out a few ideas for your input.

1) One place would be to see if any mangling of resource ids has taken place. Any suggestions here?

2) The only other option is to begin a new project and slowly rebuilt everything from scratch. Thats 6 mos of work that needs to be built.

3) The other option (which would be my chioce) is to deconstruct my code step by step and see if the problem vanishes at some point. Its probably worth mentioning at this point that I have, in the last few weeks, added some third party spell checker sofware, and have incl. the MFC GRid control in one of my dialogs. Since that time, I 've noticed that there are colliding DLLs and these are getting relocated. ( I tend to think this is harmles 'cause I used to see the same stuff with ODBC driver calls). The code HAS'NT bombed ONCE this way.      

4) The last is to upgrade to VC++ 5.0. But my feeling is if your code can't work with VC+4.2 you 've still got the bug lurking somewhere- to come and haunt you later on, perhaps even in the debug version.

Any & all advice will be welcomed.
In DIRE STRAITS.
Regards
RV
0
 

Author Comment

by:rvenkat
ID: 1302600
Hello mbhakta.
Your hunch was right. Let me explain
1)I deconstructed the app. To no avail. Problem persisted with DLL release version.
2)Remember i could'nt get past RC compiler stage for static lib
Well I decided to built project from scratch. At one point a resource ID in a menu item conflicted with the lib. I changed the ID. And the problem disappered. I think I have a few more IDS like these. So I am proceeding cautiously.
3)Now the project built with static MFC lib does not have the (original) problem in the release verson - at least no the same problem But a minor one has cropped up. I am using
CPictureHolder class. In DLL version it compiles and links fine. But in static MFC lib methods aren't defined. Linker gives a problem. Know whats going on?

In any case you have solved my earlier problem and deserve the the points and the appelation "Gods gift to MFC programmers"

0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 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

13 Experts available now in Live!

Get 1:1 Help Now