Multiple objects

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alan75
    New Member
    • Apr 2007
    • 60

    #1

    Multiple objects

    Hi,

    I want to know if its possible:

    I'm writing a API for interfacing with a attached devices. I wont be able to know how many devices to be attached beforehand. Is there a way to dynamically create objects when there is a new device attach?

    I dont want to pre-declare the max number of devices possible as I would have many objects unwanted and hogging the system resource.

    Is array possible for objects? If so, how to handle the object's Events and determine which one is it coming from?

    example: Dim MyDevice1 As New MyDeviceDLL.dll Class

    thanks,
    Alan
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Take a look at this code for an example on how to use a generic list for storing your own objects.

    Originally posted by alan75
    Hi,

    I want to know if its possible:

    I'm writing a API for interfacing with a attached devices. I wont be able to know how many devices to be attached beforehand. Is there a way to dynamically create objects when there is a new device attach?

    I dont want to pre-declare the max number of devices possible as I would have many objects unwanted and hogging the system resource.

    Is array possible for objects? If so, how to handle the object's Events and determine which one is it coming from?

    example: Dim MyDevice1 As New MyDeviceDLL.dll Class

    thanks,
    Alan

    Comment

    Working...