📄 msmqerr.cpp
字号:
//aa weaaaweiMsmqerr.cpp: implementation of the CMsmqerr class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Msmqerr.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMsmqerr::CMsmqerr()
{
}
CMsmqerr::~CMsmqerr()
{
}
CString CMsmqerr::Geterr(int nerr)
{
if (nerr== MQ_ERROR) return " GenericError";
if (nerr== MQ_ERROR_PROPERTY) return " One or more of the passed properties are invalid.";
if (nerr== MQ_ERROR_QUEUE_NOT_FOUND) return " The queue is not registered in the DS";
if (nerr== MQ_ERROR_QUEUE_EXISTS) return " A queue with the same pathname is already registered";
if (nerr== MQ_ERROR_INVALID_PARAMETER) return " An invalid parameter passed to a function.";
if (nerr== MQ_ERROR_INVALID_HANDLE) return " An invalid handle passed to a function.";
if (nerr== MQ_ERROR_OPERATION_CANCELLED) return " The operation was cancelled before it could be completed.";
if (nerr== MQ_ERROR_SHARING_VIOLATION) return " Sharing violation. The queue is already opened for exclusive receive.";
if (nerr== MQ_ERROR_SERVICE_NOT_AVAILABLE) return " The Message Queues service is not available";
if (nerr== MQ_ERROR_MACHINE_NOT_FOUND) return " The specified machine could not be found.";
if (nerr== MQ_ERROR_ILLEGAL_SORT) return " Illegal sort specified in MQLocateBegin (e.g., duplicate columns).";
if (nerr== MQ_ERROR_ILLEGAL_USER) return " The user is an illegal user.";
if (nerr== MQ_ERROR_NO_DS) return " No connection with this site's controller(s).";
if (nerr== MQ_ERROR_ILLEGAL_QUEUE_PATHNAME) return " Illegal queue path name.";
if (nerr== MQ_ERROR_ILLEGAL_PROPERTY_VALUE) return " Illegal property value.";
if (nerr== MQ_ERROR_ILLEGAL_PROPERTY_VT) return " Invalid VARTYPE value.";
if (nerr== MQ_ERROR_BUFFER_OVERFLOW) return " The buffer supplied to MQReceiveMessage for message body retrieval was too small. The message is not removed from the queue and part of the message body that fits in the buffer was copied.";
if (nerr== MQ_ERROR_IO_TIMEOUT) return " The MQReceiveMessage timeout has expired";
if (nerr== MQ_ERROR_ILLEGAL_CURSOR_ACTION) return " MQ_ACTION_PEEK_NEXT specified to MQReceiveMessage can not be used with the current cursor position.";
if (nerr== MQ_ERROR_MESSAGE_ALREADY_RECEIVED) return " A message that is currently pointed at by the cursor has been removed from the queue by another process or by another call to MQReceiveMessage without the use of this cursor.";
if (nerr== MQ_ERROR_ILLEGAL_FORMATNAME) return " The given format name is invalid.";
if (nerr== MQ_ERROR_FORMATNAME_BUFFER_TOO_SMALL) return " The format name buffer supplied to the API was too small to fit the format name";
if (nerr== MQ_ERROR_UNSUPPORTED_FORMATNAME_OPERATION) return " The requested operation for the specified format name is not supported (e.g., delete a direct queue format name).";
if (nerr== MQ_ERROR_ILLEGAL_SECURITY_DESCRIPTOR) return " The specified security descriptor is not a valid security descriptor.";
if (nerr== MQ_ERROR_SENDERID_BUFFER_TOO_SMALL) return " The passed buffer for the user ID property is too small.";
if (nerr== MQ_ERROR_SECURITY_DESCRIPTOR_TOO_SMALL) return " The size of the buffer passed to MQGetQueueSecurity is too small.";
if (nerr== MQ_ERROR_CANNOT_IMPERSONATE_CLIENT) return " The RPC server can not impersonate the client application, hence security credentials could not be verified.";
if (nerr== MQ_ERROR_ACCESS_DENIED) return " Access is denied.";
if (nerr== MQ_ERROR_PRIVILEGE_NOT_HELD) return " Client does not have the required privileges to perform the operation.";
if (nerr== MQ_ERROR_INSUFFICIENT_RESOURCES) return " Insufficient resources to perform operation.";
if (nerr== MQ_ERROR_USER_BUFFER_TOO_SMALL) return " Request failed because user buffer is too small to hold the returned information";
if (nerr== MQ_ERROR_MESSAGE_STORAGE_FAILED) return " Could not store a recoverable or journal message. Message was not sent";
if (nerr== MQ_ERROR_SENDER_CERT_BUFFER_TOO_SMALL) return " The passed buffer for the user certificate property is too small.";
if (nerr== MQ_ERROR_INVALID_CERTIFICATE) return " The user certificate is not valid.";
if (nerr== MQ_ERROR_CORRUPTED_INTERNAL_CERTIFICATE) return " The internal MSMQ certificate is corrupted.";
if (nerr== MQ_ERROR_NO_INTERNAL_USER_CERT) return " The internal MSMQ certificate for the user does not exist.";
if (nerr== MQ_ERROR_CORRUPTED_SECURITY_DATA) return " A cryptogrphic function has failed.";
if (nerr== MQ_ERROR_CORRUPTED_PERSONAL_CERT_STORE) return " The personal certificate store is corrupted.";
if (nerr== MQ_ERROR_COMPUTER_DOES_NOT_SUPPORT_ENCRYPTION) return " The computer does not support encryption operations.";
if (nerr== MQ_ERROR_BAD_SECURITY_CONTEXT) return " Bad security context.";
if (nerr== MQ_ERROR_COULD_NOT_GET_USER_SID) return " Could not get the SID information out of the thread token.";
if (nerr== MQ_ERROR_COULD_NOT_GET_ACCOUNT_INFO) return " Could not get the account information for the user.";
if (nerr== MQ_ERROR_ILLEGAL_MQCOLUMNS) return " Invalid MQCOLUMNS parameter";
if (nerr== MQ_ERROR_ILLEGAL_PROPID) return " Invalid propid value";
if (nerr== MQ_ERROR_ILLEGAL_RELATION) return " Invalid relation value in restriction";
if (nerr== MQ_ERROR_ILLEGAL_PROPERTY_SIZE) return " Illegal property buffer size";
if (nerr== MQ_ERROR_ILLEGAL_RESTRICTION_PROPID) return " Invalid propid value in MQRESTRICTION parameter";
if (nerr== MQ_ERROR_ILLEGAL_MQQUEUEPROPS) return " Illegal MQQUEUEPROPS parameter, either null or with zero properties";
if (nerr== MQ_ERROR_PROPERTY_NOTALLOWED) return " Invalid propid for the requested operation (e.g. PROPID_Q_INSTANCE in MQSetQueueProperties)";
if (nerr== MQ_ERROR_INSUFFICIENT_PROPERTIES) return " Not all the required properties for the operation were specified in the input parameters";
if (nerr== MQ_ERROR_MACHINE_EXISTS) return " Computer with the same name already exists in the site.";
if (nerr== MQ_ERROR_ILLEGAL_MQQMPROPS) return " Illegal MQQMPROPS parameter, either null or with zero properties";
if (nerr== MQ_ERROR_DS_IS_FULL) return " DS is full";
if (nerr== MQ_ERROR_DS_ERROR) return " Internal DS error.";
if (nerr== MQ_ERROR_INVALID_OWNER) return " Invalid object owner. For example MQCreateQueue failed because the QM object is invalid";
if (nerr== MQ_ERROR_UNSUPPORTED_ACCESS_MODE) return " The specified access mode is not supported.";
if (nerr== MQ_ERROR_RESULT_BUFFER_TOO_SMALL) return " The supplied result buffer is too small";
if (nerr== MQ_ERROR_DELETE_CN_IN_USE) return " The Connected Network can not be deleted, it is in use.";
if (nerr== MQ_ERROR_NO_RESPONSE_FROM_OBJECT_SERVER) return " No response from object owner.";
if (nerr== MQ_ERROR_OBJECT_SERVER_NOT_AVAILABLE) return " Object owner is not reachable.";
if (nerr== MQ_ERROR_QUEUE_NOT_AVAILABLE) return " Error while reading from a queue residing on a remote computer";
if (nerr== MQ_ERROR_DTC_CONNECT) return " Cannot connect to MS DTC";
if (nerr== MQ_ERROR_TRANSACTION_IMPORT) return " Cannot import the transaction";
if (nerr== MQ_ERROR_TRANSACTION_USAGE) return " Wrong transaction usage";
if (nerr== MQ_ERROR_TRANSACTION_SEQUENCE) return " Wrong transaction operations sequence";
if (nerr== MQ_ERROR_MISSING_CONNECTOR_TYPE) return " Connector Type is mandatory when sending Acknowledgment or secure message";
if (nerr== MQ_ERROR_STALE_HANDLE) return " The Queue manager service has been restarted. The queue handle is stale, and should be closed.";
if (nerr== MQ_ERROR_TRANSACTION_ENLIST) return " Cannot enlist the transaction";
if (nerr== MQ_ERROR_QUEUE_DELETED) return " The queue was deleted. Messages can not be received anymore using this queue handle. The handle should be closed";
if (nerr== MQ_ERROR_ILLEGAL_CONTEXT) return " Invalid context parameter (MQLocateBegin).";
if (nerr== MQ_ERROR_ILLEGAL_SORT_PROPID) return " Invalid propid value in MQSORTSET";
if (nerr== MQ_ERROR_LABEL_TOO_LONG) return " The passed label is too long. It should be less or equal to MQ_MAX_MSG_LABEL_LEN";
if (nerr== MQ_ERROR_LABEL_BUFFER_TOO_SMALL) return " The label buffer supplied to the API was too small";
if (nerr== MQ_ERROR_MQIS_SERVER_EMPTY) return " The list of MQIS servers (in registry) is empty.";
if (nerr== MQ_ERROR_MQIS_READONLY_MODE) return " MQIS database is in read-only mode.";
if (nerr== MQ_ERROR_SYMM_KEY_BUFFER_TOO_SMALL) return " The passed buffer for the Symmetric key property is too small.";
if (nerr== MQ_ERROR_SIGNATURE_BUFFER_TOO_SMALL) return " The passed buffer for the Signature property is too small.";
if (nerr== MQ_ERROR_PROV_NAME_BUFFER_TOO_SMALL) return " The passed buffer for the Provider name property is too small.";
if (nerr== MQ_ERROR_ILLEGAL_OPERATION) return " The operation is illegal on foreign message queuing system";
if (nerr== MQ_ERROR_WRITE_NOT_ALLOWED) return " Another MQIS server is being installed, write operations to the database are not allowed at this stage.";
if (nerr== MQ_ERROR_WKS_CANT_SERVE_CLIENT) return " MSMQ independent clients cannot serve MSMQ dependent clients.";
if (nerr== MQ_ERROR_DEPEND_WKS_LICENSE_OVERFLOW) return " The number of dependent clients served by this MSMQ server reached its upper limit.";
if (nerr== MQ_CORRUPTED_QUEUE_WAS_DELETED) return " Ini file for queue %1 in LQS was deleted because it was corrupted.";
if (nerr== MQ_ERROR_REMOTE_MACHINE_NOT_AVAILABLE) return " The remote machine is not available. Informational";
if (nerr== MQ_INFORMATION_PROPERTY) return " One or more of the passed properties resulted in warning but the function completed.";
if (nerr== MQ_INFORMATION_ILLEGAL_PROPERTY) return " Invalid property id.";
if (nerr== MQ_INFORMATION_PROPERTY_IGNORED) return " The specified property is ignored in this operation (e.g., PROPID_M_SENDERID in SendMessage().";
if (nerr== MQ_INFORMATION_UNSUPPORTED_PROPERTY) return " The specified property is not supported and is ignored in this operation";
if (nerr== MQ_INFORMATION_DUPLICATE_PROPERTY) return " The specified property already appeared in the propid array, and is ignored in this operation";
if (nerr== MQ_INFORMATION_OPERATION_PENDING) return " Asynchronous operation is currently pending.";
if (nerr== MQ_INFORMATION_FORMATNAME_BUFFER_TOO_SMALL) return " The format name buffer supplied to MQCreateQueue was too small to fit the format name. Queue was created successfully";
return "";
}
CString CMsmqerr::GetErrText(_com_error err)
{
CString cstemp;
cstemp= err.ErrorMessage();
if (cstemp.Left(7)=="Unknown" )return Geterr(err.Error());
return cstemp;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -