Interpreting Error Codes

After you have determined which application is the source of a problem, you need to find out what error has occurred. Errors are raised and reported in different formats, depending on the language your application uses.

In Microsoft Visual C++, success, warning, and failure values are returned using a 32-bit number known as a HRESULT. For a list of system-defined HRESULT values, see the header file Winerror.h included with the Windows SDK. This file includes all COM+ error codes and descriptions. For more information about HRESULT values, see Error Handling.

In the Java language, an instance of com.ms.com.ComFailException is thrown to indicate failure, where the ComFailException object specifies an HRESULT. An instance of com.ms.com.ComSuccessException indicates success with a return value of False. For information about interpreting these exceptions, see the Microsoft Visual J++ documentation.

Note

COM+ application server processes that are hosting Visual J++ objects will not idle down (even with zero active objects) unless you turn off JIT debugging in the VJ6 IDE. For information on how to do so, see the Visual J++ documentation.

In Visual Basic, you can retrieve HRESULT values by examining the Err.Number property. A description of the error can be retrieved with the Err.Description property.

You can also use the ERRLOOK utility in Microsoft Visual Studio to retrieve a system error message or module error message. ERRLOOK retrieves the error message text automatically if you drag-and-drop a hexadecimal or decimal value from the Visual Studio debugger or other Automation-enabled application. You can also enter a value by either typing it in or pasting it from the IDE clipboard and clicking the Look Up option.

The following C++ method prints a description of the error, based upon the input HRESULT.

#include <stdio.h>
#include <windows.h>
#include <tchar.h>

void ErrorDescription(HRESULT hr) 
{ 
     if(FACILITY_WINDOWS == HRESULT_FACILITY(hr)) 
         hr = HRESULT_CODE(hr); 
     TCHAR* szErrMsg; 

     if(FormatMessage( 
       FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, 
       NULL, hr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 
       (LPTSTR)&szErrMsg, 0, NULL) != 0) 
     { 
         _tprintf(TEXT("%s"), szErrMsg); 
         LocalFree(szErrMsg); 
     } else 
         _tprintf( TEXT("[Could not find a description for error # %#x.]\n"), hr); 
}

The following table provides descriptions of common error codes in COM+.

SymbolicCodeDescription
COMADMIN_E_ALREADYINSTALLEDThe object is already registered.
COMADMIN_E_APP_FILE_READFAILError occurred reading the application file.
COMADMIN_E_APP_FILE_VERSIONInvalid version number in application file.
COMADMIN_E_APP_FILE_WRITEFAILError occurred writing to the application file.
COMADMIN_E_APPDIRNOTFOUNDApplication install directory was not found.
COMQC_E_APPLICATION_NOT_QUEUEDOnly COM+ applications marked "queued" can be created using the "queue" moniker.
COMADMIN_E_APPLICATIONEXISTSThe application is already installed.
COMADMIN_E_APPLID_MATCHES_CLSIDA CLSID with the same GUID as the new application ID is already installed on this machine.
COMADMIN_E_APP_NOT_RUNNINGThe specified application is not currently running.
COMADMIN_E_AUTHENTICATIONLEVELUnable to set required authentication level for update request.
COMADMIN_E_BADPATHThe file path is invalid.
COMADMIN_E_BADREGISTRYLIBIDThe registered type library ID is invalid.
COMADMIN_E_BADREGISTRYPROGIDThe component's ProgID is missing or corrupt.
COMADMIN_E_CAN_NOT_EXPORT_APP_PROXYThe application proxy is not exportable.
COMADMIN_E_CAN_NOT_START_APPFailed to start application because it is either a library application or an application proxy.
COMADMIN_E_CAN_NOT_EXPORT_SYS_APPThe system application is not exportable.
COMADMIN_E_CANT_SUBSCRIBE_TO_COMPONENTThe user cannot subscribe to this component because the component may have been imported.
COMADMIN_E_CANTCOPYFILEAn error occurred copying the file.
COMADMIN_E_CLSIDORIIDMISMATCHApplication file CLSIDs or IIDs do not match corresponding DLLs.
COMADMIN_E_COMP_MOVE_BAD_DESTThe component move failed because the destination application no longer exists.
COMADMIN_E_COMP_MOVE_LOCKEDThe component move was disallowed because the source or destination application either is a system application or is currently locked against changes.
COMADMIN_E_COMPFILE_BADTLBThe type library could not be loaded.
COMADMIN_E_COMPFILE_CLASSNOTAVAILThe DLL does not support the components listed in the type library.
COMADMIN_E_COMPFILE_DOESNOTEXISTThis file does not exist.
COMADMIN_E_COMPFILE_GETCLASSOBJThe GetClassObject method failed in the DLL.
COMADMIN_E_COMPFILE_LOADDLLFAILThe DLL could not be loaded.
COMADMIN_E_COMPFILE_NOREGISTRARThe component registrar referenced in this file is not available.
COMADMIN_E_COMPFILE_NOTINSTALLABLEThe file does not contain components or component information.
COMADMIN_E_COREQCOMPINSTALLEDA component in the same DLL is already installed.
COMADMIN_E_DLLLOADFAILEDThe DLL could not be loaded.
COMADMIN_E_DLLREGISTERSERVERThe DllRegisterServer function failed when the component was installed.
COMADMIN_E_EVENTCLASS_CANT_BE_SUBSCRIBERAn event class cannot be configured as a subscriber component. When an attempt is made to create a subscription with an event class as a subscriber, this error is returned.
COMADMIN_E_INVALIDUSERIDSOne or more users in the application file are not valid.
COMADMIN_E_KEYMISSINGThe object was not found in the catalog.
COMADMIN_E_LIB_APP_PROXY_INCOMPATIBLELibrary applications and application proxies are incompatible. This error is returned when an attempt is made to export an application proxy and the application's activation property is a library.
COMADMIN_E_NOREGISTRYCLSIDThe component's CLSID is missing or corrupt.
COMADMIN_E_NOSERVERSHARENo server file share is available.
COMADMIN_E_NOTCHANGEABLEChanges to this object and its sub-objects have been disabled.
COMADMIN_E_NOTDELETEABLEThe delete function has been disabled for this object.
COMADMIN_E_NOTINREGISTRYObject was not found in registry.
COMADMIN_E_NOUSEROne or more users are not valid.
COMADMIN_E_OBJECT_DOES_NOT_EXISTOne of the specified objects cannot be found.
COMADMIN_E_OBJECT_PARENT_MISSINGOne of the objects being inserted or updated does not belong to a valid parent collection.
COMADMIN_E_OBJECTERRORSErrors occurred accessing one or more objects. For more information, see the ErrorInfo collection.
COMADMIN_E_OBJECTEXISTSThe object you are attempting to add or rename already exists.
COMADMIN_E_OBJECTINVALIDOne or more of the object's properties are missing or invalid.
COMADMIN_E_OBJECTNOTPOOLABLEThis object is cannot be pooled.
COMADMIN_E_PROPERTYSAVEFAILEDOne or more property settings are either invalid or in conflict with each other.
COMADMIN_E_PROPERTY_OVERFLOWThe property value is too large.
COMADMIN_E_REGFILE_CORRUPTThe registration file is corrupt.
COMADMIN_E_REGISTERTLBThe system was unable to register the type library.
COMADMIN_E_REGISTRARFAILEDErrors occurred while in the component registrar.
COMADMIN_E_REMOTEINTERFACEInterface information is either missing or changed.
COMADMIN_E_REQUIRES_DIFFERENT_PLATFORMThis operation is not enabled on this platform.
COMADMIN_E_ROLE_DOES_NOT_EXISTA role assigned to a component, interface, or method does not exist in the application.
COMADMIN_E_ROLEEXISTSThe role already exists.
COMADMIN_E_SERVICENOTINSTALLEDThe service is not installed.
COMADMIN_E_SESSIONThe server catalog version is not supported.
COMADMIN_S_SOMEALREADYPAUSEDOne or more of the specified application processes were already paused.
COMADMIN_S_SOMEALREADYRUNNINGOne or more of the specified application processes were already running.
COMADMIN_E_START_APP_NEEDS_COMPONENTSTo start the application, you must have components in an application.
COMADMIN_E_SVCAPP_NOT_POOLABLE_OR_RECYCLABLEThe COM+ applications running as an NT service may not be marked as pooled or recycled.
COMADMIN_E_SYSTEMAPPThis operation cannot be performed on the system application.
COMADMIN_E_USER_IN_SETOne or more users are already assigned to a local partition set.
COMADMIN_E_USERPASSWDNOTVALIDThe identity or password set on the application is not valid.
65 entries

Article text from the Win32 documentation (opens in a new tab), by Microsoft, under the CC BY 4.0 (opens in a new tab) licence.