Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27409

VS 2010 [RESOLVED] BG Worker Dynamic Creation

$
0
0
Hey,

I am creating BGwrks dynamically and assigning functions... i have a class worker and i created two functions with two parameters as i have to pass arguments...

Inside class i wrote function to accept parameters like this.

Code:

Public Function Worker_Dowork(ByRef sender As Object, ByRef e As System.ComponentModel.DoWorkEventArgs)'.
Now i created a BG and using these code i tried to assign functions

Code:

Dim Bg as new BackgroundWorker
Addhandler Bg.DoWork, AddressOf Obj.Worker_DoWork
Bg.runWorkerAsync({Param1,Param2})

Now strangely i got this error.. i know i did some silly mistake but i cant figure it out..

Code:

Argument not specified for parameter 'e' of 'Public Function Worker_Dowork(ByRef sender As Object, ByRef e As System.ComponentModel.DoWorkEventArgs) As Object'.
i never faced this problem previously.. any light on this will be great.. :)

EDIT: I deleted everything in obj, debug folder and rebuilt. Removed reference and added again.. now it works!! :( was very strange!!

Viewing all articles
Browse latest Browse all 27409

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>