Click here to Skip to main content
15,887,875 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: VB.NET DUPLICATE SCREEN SHARING PROBLEM Pin
Steve Roseik13-Dec-15 8:06
Steve Roseik13-Dec-15 8:06 
GeneralRe: VB.NET DUPLICATE SCREEN SHARING PROBLEM Pin
CHill6013-Dec-15 8:15
mveCHill6013-Dec-15 8:15 
GeneralRe: VB.NET DUPLICATE SCREEN SHARING PROBLEM Pin
Steve Roseik20-Dec-15 7:31
Steve Roseik20-Dec-15 7:31 
QuestionUsing Await Pin
jkirkerx10-Dec-15 14:02
professionaljkirkerx10-Dec-15 14:02 
AnswerRe: Using Await Pin
CHill6012-Dec-15 4:02
mveCHill6012-Dec-15 4:02 
GeneralRe: Using Await Pin
jkirkerx12-Dec-15 13:57
professionaljkirkerx12-Dec-15 13:57 
GeneralRe: Using Await Pin
CHill6013-Dec-15 2:35
mveCHill6013-Dec-15 2:35 
AnswerWell here's what I ended up with Pin
jkirkerx13-Dec-15 12:30
professionaljkirkerx13-Dec-15 12:30 
This was a head scratcher for me, first time I have used await. Before I was using new Thread.
Not sure what the difference is, guess I should do a search on it. But It seems to work fine so far, I still need to plugin the SMTP Message Sender, which is new Thread. Maybe I should update it to await.

I'm not sure what to do with the EngineStatus, I'd like to get the status of EngineRunAsync.

The calling function that returns from the dialog result OK or Send, and raises an event to update the form to RED color so the user knows it's running.

So this time VS 2013 did not bug me to use Await, and just the one call was fine.
Dim m_status As _smtpEngine_Status = Await smtp_send_engine.engineStart(Me, gJobID, gJobIndex, gJobSize)
RaiseEvent SendEngineStatus(m_status, "COMPLETED", gJobID)
Update_SendEngine_Status("Send Engine has completed successfully", _smtpEngine_Status.COMPLETE, gJobID)

My Class that runs in await.
Public Enum _smtpEngine_Status

    STOPPED = 1
    START_PENDING = 2
    STOP_PENDING = 3
    RUNNING = 4
    CONTINUE_PENDING = 5
    PAUSE_PENDING = 6
    PAUSED = 7
    COMPLETE = 8
    EMPTY = 9

End Enum
Public Class smtp_send_engine

    Public Shared engineTask As Task(Of _smtpEngine_Status)

    Public Shared Async Function engineStart( _
        ByVal pSend As frmSend,
        ByVal pJobID As Integer,
        ByVal pPageIndex As Integer,
        ByVal pPageSize As Integer) As Task(Of _smtpEngine_Status)

        engineTask = engineRunAsync(pSend, pJobID, pPageIndex, pPageSize)
        Dim pValue As String = Await engineTask

        pValue = _smtpEngine_Status.COMPLETE

        Return pValue

    End Function
    Public Shared Async Sub engineStatus()

        Await engineTask        

    End Sub
    Private Shared Async Function engineRunAsync( _
        ByVal pSend As frmSend,
        ByVal pJobID As Integer,
        ByVal pPageIndex As Integer,
        ByVal pPageSize As Integer) As Task(Of _smtpEngine_Status)

        For idx As Integer = 0 To m_pages - 1

           For jdx As Integer = 0 To 25 - 1

               Await Task.Delay(2500)

               m_sent += 1
               m_remaining -= 1

               Application.DoEvents()

            Next

        Next

        pValue = _smtpEngine_Status.COMPLETE

        return pValue

    End Sub

QuestionLINQ group By Pin
byka8-Dec-15 4:58
byka8-Dec-15 4:58 
QuestionBuild this as a separate project within the project Pin
jkirkerx7-Dec-15 11:18
professionaljkirkerx7-Dec-15 11:18 
AnswerRe: Build this as a separate project within the project Pin
Wombaticus7-Dec-15 11:33
Wombaticus7-Dec-15 11:33 
GeneralRe: Build this as a separate project within the project Pin
jkirkerx7-Dec-15 11:59
professionaljkirkerx7-Dec-15 11:59 
GeneralRe: Build this as a separate project within the project Pin
Wombaticus7-Dec-15 12:08
Wombaticus7-Dec-15 12:08 
GeneralRe: Build this as a separate project within the project Pin
jkirkerx8-Dec-15 12:30
professionaljkirkerx8-Dec-15 12:30 
QuestionPrinting in Visual Studio 2015 Pin
DelboyKent5-Dec-15 5:29
DelboyKent5-Dec-15 5:29 
AnswerRe: Printing in Visual Studio 2015 Pin
Dave Kreskowiak5-Dec-15 6:35
mveDave Kreskowiak5-Dec-15 6:35 
Questionftp/tcp for Windows CE 5.0 Pin
tclacla4-Dec-15 10:27
tclacla4-Dec-15 10:27 
AnswerRe: ftp/tcp for Windows CE 5.0 Pin
Garth J Lancaster4-Dec-15 12:01
professionalGarth J Lancaster4-Dec-15 12:01 
Questionhelp with linq query Pin
byka4-Dec-15 2:56
byka4-Dec-15 2:56 
AnswerRe: help with linq query Pin
Richard Deeming4-Dec-15 4:15
mveRichard Deeming4-Dec-15 4:15 
GeneralRe: help with linq query Pin
byka4-Dec-15 5:07
byka4-Dec-15 5:07 
GeneralRe: help with linq query Pin
Richard Deeming4-Dec-15 5:12
mveRichard Deeming4-Dec-15 5:12 
GeneralRe: help with linq query Pin
Garth J Lancaster4-Dec-15 11:58
professionalGarth J Lancaster4-Dec-15 11:58 
QuestionHiding Buttons based on ListView items (WinForm) Pin
dell-gl62m1-Dec-15 20:08
dell-gl62m1-Dec-15 20:08 
SuggestionRe: Hiding Buttons based on ListView items (WinForm) Pin
Richard MacCutchan1-Dec-15 22:07
mveRichard MacCutchan1-Dec-15 22:07 

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.