Results 1 to 3 of 3

Thread: creating multiple object dynamicly

  1. #1

    Thread Starter
    Registered User
    Join Date
    Jun 2013

    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("")
    VideoSourcePlayer1.VideoSource = mjpegSource1

    Dim mjpegSource2 As New MJPEGStream("")
    VideoSourcePlayer2.VideoSource = mjpegSource2

    Dim mjpegSource3 As New MJPEGStream("")
    VideoSourcePlayer3.VideoSource = mjpegSource3

    Dim mjpegSource4 As New MJPEGStream("")
    VideoSourcePlayer4.VideoSource = mjpegSource4

    please 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
    Searching for mendhak

    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

    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

    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

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