New Posts New Posts RSS Feed: Coroutine in VB.NET problem
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Coroutine in VB.NET problem

 Post Reply Post Reply
Author
THWI View Drop Down
Newbie
Newbie


Joined: 20-Apr-2011
Location: Fredrikstad
Posts: 3
Post Options Post Options   Quote THWI Quote  Post ReplyReply Direct Link To This Post Topic: Coroutine in VB.NET problem
    Posted: 20-Apr-2011 at 12:39am
 
Has implemented exactly as described, but get this error:
 
Error 3 Overload resolution failed because no accessible 'Start' can be called without a narrowing conversion:
 'Public Shared Function Start(
  coroutine As System.Func(Of System.Collections.Generic.IEnumerable(Of IdeaBlade.EntityModel.INotifyCompleted)),
  [completedHandler As System.Action(Of IdeaBlade.EntityModel.CoroutineOperation) = Nothing])
  As IdeaBlade.EntityModel.CoroutineOperation':
  Argument matching parameter 'coroutine' narrows
   from 'System.Collections.Generic.IEnumerable(Of System.Func(Of IdeaBlade.EntityModel.INotifyCompleted))'
   to   'System.Func(Of System.Collections.Generic.IEnumerable(Of IdeaBlade.EntityModel.INotifyCompleted))'. 
 
MY CODE IS AS FOLLOWS:
Can someone tell me whats wrong.
 
Function LoadAll(ByVal manager As myEntityManager) As IEnumerable(Of Func(Of INotifyCompleted))
 
' List of asynchronous functions for the Coroutine to execute serially
Dim funcList = New List(Of Func(Of INotifyCompleted))
 
' Get all
Dim loadFnc As Func(Of INotifyCompleted) = _
Function()
    Return manager.Customers.ExecuteAsync() ' return an INotifyCompleted
End Function
 
funcList.Add(loadFnc)
 
' return the list
Return funcList
 
End Function
 
 
 
' Sequence from my main routine
 
Dim op = Coroutine.Start(LoadAll(_eMgr))
AddHandler op.Completed, _
  Sub(s As Object, e As CoroutineCompletedEventArgs)
    If e.CompletedSuccessfully Then
      Debug.Write("All were loaded")
    Else
      Debug.Write(e.Error.Message)
    End If
  End sub
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 735
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 21-Apr-2011 at 11:51am

 Hi THWI,

The snippet you provided looks ok.
It also executes without problems here.
Here's a simple solution with your snippet where everything works fine: uploads/892/VBCoroutine.zip
 
Are you getting this error during compilation or at runtime? What version of DevForce are you running?
 
Can you upload a simple solution reproducing the issue?
 
Silvio.
Back to Top
THWI View Drop Down
Newbie
Newbie


Joined: 20-Apr-2011
Location: Fredrikstad
Posts: 3
Post Options Post Options   Quote THWI Quote  Post ReplyReply Direct Link To This Post Posted: 26-Apr-2011 at 1:04am
Hi Silvio and many thanks for your reply.
 
As you tell me that the code snippet compiles ok at your computer, I checked out my version of DevForce.
My version is 6.0.8, and I suppose I will need 6.0.9 which contains additional overloads of Croutine.Start.
 
Regards THWI.
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 735
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 26-Apr-2011 at 1:17pm
Hi THWI,
 
So, the errors you were getting are in fact compilation errors?
I did test with DeVForce6.0.9.
Did upgrading to 6.0.9 solved your issue?
 
Regards,
   Silvio.
Back to Top
THWI View Drop Down
Newbie
Newbie


Joined: 20-Apr-2011
Location: Fredrikstad
Posts: 3
Post Options Post Options   Quote THWI Quote  Post ReplyReply Direct Link To This Post Posted: 26-Apr-2011 at 1:27pm
Hi Silvio,

Once again thank you for your engagement.
Upgrade to 6.0.9 did solve my problem with the
Coroutine.Start.

Regards Thorbjørn
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down