Unfortunately, I did not understand the Delphi settings. I have a runtime error (wrong file name for reading data), but the problem is that I only see the error message in debugger mode. If I run the program without a debugger, then the program just stops and does not give an error. How to fix it?
Related
Thank you for your reply and comments.
Let me describe the situation more detailedly.
I use Visual C++ 2008 to write a small application that will invoke MAPI. I use MAPIStubLibrary to support both 32bit and 64bit MAPI. MAPIStubLibrary can be found at https://msdn.microsoft.com/en-us/library/office/cc963763.aspx#sectionSection2 . It works on other versions of Outlook and most of the systems. However, under Windows 10(32bit) with Office 2016(32bit) installed, when I execute the following statement to initialize MAPI:
MAPIInitialize(NULL);
I will get the above error message "The operating system is not presently configured to run this application". And there will be an unhandled exception raised from the function GetDefaultMapiHandle(), which is in StubUtils.cpp, part of the MAPIStubLibrary.
The exact line that cause the exception is:
hinstMapi = LoadLibraryW(wzPath);
It seems that MAPIStubLibrary is trying to load 32bit MAPI but fails. wzPath is pointing to olmapi32.dll instead of msmapi32.dll.
In the error message, if I click “OK” button in the error messagebox, the application will continue running without problems. However, the error message is still frustrating and confusing the users. Therefore, how to eliminate the error?
Thank you very much.
This usually happens when you are either loading a wrong MAPI dll (e.g. olmapi32.dll instead of msmapi32.dll) or if your app is running in the compatibility mode (do you include a manifest?) and the MAPI system ends up patching wrong Windows API functions assuming an older version of Windows.
I am using Oculus World Demo.
I can start it manually, but I have an internal error during "Debug"/"Release".
How to debug such errors?
Where can I see the command which runs the program.
Again:
It runs normally when I click on MyGreatestApp.exe in folder /Debug/.
It has an internal error of used DLL, when I start it in VS2103. (something like -3003 or fffff447)
P.S. I find it strange that I can debug in "Release" mode.(I mean step-by-step program execution.) Is it normal? Maybe I do it wrong? Thanks!
It could be useful if you say in what line the program crash.
Anyway you can use the Oculus Debug Tool: https://developer3.oculus.com/documentation/pcsdk/latest/concepts/dg-debug-tool/
To record logs and see at the Runtime side what is happening.
This is error -3003, check why your application is not connecting to Oculus. I should check if I running the 64 bit of my application or something like that.
ovrError_ServiceConnection = -3003, ///< Couldn't connect to the OVR Service.
Hope it helps
I am trying to understand how the PE works under windows and so am going down the route of writing a packer.
So I took the address of entry point, that points to _mainCRTStartup and replaced it with a value that points to a "jmp _mainCRTStartup".
When I run it under a debugger my program runs fine but if I just launch the executable without a debugger it crashes and I am unable to attach a debugger post crash, the debugger says that it failed to attach to the crashing process.
I guess my questions would be: Should my approach work? If so what can I try to fix this issue?
Thanks,
Max
It turns out everything worked fine, I forgot to handle an exception in an anti-debug routine that would crash the exe if it wasn't ran in a debugger.
Recently started using Windbg, as I have heard it is a great tool for debugging purpose.
There is a lot of help online on how to use windbg and the different extensions available. During my learning I constantly come across the below failure on Windbg while I am running some particular workload.
Failure:
MIL FAILURE: Unexpected HRESULT 0x8000ffff in caller: CDwmAppHost::OnUnhandledException
I tried finding help online from Google and MSDN. Maybe, I missed out something, hence could not get any help on it.
So, please, can someone help me in
-> understanding what this error message means?
-> How do I debug it? are there any extensions or other tools available to debug it?
P.S: English is not my native language, so please apologies if there are any grammatical or speling mistakes.
-> understanding what this error message means?
I don't think this message is something related to WINDBG. This is being spewed from the code that you are running. Basically when running under the debugger - if you code spews any debug messages that will get shown in WINDBG.
So to know more about what this error message means, search through your code for text displayed.
-> How do I debug it? are there any extensions or other tools available to debug it?
Like i said above, start with text search in your code to see where this message comes from - that would be your starting point !
Happy Debugging :)
The message looks like a debug message, not an exception. Debug messages can be sent by the programmer using the OutputDebugString() method (MSDN).
To check if that's really the case, you can use SysInternals DebugView. If the message shows up there when not using WinDbg, then it's true.
Since the text of a debug message is specified by the programmer, the text can be more or less meaningful. It can also be a message of a library (DLL) used by the program.
If you want to see the callstack when the message is printed, you can issue the command
sxe out
WinDbg should then stop whenever debug output is written. I'm not so sure what could be interesting at that point, here are some tries:
k; *** Callstack
!gle; *** Get last error
g; *** Go (wait for next debug output)
I have created a program which runs 2 threads synchronized using events (SetEvent(), WaitForSingleObject(), WaitForMultipleObjects()) in Visual Studio 2010. The following happens:
when I run this program using the debugger it runs for a certain time and then crashes
when I run this program without debugging (.exe file) it crashes directly
when I run this program in another computer using the debugger it crashes immediately and via .exe file it crashes after some time
The following error has been reported when debugging:
Unhandled exception at 0x5eafcaf7 (msvcr100d.dll) in test.exe: 0xC0000005: Access violation reading location 0x0036f000.
Could somebody bring some light to this topic as I don't know where to start searching? Which is the difference between running the code in the debugger or without? (Which kind of code is added?) Why do the different computers have different behaviours when running the same code?
In both computers there is exactly the same operating system (Windows 7) and I assume the same libraries and patches.
Thank you for your help!
EDIT 11.12.2012
I have installed Application Verifier and get in Visual Studio some errors displayed as this:
===========================================================
VERIFIER STOP 0000000000000013: pid 0x1E18: first chance access violation for
current stack trace
000000000874F000 : Invalid address being accessed
000000005201CAF7 : Code performing invalid access
000000000009E440 : Exception record. Use .exr to display it.
000000000009DF50 : Context record. Use .cxr to display it.
===========================================================
Does somebody know how I can see which address belongs to which line of code to know exactly where the exception occurs? I have also read in the Help of the program that using the command "!heap p -a ACCESS_ADDRESS" should give details about the nature of the error and what heap block is overrun. Where should I place this command using Visual Studio?
When working in a multi-threaded environment, things can happen at different speeds on different threads. Trying to identify the possible cause without the relevant code is quite difficult.
The error is a general memory access violation error. This usually occurs when a variable being returned from a function is bigger than expected, or different type.
Can we see the code please?