MessageQueueErrorCode 枚举   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
标识在消息队列应用程序中发生的并生成 MessageQueueException 异常的错误源。
此 API 支持产品基础结构,不能在代码中直接使用。
public enum class MessageQueueErrorCodepublic enum MessageQueueErrorCodetype MessageQueueErrorCode = Public Enum MessageQueueErrorCode- 继承
字段
| 名称 | 值 | 说明 | 
|---|---|---|
| AccessDenied | -1072824283 | 消息正文:“拒绝访问。拒绝访问指定队列或计算机。” 如果返回此错误,请验证是否具有操作访问权限,例如创建、删除或设置队列的属性。 有关更改队列访问权限的信息,请参阅 MessageQueueAccessRights 和 SetPermissions。 | 
| BadSecurityContext | -1072824267 | 消息正文:“错误的安全上下文。” | 
| Base | -1072824320 | 消息队列不返回此错误代码。 | 
| BufferOverflow | -1072824294 | 消息正文:“为 MQReceiveMessage 检索消息体提供的缓冲区太小”。 “不从队列中移除消息,而且复制了缓冲区可容纳的部分消息体。” | 
| CannotCreateCertificateStore | -1072824209 | 消息正文:“无法为内部证书创建证书存储区。” | 
| CannotCreateHashEx | -1072824191 | 消息正文:“无法为已验证身份的消息创建哈希对象。” | 
| CannotCreateOnGlobalCatalog | -1072824201 | 消息正文:“未能在指定的全局编录服务器上创建对象。” | 
| CannotGetDistinguishedName | -1072824194 | 消息正文:“未能检索到本地计算机的识别名。” | 
| CannotGrantAddGuid | -1072824206 | 消息正文:“未能将‘添加 GUID’的权限授予当前用户。” | 
| CannotHashDataEx | -1072824193 | 消息正文:“无法对已验证身份的消息散列数据。” | 
| CannotImpersonateClient | -1072824284 | 消息正文:“RPC 服务器无法模拟客户端应用程序,因此未能验证安全凭据。” | 
| CannotJoinDomain | -1072824202 | 消息正文:“未能联接 Windows 2000 域上的‘消息队列’企业版。” | 
| CannotLoadMsmqOcm | -1072824205 | 消息正文:“无法加载 MSMQOCM.DLL 库。” | 
| CannotOpenCertificateStore | -1072824208 | 消息正文:“无法为内部证书打开证书存储区。” | 
| CannotSetCryptographicSecurityDescriptor | -1072824212 | 消息正文:“无法为加密密钥设置安全说明符。” | 
| CannotSignDataEx | -1072824192 | 消息正文:“无法在发送已验证身份的消息之前对数据签名。” | 
| CertificateNotProvided | -1072824211 | 消息正文:“用户尝试发送没有证书的已验证身份消息。” | 
| ComputerDoesNotSupportEncryption | -1072824269 | 消息正文:“计算机不支持加密操作。”  | 
| CorruptedInternalCertificate | -1072824275 | 消息正文:“内部消息队列证书已损坏。” | 
| CorruptedPersonalCertStore | -1072824271 | 消息正文:“个人证书存储区已损坏。” | 
| CorruptedQueueWasDeleted | -1072824216 | 消息正文:“LQS 中队列的 .ini 文件因损坏而被删除。” | 
| CorruptedSecurityData | -1072824272 | 消息正文:“加密函数已失败。” | 
| CouldNotGetAccountInfo | -1072824265 | 消息正文:“未能得到该用户的帐户信息。” | 
| CouldNotGetUserSid | -1072824266 | 消息正文:“未能从线程标记中获取 SID 信息。” | 
| DeleteConnectedNetworkInUse | -1072824248 | 消息正文:“已连接的网络正在使用中,无法删除。” | 
| DependentClientLicenseOverflow | -1072824217 | 消息正文:“此消息队列服务器所服务的非独立客户端的数目已达到该服务器的上限。” | 
| DsError | -1072824253 | 消息正文:“内部目录服务错误。” | 
| DsIsFull | -1072824254 | 消息正文:“目录服务已满。” | 
| DtcConnect | -1072824244 | 消息正文:“无法连接到 MS DTC。” | 
| EncryptionProviderNotSupported | -1072824213 | 消息正文:“消息队列不支持加密服务提供程序。” | 
| FailVerifySignatureEx | -1072824190 | 消息正文:“已接收消息的签名无效。” | 
| FormatNameBufferTooSmall | -1072824289 | 消息正文:“提供给 API 的格式名缓冲区太小,无法容纳格式名。” | 
| Generic | -1072824319 | 消息正文:“一般性错误。” | 
| GuidNotMatching | -1072824200 | 消息正文:“未能创建其 GUID 与计算机安装相匹配的消息队列配置对象。”。 “必须卸载‘消息队列’,然后重新安装它。” | 
| IllegalContext | -1072824229 | 消息正文:“上下文参数无效。” | 
| IllegalCriteriaColumns | -1072824264 | 消息正文:“无效的 MQCOLUMNS 参数。” | 
| IllegalCursorAction | -1072824292 | 消息正文:“指定给 MQReceiveMessage 的 MQ_ACTION_PEEK_NEXT 不能与当前游标位置一起使用。” | 
| IllegalEnterpriseOperation | -1072824207 | 消息正文:“此操作对消息队列服务对象无效。” | 
| IllegalFormatName | -1072824290 | 消息正文:“给定的格式名称无效。” 有关有效格式名称语法选项,请参阅 MessageQueue 类的 FormatName 属性。 | 
| IllegalMessageProperties | -1072824255 | 消息正文:“MQQMPROPS 参数无效,该参数为 null 或者没有属性。” | 
| IllegalOperation | -1072824220 | 消息正文:“此操作在外部消息队列系统上无效。” | 
| IllegalPrivateProperties | -1072824197 | 私有属性参数值无效。 这可能是因为它的值为 null 或者没有指定属性。 | 
| IllegalPropertyId | -1072824263 | 消息正文:“属性标识符值无效。” | 
| IllegalPropertySize | -1072824261 | 消息正文:“属性缓冲区大小无效。” | 
| IllegalPropertyValue | -1072824296 | 消息正文:“属性值无效。” | 
| IllegalPropertyVt | -1072824295 | 消息正文:“VARTYPE 值无效。” | 
| IllegalQueuePathName | -1072824300 | 消息正文:“队列路径名无效。” | 
| IllegalQueueProperties | -1072824259 | 消息正文:“MQQUEUEPROPS 参数无效,该参数为 null 或者没有属性。” | 
| IllegalRelation | -1072824262 | 消息正文:“限制中的关系值无效。” | 
| IllegalRestrictionPropertyId | -1072824260 | 消息正文:“MQRESTRICTION 参数中的 PropId 值无效。” | 
| IllegalSecurityDescriptor | -1072824287 | 消息正文:“指定的安全说明符不是有效的安全说明符。” | 
| IllegalSort | -1072824304 | 消息正文:“指定的排序(例如,重复列)无效。” | 
| IllegalSortPropertyId | -1072824228 | 消息正文:“MQSORTSET 中的 PropId 值无效。” | 
| IllegalUser | -1072824303 | 消息正文:“此用户的用户名无效。” | 
| InsufficientProperties | -1072824257 | 消息正文:“未在输入参数中指定该操作必需的所有属性。” | 
| InsufficientResources | -1072824281 | 消息正文:“执行操作所需的资源不足。” | 
| InvalidCertificate | -1072824276 | 消息正文:“用户证书无效。” | 
| InvalidHandle | -1072824313 | 消息正文:“传递给函数的句柄无效。” | 
| InvalidOwner | -1072824252 | 消息正文:“对象所有者无效。”。 例如, | 
| InvalidParameter | -1072824314 | 消息正文:“传递给函数的参数无效。” | 
| IOTimeout | -1072824293 | 消息正文:“接收或查看消息超时时间已到。” | 
| LabelBufferTooSmall | -1072824226 | 消息正文:“提供给 API 的标签缓冲区太小。” | 
| MachineExists | -1072824256 | 消息正文:“此站点中已存在同名的计算机。” | 
| MachineNotFound | -1072824307 | 消息正文:“未能找到指定的计算机。” | 
| MessageAlreadyReceived | -1072824291 | 消息正文:“游标当前指向的消息已被另一个进程或另一个在不使用此游标的情况下接收消息的调用从该队列中移除。” | 
| MessageNotFound | -1072824184 | 消息正文:“未能找到指定的消息。” | 
| MessageStorageFailed | -1072824278 | 消息正文:“未能存储可恢复的消息或日记消息。”。 没有发送消息。 | 
| MissingConnectorType | -1072824235 | 消息正文:“在发送确认或安全消息时,连接器类型是强制的。” | 
| MqisReadOnlyMode | -1072824224 | 消息正文:“MQIS 数据库处于只读模式。” | 
| MqisServerEmpty | -1072824225 | 消息正文:“MQIS 服务器列表(在注册表中)为空。” 此错误仅适用于消息队列 1.0。 | 
| NoDs | -1072824301 | 消息正文:“没有与此站点控制器的连接。” | 
| NoEntryPointMsmqOcm | -1072824204 | 消息正文:“无法在 MSMQOCM.DLL 库中找到入口点。” | 
| NoGlobalCatalogInDomain | -1072824196 | 消息正文:“未能在指定域中找到全局编录服务器。” | 
| NoInternalUserCertificate | -1072824273 | 消息正文:“用户的内部消息队列证书不存在。” | 
| NoMsmqServersOnDc | -1072824203 | 消息正文:“未能在域控制器上找到消息队列服务器。” | 
| NoMsmqServersOnGlobalCatalog | -1072824195 | 消息正文:“未能在全局编录域控制器上找到消息队列服务器。” | 
| NoResponseFromObjectServer | -1072824247 | 消息正文:“对象所有者没有响应。” | 
| ObjectServerNotAvailable | -1072824246 | 消息正文:“无法访问对象所有者。” | 
| OperationCanceled | -1072824312 | 消息正文:“此操作在完成前被取消。” | 
| PrivilegeNotHeld | -1072824282 | 消息正文:“客户端没有执行此操作所需的特权。” | 
| Property | -1072824318 | 消息正文:“传递的一个或多个属性无效。” | 
| PropertyNotAllowed | -1072824258 | 消息正文:“所请求操作的属性无效。” | 
| ProviderNameBufferTooSmall | -1072824221 | 消息正文:“为提供程序名称属性传递的缓冲区太小。” | 
| PublicKeyDoesNotExist | -1072824198 | 消息正文:“此计算机的公钥不存在。” | 
| PublicKeyNotFound | -1072824199 | 消息正文:“未能找到计算机的公钥。” | 
| QDnsPropertyNotSupported | -1072824210 | 不支持将 DNS 属性作为队列搜索条件。 | 
| QueueDeleted | -1072824230 | 消息正文:“已删除队列。”。 “使用此队列实例无法再接收任何消息。”。 “应关闭队列。” | 
| QueueExists | -1072824315 | 消息正文:“已注册具有相同路径名的队列。” | 
| QueueNotAvailable | -1072824245 | 消息正文:“在从驻留于远程计算机上的队列中读取时出错。” | 
| QueueNotFound | -1072824317 | 消息正文:“队列未在目录服务中注册。” | 
| RemoteMachineNotAvailable | -1072824215 | 消息正文:“远程计算机不可用。” | 
| ResultBufferTooSmall | -1072824250 | 消息正文:“提供的结果缓冲区太小。” | 
| SecurityDescriptorBufferTooSmall | -1072824285 | 消息正文:“传递给  | 
| SenderCertificateBufferTooSmall | -1072824277 | 消息正文:“为用户证书属性传递的缓冲区太小。” | 
| SenderIdBufferTooSmall | -1072824286 | 消息正文:“为用户标识符属性传递的缓冲区太小。” | 
| ServiceNotAvailable | -1072824309 | 消息正文:“消息队列服务不可用。” | 
| SharingViolation | -1072824311 | 消息正文:“共享冲突。”。 “队列已被打开用于独占接收。” | 
| SignatureBufferTooSmall | -1072824222 | 消息正文:“为签名属性传递的缓冲区太小。” | 
| StaleHandle | -1072824234 | 消息正文:“已重新启动队列管理器服务。” “队列句柄已失效,应将其关闭。” | 
| SymmetricKeyBufferTooSmall | -1072824223 | 消息正文:“为对称密钥属性传递的缓冲区太小。” | 
| TransactionEnlist | -1072824232 | 消息正文:“无法登记事务。” | 
| TransactionImport | -1072824242 | 消息正文:“无法导入事务。” | 
| TransactionSequence | -1072824239 | 消息正文:“错误的事务操作序列。” | 
| TransactionUsage | -1072824240 | 消息正文:“错误的事务使用。” | 
| UnsupportedAccessMode | -1072824251 | 消息正文:“不支持指定的访问模式。” | 
| UnsupportedFormatNameOperation | -1072824288 | 消息正文:“不支持对指定格式名称执行请求的操作。” | 
| UnsupportedOperation | -1072824214 | 消息正文:“WORKGROUP 安装计算机不支持此操作。” | 
| UserBufferTooSmall | -1072824280 | 消息正文:“由于用户缓冲区太小,无法容纳返回的信息,请求失败。” | 
| WksCantServeClient | -1072824218 | 消息正文:“独立于消息队列的客户端无法为依赖于消息队列的客户端提供服务。” | 
| WriteNotAllowed | -1072824219 | 消息正文:“正在安装另一个 MQIS 服务器;此时不允许向数据库进行写操作。” | 
示例
以下示例验证消息队列队列是否存在,然后将其删除。
#using <system.dll>
#using <system.messaging.dll>
using namespace System;
using namespace System::Messaging;
int main()
{
   
   // Determine whether the queue exists.
   if ( MessageQueue::Exists( ".\\myQueue" ) )
   {
      try
      {
         
         // Delete the queue.
         MessageQueue::Delete( ".\\myQueue" );
      }
      catch ( MessageQueueException^ e ) 
      {
         if ( e->MessageQueueErrorCode == MessageQueueErrorCode::AccessDenied )
         {
            Console::WriteLine( "Access is denied. Queue might be a system queue." );
         }
         
         // Handle other sources of MessageQueueException.
      }
   }
   return 0;
}
using System;
using System.Messaging;
namespace MyProject
{
    /// <summary>
    /// Provides a container class for the example.
    /// </summary>
    public class MyNewQueue
    {
        //**************************************************
        // Provides an entry point into the application.
        //		
        // This example verifies existence and attempts to
        // delete a queue.
        //**************************************************
        public static void Main()
        {
            // Determine whether the queue exists.
            if (MessageQueue.Exists(".\\myQueue"))
            {
                try
                {
                    // Delete the queue.
                    MessageQueue.Delete(".\\myQueue");
                }
                catch(MessageQueueException e)
                {
                    if(e.MessageQueueErrorCode ==
                        MessageQueueErrorCode.AccessDenied)
                    {
                        Console.WriteLine("Access is denied. " +
                            "Queue might be a system queue.");
                    }
                    // Handle other sources of MessageQueueException.
                }
            }
        
            return;
        }
    }
}
Imports System.Messaging
Public Class MyNewQueue
        
        ' Provides an entry point into the application.
        '		 
        ' This example verifies existence and attempts to 
        ' delete a queue.
        
        Public Shared Sub Main()
            ' Determine whether the queue exists.
            If MessageQueue.Exists(".\myQueue") Then
                Try
                    ' Delete the queue.
                    MessageQueue.Delete(".\myQueue")
                Catch e As MessageQueueException
                    If e.MessageQueueErrorCode = _
                        MessageQueueErrorCode.AccessDenied Then
                        Console.WriteLine("Access is denied. " _
                            + "Queue might be a system queue.")
                    End If
                    ' Handle other sources of exceptions as necessary.
                End Try
            End If
            Return
        End Sub
End Class
注解
枚举 MessageQueueErrorCode 提供有关消息传送操作期间错误条件的详细信息。
使用 MessageQueueExceptionMessageQueueErrorCode 属性来标识消息队列错误的性质。 值 MessageQueueErrorCode 确定要与错误关联的文本字符串。