I want to prevent an error from occurring when a program that uses a DLL is executed in debug mode.
The DLL was created as an MFC DLL in VisualStudio2015, and the released version is used.
Thank you.Error message
An unhandled exception occurred at 0x6E1CD930 (vcruntime140.dll) (in DataRay.exe): 0xC0000005: An access violation occurred while reading location 0x001F1000. If i have a handler for this exception, you can safely continue your program.
The error message appears, and the debugger stops at the line that calls the function of your DLL.
Adding your own DLL project to the solution of the project i am using and adding it to the reference eliminates the error.
Also, once the error no longer occurs, no further error will occur if you try to unload your own DLL project or remove the reference from the solution.
Since I do the same with multiple solutions, I want to avoid this method because I want to avoid "I accidentally rewrote my DLL code!"
- Windows7/64bit SP
- VisualStudio2015 SP1
- C ++/MFC
The situation changed slightly when .dll, .lib, and .h files that were built in Debug mode in the same environment were placed in a program that uses the DLL.
A linker error occurs and a .lib file is requested under the Debug directory in the same directory as the solution file.
The same error will eventually occur after deployment.
Also, the linker should have specified a .lib file under the lib directory, but it seems to be mysterious that the linker error can be resolved by placing it directly under the Debug directory ...
When I debug this morning, VisualStudio gets angry if the DLL version is different.
It doesn't occur when you rebuild the DLL and re-arrange it, etc. while thinking, nothing has changed ...
It's a strange story even though I haven't done any DLL program or rework. The fairy may have fixed it. (It ’s a mystery what has changed since I did n’t joke and have n’t made any changes recently.)
Anyway, because I was able to confirm that it works in the way I taught, I chose the best answer.
Answer # 1
Although you may have removed it, I will point out the point that I was worried about because it is MFC DLL.
If the DLL side is a Release build and the exe side is a Debug build, I think that an error occurred when exchanging data such as CString between the DLL and the exe.
The detailed contents are a bit suspicious, but since the MFC library in debug mode that is called on the exe side is also used on the DLL side, trying to use the MFC class on the exe side on the DLL side that was released and built I remembered that it was an exception when the memory mapping was different.
The solution is to use the debug built DLL when debugging exe, even if it is not in the same project.
Try it now.
- python - time-out error occurs during communication
- while running opencv in c ++, an error occurs when creating a file for writing a video (writeropen)
- i want to know why an access error occurs when creating a vbo buffer in opengl
- python - [error 5] access is denied: occurs in osmakedirs
- aspnet - systemnullreferenceexception error occurs during file upload
- mysql 1142 error i get an access violation, so i want to grant permission
- mysql - heroku 1142 access violation suddenly appears
- an error occurs when tracing two pointers in c ++
- c ++ - multimap access
- c ++ - i want to access private member functions of other template types
- about multivaluedictkeyerror that occurs during post processing in django
- access denied error occurs in directory move of c # in windows 10 environment
- c ++ - access to member of structure pointed to by pointer using two arrow operators
- c ++ - i was able to compile with visual studio, but when i thought that intellisense would give an error, it was cured
- i want to use decimal type in visual studio 2019 c ++
- i have a question about "void", "unsigned" and "null" in c ++
- c ++ - lnk2019: unresolved external symbol error
- c ++ - i want to delete a file
- c ++ - resolving linker error lnk2019 in visual studio 2017
- c ++ - i don't know how to treat pointers as decimal numbers or strings
- c ++ - if an array must not be used on the left side, and if you want to use an array as an lvalue in the conditional expression
- learn c ++ and get rid of questions
- c ++ - how to use the class set in the main game loop in another class