Question Multiple instances of the Same DLL

stulish

Well-known member
Joined
Jun 6, 2013
Messages
61
Programming Experience
3-5
Hi,

I have created a DLL that interfaces with a video capture/frame grabber, i have tried using the DLL multiple times within the same class is this possible??

for example:

VB.NET:
Imports MyVideoCapture

Public Class Form1

    Dim Capture1 As New MyVideoCapture
    Dim Capture2 As New MyVideoCapture
    Dim Capture3 As New MyVideoCapture
    Dim Capture4 As New MyVideoCapture

.......

        Capture1.setCardInfo("CARD1")
        Capture1.updateSettings("C:\TempFiles\", "System01", 15000)

        Capture2.setCardInfo("CARD2")
        Capture2.updateSettings("C:\TempFiles\", "System01", 15000)
        Capture3.setCardInfo("CARD3")
        Capture3.updateSettings("C:\TempFiles\", "System01", 15000)
        Capture4.setCardInfo("CARD4")
        Capture4.updateSettings("C:\TempFiles\", "System01", 15000)

.......

Basically what i want to do is use 4 instances of the same DLL within the form and set each one to a different card, the update settings function of the DLL sets the location to save the image, the name of the system (this is generally the same for each module), and the time interval to capture the image.

What i have found is it works great for the first capture but then only updates the last image every 15 seconds, i think it is using the same instance of the DLL and thus the last one initialized, is there a way to do this or do i need to re-write the DLL.

The reason i coded this was is that the DLL once started just runs without any further input, saving an image at the set timer interval, and to the file location specified, the saved image use the cardname and system string within the file name along with current date and time so i know what system and when it was saved.

I am not sure if i explained myself very well, i am hoping you get the idea of what i am trying to do and how i would have 4 instances of the DLL running from one form, i thought using the New statement with Dim would do this, obviously i was wrong.

thanks

Stu
 
Back
Top