Discussion:
unidentified HRESULT value
(too old to reply)
András Lukács
2008-04-10 15:46:22 UTC
Permalink
Hi, Everyone,

I'm putting together a sample application for my COM server, in which I
try to handle a few of the most common errors apart from the rest
(CoClass not registered in the Windows Registry, etc.). I'm doing this
in an effort to provide more specific error messages to users.

The error code I receive after the server's executable is removed from
the folder into which it was registered is $80070002. However, I just
can't locate an error constant for this one. I checked Windows.pas,
WinError.pas, ActiveX.pas but nothing (I use Delphi 7). Where would you
think I might be able to locate a suitable constant?

The string message of the error is (translated back to English) 'The
system cannot find the file (specified).'

Thanks a lot,
András
András Lukács
2008-04-10 18:31:50 UTC
Permalink
I would try Googling for 0x80070002, but basically codes starting with
8007 are wrappers around internal IO codes, so this is system error
code 2.
Yes, that's what I did. Most of the stuff that comes up is either some
Microsoft customer support stuff or users complaining about this error
when doing updates. I guess I'll have to use the error code as it is.
Marc Rohloff [TeamB]
2008-04-10 18:15:27 UTC
Permalink
Post by András Lukács
I checked Windows.pas,
WinError.pas, ActiveX.pas but nothing (I use Delphi 7). Where would you
think I might be able to locate a suitable constant?
I would try Googling for 0x80070002, but basically codes starting with
8007 are wrappers around internal IO codes, so this is system error
code 2.
--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com
Remy Lebeau (TeamB)
2008-04-10 18:39:53 UTC
Permalink
basically codes starting with 8007 are wrappers
around internal IO codes
More specifically, HRESULT codes that have the Severity bit set to 1 (FAIL)
and the Facility set to FACILITY_WIN32.


Gambit
Remy Lebeau (TeamB)
2008-04-10 18:38:37 UTC
Permalink
Post by András Lukács
The error code I receive after the server's executable is
removed from the folder into which it was registered is $80070002.
$80070002 is HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND).
Post by András Lukács
However, I just can't locate an error constant for this one.
Because it is not a standalone constant of its own. It is a value that is
translated from a separate Win32 error code into a COM HRESULT.


Gambit
András Lukács
2008-04-10 20:31:34 UTC
Permalink
Post by Remy Lebeau (TeamB)
Post by András Lukács
The error code I receive after the server's executable is
removed from the folder into which it was registered is $80070002.
$80070002 is HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND).
Are these macros never declared in Delphi units (e.g. as short
functions) because they are so simple?
Post by Remy Lebeau (TeamB)
Because it is not a standalone constant of its own. It is a value that is
translated from a separate Win32 error code into a COM HRESULT.
Thanks a lot!
Remy Lebeau (TeamB)
2008-04-10 20:53:18 UTC
Permalink
Post by András Lukács
Are these macros never declared in Delphi units (e.g.
as short functions) because they are so simple?
Delphi does have such functions implemented, such as HResultFromWin32().


Gambit
András Lukács
2008-04-10 21:50:49 UTC
Permalink
Post by Remy Lebeau (TeamB)
Delphi does have such functions implemented, such as HResultFromWin32().
OMG! I've always looked for them under the original name, and never ever
found them. Now that I've done a search for the function name you
mention, I see they do actually exist.

They should've at least placed the original name before them in a
comment block so a quick Search/Find... could give some result.

Dmitry Streblechenko
2008-04-10 18:59:13 UTC
Permalink
# for hex 0x80070002 / decimal -2147024894 :
COR_E_FILENOTFOUND corerror.h
# MessageText:
DIERR_NOTFOUND dinput.h
DIERR_OBJECTNOTFOUND dinput.h
STIERR_OBJECTNOTFOUND stierr.h
# 4 matches found for "0x80070002"

Exchange error lookup tool
(http://www.microsoft.com/downloads/details.aspx?familyid=be596899-7bb8-4208-b7fc-09e02a13696c&displaylang=en)
is highly recommened.
Despite having Exchange in its name, wotks for all Windows error codes.
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Post by András Lukács
Hi, Everyone,
I'm putting together a sample application for my COM server, in which I
try to handle a few of the most common errors apart from the rest (CoClass
not registered in the Windows Registry, etc.). I'm doing this in an effort
to provide more specific error messages to users.
The error code I receive after the server's executable is removed from the
folder into which it was registered is $80070002. However, I just can't
locate an error constant for this one. I checked Windows.pas,
WinError.pas, ActiveX.pas but nothing (I use Delphi 7). Where would you
think I might be able to locate a suitable constant?
The string message of the error is (translated back to English) 'The
system cannot find the file (specified).'
Thanks a lot,
András
András Lukács
2008-04-10 20:38:08 UTC
Permalink
Post by Dmitry Streblechenko
Exchange error lookup tool
(http://www.microsoft.com/downloads/details.aspx?familyid=be596899-7bb8-4208-b7fc-09e02a13696c&displaylang=en)
is highly recommened.
Despite having Exchange in its name, wotks for all Windows error codes.
Thanks! I've downloaded it, and I'll try it!
Loading...