Click here to Skip to main content
15,902,893 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: FileNameEditor attribute Pin
cnurse19-Dec-03 1:05
cnurse19-Dec-03 1:05 
GeneralHI, how I can refresh a datagrid Pin
jlizardo18-Dec-03 11:21
jlizardo18-Dec-03 11:21 
GeneralConnection Pin
Anonymous18-Dec-03 7:01
Anonymous18-Dec-03 7:01 
GeneralRe: Connection Pin
VickyMD27-Dec-03 4:36
sussVickyMD27-Dec-03 4:36 
GeneralRe: Connection Pin
mikasa27-Dec-03 5:30
mikasa27-Dec-03 5:30 
Generaloverride a rich text box draw function Pin
Zipadie Doodah18-Dec-03 5:03
Zipadie Doodah18-Dec-03 5:03 
GeneralClient area / Non-client area Pin
cnurse18-Dec-03 2:32
cnurse18-Dec-03 2:32 
GeneralWindows Message Queue Service (VB.NET) Pin
Nic Rowan17-Dec-03 20:31
Nic Rowan17-Dec-03 20:31 
Heya,

I'm trying To create a windows service that picks messages off of a MS message queue and send them to a GSM modem. I can post a message to the queue with a standard Windows app so there's no problem connecting to the queue. The problem is, I've made a service that finds the queue and begins receiving, it just never calls the ReceiveCompleted event, or if it does I never see it happen. I know it reads the queue once because if there is a message on the queue it disappears as soon as the service is started. If I add a message after that nothing happens.

The code is as follows:

Private Sub HookQueue()

    Try
        ' Initialise our queue
        SMSMessageQueue = New MessageQueue(".\private$\SMSMessaging")

        SMSMessageQueue.Formatter = New System.Messaging.XmlMessageFormatter(New String() {"LAB.Messaging.SMS.SMSMessage"})

        AddHandler SMSMessageQueue.ReceiveCompleted, AddressOf SMSMessageReceived

        SMSMessageQueue.BeginReceive()

    Catch exp As MessageQueueException
        EventLog.WriteEntry(exp.Message)
    Catch exp As Exception
        EventLog.WriteEntry(exp.Message)
    End Try

End Sub


And the event code:

Private Sub SMSMessageReceived(ByVal sender As Object, ByVal e As System.Messaging.ReceiveCompletedEventArgs) Handles SMSMessageQueue.ReceiveCompleted

    Try

        Dim SMSMessage As Message = sender.EndReceive(e.AsyncResult) 'SMSMessageQueue

        Dim oMessage As LAB.Messaging.SMS.SMSMessage = CType(SMSMessage.Body, LAB.Messaging.SMS.SMSMessage)

        'TODO: Send message to GSM Modem here

        SMSMessageQueue.BeginReceive()

    Catch exp As MessageQueueException
        EventLog.WriteEntry(exp.Message)
    Catch exp As Exception
        EventLog.WriteEntry(exp.Message)
    End Try

End Sub


I can't think of anything I'm doing wrong.

Thanks Smile | :)
Nicholas Rowan




The man who smiles when things go wrong has thought of someone he can blame it on.

If you tell a man there are 300 billion stars in the universe, he'll believe you. But if you tell him a bench has just been painted, he'll have to touch it to be sure.



GeneralAdd a new line to a text File Pin
Bondtje17-Dec-03 8:57
Bondtje17-Dec-03 8:57 
GeneralRe: Add a new line to a text File Pin
Dave Kreskowiak17-Dec-03 11:18
mveDave Kreskowiak17-Dec-03 11:18 
GeneralRe: Add a new line to a text File Pin
Bondtje17-Dec-03 12:24
Bondtje17-Dec-03 12:24 
QuestionHow make a picturebox public to forms?VB.net Pin
MJay17-Dec-03 7:52
MJay17-Dec-03 7:52 
AnswerRe: How make a picturebox public to forms?VB.net Pin
Zipadie Doodah18-Dec-03 6:22
Zipadie Doodah18-Dec-03 6:22 
Questionhow to set bmp format setting??VB.net Pin
MJay17-Dec-03 2:57
MJay17-Dec-03 2:57 
AnswerRe: how to set bmp format setting??VB.net Pin
Dave Kreskowiak17-Dec-03 5:52
mveDave Kreskowiak17-Dec-03 5:52 
GeneralDistributed Application. Pin
srieen17-Dec-03 2:54
srieen17-Dec-03 2:54 
GeneralRe: Distributed Application. Pin
Colin Angus Mackay17-Dec-03 3:19
Colin Angus Mackay17-Dec-03 3:19 
QuestionHow can I with Tabcontrol select/focus any TabPage Pin
jlizardo17-Dec-03 2:50
jlizardo17-Dec-03 2:50 
AnswerRe: How can I with Tabcontrol select/focus any TabPage Pin
Dave Kreskowiak17-Dec-03 5:13
mveDave Kreskowiak17-Dec-03 5:13 
GeneralRe: How can I with Tabcontrol select/focus any TabPage Pin
Member 76608420-Dec-03 18:49
Member 76608420-Dec-03 18:49 
GeneralRe: How can I with Tabcontrol select/focus any TabPage Pin
Dave Kreskowiak21-Dec-03 6:32
mveDave Kreskowiak21-Dec-03 6:32 
GeneralContext menu windows and combo box windows Pin
cnurse17-Dec-03 1:45
cnurse17-Dec-03 1:45 
GeneralPersisting properties of child controls contained in USER CONTOLS Pin
cnurse17-Dec-03 0:03
cnurse17-Dec-03 0:03 
GeneralRe: Persisting properties of child controls contained in USER CONTOLS Pin
steff kamush17-Dec-03 22:02
steff kamush17-Dec-03 22:02 
GeneralRe: Persisting properties of child controls contained in USER CONTOLS Pin
cnurse18-Dec-03 2:29
cnurse18-Dec-03 2:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.