Click here to Skip to main content
15,915,742 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Global search? Pin
waner michaud16-Feb-11 15:22
waner michaud16-Feb-11 15:22 
GeneralRe: Global search? Pin
waner michaud18-Feb-11 7:01
waner michaud18-Feb-11 7:01 
GeneralRe: Global search? Pin
Luc Pattyn18-Feb-11 7:22
sitebuilderLuc Pattyn18-Feb-11 7:22 
GeneralRe: Global search? Pin
waner michaud18-Feb-11 7:44
waner michaud18-Feb-11 7:44 
GeneralRe: Global search? Pin
waner michaud18-Feb-11 9:44
waner michaud18-Feb-11 9:44 
GeneralRe: Global search? Pin
Luc Pattyn18-Feb-11 17:13
sitebuilderLuc Pattyn18-Feb-11 17:13 
AnswerRe: Global search? Pin
Bernhard Hiller16-Feb-11 23:26
Bernhard Hiller16-Feb-11 23:26 
QuestionSynchronizing in VB 6.0 [modified] Pin
Harsha Kadekar15-Feb-11 19:36
Harsha Kadekar15-Feb-11 19:36 
Hi I am new to Visual Basic programming, I am presently working in vb6..... I need to do the following operation.
I have a global variable, which is a flag. I have a timer which will set this flag after certain amount of time. I also have a function, which has a for loop. Inside this loop it will check whether the flag is set or not. If it is set it comes out of the loop or else it will do some operation for a certain number of times.
Is this possible in Visual Basic 6.0
I tried it but the timer is not waking up after its interval is reached or the Vb is hanging...

'''''''''''''''''''Code

Public g_TimeOut As Boolean
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub Timer1_Timer()

    g_TimeOut = True
    Timer1.Enabled = False

End Sub

Private Function Testing(nCount As Integer) As Integer

    Dim index As Integer
    Dim flag As Boolean
    
    flag = False
    index = 0
    
    For index = 0 To nCount
        If (g_TimeOut = True) Then
            Debug.Print "Got the signal from the timer so ending the counter"
            flag = True
            Exit For
        Else
            Debug.Print "Still Counting...." & index
            Sleep 1000
        End If
    Next index
    
    If (flag = True) Then
        Debug.Print "Did not got the signal, still ending the counter."
    End If
    
End Function


Private Sub Form_Load()

    Timer1.Interval = 5000
    Timer1.Enabled = True
    Testing (10)

End Sub


modified on Wednesday, February 16, 2011 1:42 AM

AnswerRe: Synchronizing in VB 6.0 [modified] Pin
Thomas Krojer15-Feb-11 21:28
Thomas Krojer15-Feb-11 21:28 
AnswerRe: Synchronizing in VB 6.0 Pin
Аslam Iqbal15-Feb-11 21:30
professionalАslam Iqbal15-Feb-11 21:30 
AnswerRe: Synchronizing in VB 6.0 Pin
Dave Kreskowiak16-Feb-11 1:19
mveDave Kreskowiak16-Feb-11 1:19 
AnswerRe: Synchronizing in VB 6.0 Pin
Harsha Kadekar16-Feb-11 2:09
Harsha Kadekar16-Feb-11 2:09 
GeneralRe: Synchronizing in VB 6.0 Pin
Thomas Krojer16-Feb-11 21:16
Thomas Krojer16-Feb-11 21:16 
AnswerRe: Synchronizing in VB 6.0 Pin
Аslam Iqbal17-Feb-11 4:12
professionalАslam Iqbal17-Feb-11 4:12 
GeneralRe: Synchronizing in VB 6.0 Pin
Thomas Krojer17-Feb-11 4:30
Thomas Krojer17-Feb-11 4:30 
GeneralRe: Synchronizing in VB 6.0 Pin
Dave Kreskowiak17-Feb-11 4:29
mveDave Kreskowiak17-Feb-11 4:29 
GeneralRe: Synchronizing in VB 6.0 Pin
Thomas Krojer17-Feb-11 22:34
Thomas Krojer17-Feb-11 22:34 
GeneralRe: Synchronizing in VB 6.0 Pin
Dave Kreskowiak18-Feb-11 9:47
mveDave Kreskowiak18-Feb-11 9:47 
GeneralRe: Synchronizing in VB 6.0 Pin
Luc Pattyn17-Feb-11 4:25
sitebuilderLuc Pattyn17-Feb-11 4:25 
QuestionChange delivery location off RSS feed in Outlook 2010 Pin
tessers15-Feb-11 10:49
tessers15-Feb-11 10:49 
AnswerRe: Change delivery location off RSS feed in Outlook 2010 Pin
tessers15-Feb-11 23:09
tessers15-Feb-11 23:09 
QuestionVB6 calling dll with a callback for progress Pin
Foulques NERA15-Feb-11 7:40
Foulques NERA15-Feb-11 7:40 
AnswerRe: VB6 calling dll with a callback for progress Pin
Foulques NERA15-Feb-11 8:03
Foulques NERA15-Feb-11 8:03 
QuestionVisual Basic Code in Excel Macro Pin
Ahmad Rifai Yusuf14-Feb-11 20:50
Ahmad Rifai Yusuf14-Feb-11 20:50 
AnswerRe: Visual Basic Code in Excel Macro Pin
Wayne Gaylard14-Feb-11 21:04
professionalWayne Gaylard14-Feb-11 21:04 

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.