[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Need a debug expert.

Posted on 2005-04-28
5
Medium Priority
?
923 Views
Last Modified: 2013-11-20
Hi All,
I am working in vc++ 6. I am getting an assert error in my program in debug mode as follows:

_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
      { ASSERT(afxCurrentResourceHandle != NULL);
            return afxCurrentResourceHandle; }

I know this is a bool value returning true when it should be false but I have been over and over my code and I just can't find the problem. I have checked all the resources and find no problems. Can enyone point me in the right direction to solving this problem?

Thanks,
Arnold.
0
Comment
Question by:arnold100
  • 3
  • 2
5 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 13888413
Hi arnold100,
Post your code.....

David Maisonave :-)
Cheers!
0
 

Author Comment

by:arnold100
ID: 13888584
Hi Axter,
I have no idea what part of my program is causing the problem. It's a resource problem but I can't figure out what resource is causing it. The program works fine in release mode but not in debug mode. The debugger points me to this code:

_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
     { ASSERT(afxCurrentResourceHandle != NULL);
          return afxCurrentResourceHandle; }
 I am working in mfc. A resource is returning a true value when it should be returning a false value. I was hopeing someone here would have some idea of where to look for the problem.
0
 
LVL 30

Accepted Solution

by:
Axter earned 200 total points
ID: 13888612
>>The debugger points me to this code:

When the debugger points you to that part of the code, what does your stack show?

Look at your stack, and reverse trace the stack until it points to your code.
0
 

Author Comment

by:arnold100
ID: 13888822
Axter, I found it. something very simple.

I declared 2 variables in the wrong order:

HINSTANCE m_hInstance;
CString m_sCrpFile;

Because m_hInstance was before m_sCrpFile it caused an assert error on m_hInstance. After I stepped through the code a few more times I spotted it. Never had that happen before. Changed to:

CString m_sCrpFile;
HINSTANCE m_hInstance;

The assert error was gone.

Thank you for the help anyway,
Arnold.

0
 
LVL 30

Expert Comment

by:Axter
ID: 13888846
Welcome.

Thanks for the points
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Integration Management Part 2

873 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