Win32: What is HRESULT 0x80070002? - winapi

I can't find the definition of HRESULT: 0x80070002
I can usually find these searching the include paths but this code was not found. Does anyone have the explanation of what it is? I think it is coming from the shell.
Thanks.

0x80070002 is the Win32 error code 2 (ERROR_FILE_NOT_FOUND) in HRESULT format, as returned by the HRESULT_FROM_WIN32() macro.
When in doubt, you can use the HRESULT_FACILITY() and HRESULT_CODE() macros to help you figure out what an HRESULT stands for.
In this case, 0x80070002 has a facility of 7 (FACILITY_WIN32), meaning the code (2) is a Win32 error code (ERROR_FILE_NOT_FOUND).

errlook.exe says it is "The system cannot find the file specified." , agreed that it is not in any of the SDK (or VS2019) headers.

Removing and adding the service(WebSite) back in IIS fixed the error for me.
It might have been the case of the service path being incorrect since it was last added in IIS.
Make sure you're passing the correct physical path to IIS when adding the a web site.

Related

Invalid MEX-file '<myfile>.mexw64': <myfile>.mexw64 is not a valid Win32 application

While trying to run opencv sample matlab call, I am getting an error
Invalid MEX-file 'mypath\displayImage.mexw64': mypath\displayImage.mexw64 is not a valid Win32 application.
There are no errors while compiling. Also there are no errors while compiling and running simple helloworld sample.
What can be a reason for this? Why it expects win32 when even filename says 64?
Matlab is 2013a, VS is 2012, both are 64bit.
UPDATE
I found this "solution" of year 2009 saying that any of called DLLs should be 64 bit.
Is this
(1) true nowadays, and
(2) possible in practice?
How to check if some called library is 32bit?
Ok my PATH was pointing to %OPENCV_DIR%\build\x86\vc11\bin and this was overriding any LIB settings.
This was at runtime.
I.e. when I fixed PATH value, program started to run even without recompiling.

File Path in C++ Assert not found on my disk

I am using Visual C++ to build a dll with some open source projects, but when I got an error, it read:
How did the "f:\dd\vctools\crt_bld\self_x86\crt\src\vsprintf.c" come out? I even didn't have a "f" disk. I've searched around about my source code, and there is no such string.
Any idea about this?
The file path as #Dcoder says is not from your disk.
This message is from the CRT (C run time library) that you link with your programs. MSVCRT.DLL (or a version of it)
When Microsoft wrote their source code to create this library they built special code called Assertions into it. This code (when you link to debug version of the library) checks the parameters that you sent to a function in the library, and passes helpful messages to you.
In this case you've called a function like printf or sprintf etc, and that eventually went into a piece of Microsoft function that lives in a microsoft file called vsprintf.c.
This file when the library was compiled inside Microsoft, it was done on the F: drive INSIDE Microsoft . It doesn't live on your disk.
Edit: if you add your code to your question we can help you find where this occurred.
As others have indicated in comments, the path described in the assertion dialog is the path of the source file that threw the assertion. In this case, a CRT sprintf function threw an assert.
The 'f:...' path doesn't refer to a path on your own machine: it's the path to the source file on the machine that compiled the file into the CRT DLL.
This is a debug assertion failure - you apparently passed a NULL-value to a function of the sprintf-family.
You should check your source-code for any NULL-values you pass to such a function.
It's where the Common Run Time (CRT) framework is installed. vsprintf.c is part of the CRT and something in that DLL has called one of the sprintf() functions with a null format string.

vb6 user-defined type not defined error on full compile

I have some vb6 code I have not compiled in a long time. The last compile is in production. Now I get an error "User-defined type is not defined" when I do a full compile. I'm sure there is a reference missing. But there is no code that is hi-lighted. And I cannot seem to find what reference might be lost.
Any clues as to what I can do to find the missing reference would be very helpful.
Thanks!
Dave
I've had that happen before it drove me crazy!! But then I found this:
 
http://support.microsoft.com/kb/190197
 
Occurs when compiling with binary compatibility on. The above solution suggests turning off binary compatibility and re-compiling - then missing reference will then be highlighted.
Other steps you can try:
Rather than turning off BC for everything look for ones that have
been recently changed
search C: drive and dev folder and delete any
*.oca files
also look in the vbp file for any oca references
You need to ensure that you have the appropriate items checked in the References dialog. This is outside the code and they are listed in the VBP file (text file).
EDIT Corrected reference storage. Thanks MarkJ
Make sure all of your object types are spelled right. A simple error like spelling Variant Varient can cause this error as well.
Are you still using the same machine in which the original compile was made and / or with the same OS
?
If the answer is no, then there is a chance that VB6 or its like linked to a reference which is no longer available in Win7 or later, this may also include the compiler if you are using a modern version of studio.
Since the code is also in VB6, if you are using any outside commercial controls, and again if not on the same machine, you would loose those links as well if you did not port over the library.

How to get the missing DLL name after when GetLastError() returns ERROR_MOD_NOT_FOUND

My application loads a DLL using LoadLibrary() suppressing the standard critical-error-handler message box. When LoadLibrary() fails and GetLastError() returns ERROR_MOD_NOT_FOUND (0x7E) I'd like to retrieve the missing DLL name. This error code is set not only when the requested DLL is missing, but also when any DLL it depends on is missing.
It's worth noting that the standard message box (which is suppressed) displays the correct missing DLL name, and the question is how can I get it within the code.
Thanks
I'm not sure there's an easy way of getting the missing DLL's name. But you can probably find it by stepping through LoadLibrary() in the debugger and seeing which function fails with what filename in the parameters. depends.exe can also show the dependencies.
Also, it might worth a try firing up the process monitor and using appropriate filters see what I/O errors there are in your process and for what files.
If you're calling LoadLibrary with a DLL name, shouldn't you already know the name?
You could always try hooking LoadLibrary if this isn't the case.

Where is ERROR_PENDING defined?

The MSDN documentation for CommitTransactionAsync indicates it may produce an ERROR_PENDING error code. However, this error code does not seem to be defined in winerror.h, nor any other header reachable from ktmw32.h or windows.h (using the version of the Windows SDK included in Visual Studio 2010). In fact, I cannot find a single file containing the text ERROR_PENDING anywhere in the Windows SDK 7.1; manually going through the list of System Error Codes doesn't reveal it either. Where can I find the definition of this elusive error code?
Experimentation shows CommitTransactionAsync to produce ERROR_SUCCESS - is this a simple matter of the documentation being wrong?
It's a doc bug. #flashk's guess is correct: it can produce ERROR_IO_PENDING. I am submitting a bug to the doc owner today. Thanks!

Resources