Hi
I have a little trouble understanding your problem. If you use CurrentProcessName and have two cameras using this, then the second saving of cameras will always overwrite the first, because CurrentProcessName returns every time the same. It seems CurrentProcessName returns the name of the process, but not of the form. It seems you want to use the name of of the form for this. This can be done either by reflection stuff, or much more simple, you pass a name string to SaveSelectedDevice() and use this instead of CurrentProcessName
Code:
Sub SaveSelectedDevice(ByVal IC15Control As TIS.Imaging.ICImagingControl, Name as String)
...
SaveSetting(Name), REG_SECTION, REG_KEY_VIDEO_SOURCE, .Device)
....
End Sub
Private Sub frmVideo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Width = 665
Me.Height = 552
Me.Top = 53
VideoDeviceSettings1.SaveSelectedDevice(IcImagingC ontrol1,"Video") ' for saving
VideoDeviceSettings1.OpenSelectedDevice(IcImagingC ontrol1,"Video")
IcImagingControl1.LiveStart()
CrossHairVisible = True
End Sub
Private Sub frmWitness_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.Width = 665
Me.Height = 552
Me.Top = 53
VideoDeviceSettings1.SaveSelectedDevice(IcImagingC ontrol1,"Witness") ' for saving
VideoDeviceSettings2.OpenSelectedDevice(IcImagingC ontrol2, "Witness")
IcImagingControl2.LiveStart()
CrossHairVisible = True
End Sub
I hope, this sample code shows the idea.
Bookmarks