This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imports System.ComponentModel | |
Imports System.Runtime.InteropServices | |
Public Class MQCounter | |
' see https://github.com/hibernating-rhinos/rhino-esb/blob/master/Rhino.ServiceBus/Msmq/MsmqExtensions.cs | |
' see http://ayende.com/blog/3884/unmanaged-api-fun-finding-out-msmq-subqueues-names-in-c | |
Public Shared Function Count(Q As String, Host As String) As UInteger | |
Dim props = New MQMGMTPROPS With {.cProp = 1} | |
props.aPropid = Marshal.AllocHGlobal(4) : Marshal.WriteInt32(props.aPropid, PROPID_MGMT_QUEUE_MESSAGE_COUNT) |