06-12-2007 05:35 AM
Visual Basic 2005 program:
'long __stdcall Snap(char Path[]);/////////This is the function protype.Imports System
Imports System.Runtime.InteropServices
Imports System.Windows.Forms
Imports System.Threading
Public Class Form1
Private StopAcquire As Boolean = True
'This function definition was found from the header file of
'GrapImage.dll, which is built in LabVIEW
<DllImport("Snap.dll", EntryPoint:="Snap", _
CharSet:=CharSet.Auto, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function Snap(ByRef Path As String)As Int32
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MsgBox("welcome to use 2005 and LabVIEW!", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "NI")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Picture_Addr As String= "E:\MyPicture.bmp"
Dim camera_Num As Int32
StopAcquire = False
While StopAcquire = False
camera_Num = Snap(Picture_Addr) '/////////////////// Exception Occurred!----- "Can't load DLL "Snap.dll":Can't find the appointed module(Exception come from HRESULT:0x8007007E)
PictureBox1.Load(Picture_Addr)
Label1.Text = "Totally have" + camera_Num.ToString + "USB Cameras。"
Thread.Sleep(2000)
End While
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
StopAcquire = True
End Sub
End Class
06-12-2007 07:52 PM
You really should keep all correspondence on the same issue on the same thread. That is good forum ettiquette. Please continue in this thread.
I am sorry but I don't have any more information that could help you.
06-12-2007 08:37 PM