Results 1 to 3 of 3

Thread: creating multiple object dynamicly

  1. #1

    Thread Starter
    Registered User
    Join Date
    Jun 2013
    Posts
    3

    creating multiple object dynamicly

    i have build a project that can view multiples computer client's screen. but currently i need to declare one object for each client and set the ip of the client staticly.
    can i use loop to create an object? how to do it..currently, this is my code for each client on my networks.


    Dim mjpegSource1 As New MJPEGStream("http://192.168.1.50:2097/video.cgi")
    VideoSourcePlayer1.VideoSource = mjpegSource1
    VideoSourcePlayer1.Start()

    Dim mjpegSource2 As New MJPEGStream("http://192.168.1.50:2097/video.cgi")
    VideoSourcePlayer2.VideoSource = mjpegSource2
    VideoSourcePlayer2.Start()

    Dim mjpegSource3 As New MJPEGStream("http://192.168.1.50:2097/video.cgi")
    VideoSourcePlayer3.VideoSource = mjpegSource3
    VideoSourcePlayer3.Start()

    Dim mjpegSource4 As New MJPEGStream("http://192.168.1.50:2097/video.cgi")
    VideoSourcePlayer4.VideoSource = mjpegSource4
    VideoSourcePlayer4.Start()

    please help...im using .net framework 3.5 and that object had come from AForge.Video

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: creating multiple object dynamicly

    Moved from the CodeBank (which is for sharing code rather than posting questions )

  3. #3
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: creating multiple object dynamicly

    Quote Originally Posted by syedkamal92 View Post
    can i use loop to create an object?
    Yes you can use a loop in combination with an array of video sources. You enumerate the video sources and for each one you instantiate a new MJPEGStream object and add that to a list or collection.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width