VB.net: don't wait for iimPlay

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.

Moderator: iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

VB.net: don't wait for iimPlay

by Zomby on Sun Jan 10, 2010 1:44 pm

I'm coding something in vb.net

It loops through a list (from 1 to 100) and every 10 steps it executes a macro.
However, using iimPlay the vb.net code waits for the imacro to finish, and after that it continues. However I'd like to disable this waiting and just open several instances of imacro (and controlling them using iimrunner).

I don't want to use threading, i digged into this topic but I would have to change the code too much.

I hope it's clear.
Summary: run iimPlay without waiting for it to finish executing so i can run several instances of iimPlay simultaneously. :mrgreen:
Zomby
 
Posts: 3
Joined: Sun Jan 10, 2010 12:56 pm

Re: VB.net: don't wait for iimPlay

by Tech Support on Mon Jan 11, 2010 8:10 am

The iimPlay call is always synchronous. So you need to use threading (it is the best method anyway). iMacros includes a VB.NET threading example project that you can use for you code.
User avatar
Tech Support
 
Posts: 4988
Joined: Tue Sep 20, 2005 12:25 pm

Re: VB.net: don't wait for iimPlay

by Zomby on Tue Jan 12, 2010 1:09 pm

Edit I got it to work.

Here is the code

Code: Select all
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        While Not tr.EndOfStream

            MyMacroCode = tr.ReadLine()
            Dim t As New Thread(AddressOf DoWork)
            t.Start(MyMacroCode)

        End While

    End Sub

    Private Sub DoWork(ByVal data As Object)

        Dim iim2 As Object
        Dim iret2 As Integer
        iim2 = CreateObject("imacros")
        iret2 = iim2.iimInit()
        iret2 = iim2.iimPlay(data.ToString)
        iret2 = iim2.iimExit

    End Sub



Now if I can only include a limit of simultaneous threads then this would be awesome. Any idea support guy?
Zomby
 
Posts: 3
Joined: Sun Jan 10, 2010 12:56 pm


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 4 guests

Website Monitoring