Home > Software engineering >  VS2015 with MFC dialog application reference DLL project operation error Debug an Assertion Failed!
VS2015 with MFC dialog application reference DLL project operation error Debug an Assertion Failed!

Time:10-08

VS2015 oneself use MFC to write a global hook DLL and then in another dialog project referenced in the DLL but runtime appear the following error

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Microsoft Visual c + + Runtime Library
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The Debug an Assertion Failed!

Program: C: \ Windows \ SYSTEM32 \ mfc140d DLL
File: f: \ dd \ vctools \ vc7libs \ ship \ atlmfc \ SRC \ MFC \ appcore CPP
The Line: 196


For information on how your program can cause an an assertion
Failure, see the Visual c + + documentation on asserts.

(Press Retry to debug the application)

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Abort retry (R) (A) ignore (I)
---------------------------

CodePudding user response:

add a breakpoint debugging information

CodePudding user response:

Do the hook DLL had better not use MFC,
If there is need, plus the MFC initialization,

CodePudding user response:

Yourself with the log output to see which line error, this assertion errors should be handle to 0

CodePudding user response:

Collapsed in the pop-up dialog box, press the corresponding button to enter debugging press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand when double click on the next line, until we can read ,

CodePudding user response:

Zhao4zhong1
reference 4 floor response:
collapsed in the pop-up dialog box button to enter the corresponding debugging, press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand, until can read ,

But I saw "the call stack" didn't find out what's wrong, or I send the code to you help me look at you?

CodePudding user response:

reference saylerboxer reply: 3/f
I log a look line error, this assertion caused mistakes should be handle to 0


Indicated in the error of 196 lines is appcore CPP in this ASSERT (AfxGetThread ()==NULL), can you tell me the handle to 0 if I should change?

CodePudding user response:

refer to the second floor Saleayas response:
do hook DLL had better not use MFC,
If there is need, plus the MFC initialization,

I have added the initialization,,,

CodePudding user response:

refer to 6th floor HHHeinz response:
Quote: refer to the third floor saylerboxer response:

Himself with the log output to see which line error, this assertion caused mistakes should be handle to 0


Indicated in the error of 196 lines is appcore CPP in this ASSERT (AfxGetThread ()==NULL), can you tell me the handle to 0 if I should change?

Thread has quit, the thread handle operation?
Some retry in the call stack, find your own code from the stack
  • Related