VelvetElvis Posted July 19, 2010 Posted July 19, 2010 I'm trying to get this webcam code working. Here's the forum reference: http://www.autoitscript.com/forum/index.php?showtopic=68866&hl=Webcam++UDf I'm using the webcam.udf by "rysiora" from that topic, and this test code from the same page, by "Limiter". #include <GUIConstants.au3> #include <Webcam.au3> $gui = GUICreate("Webcam UDF Test",640,480) _WebcamInit() _Webcam($gui,640,480,0,0) GUISetState(@SW_SHOW) Sleep(2000) ConsoleWrite("Taking snapshot ..." & @CRLF) _WebcamSnapShot() ConsoleWrite("Snapshot taken !" & @CRLF) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then _WebcamStop() Exit EndIf Sleep(1) WEnd However, I'm getting the following errors: D:\AutoIt scripts\#3rdPartyIncludes\Webcam.au3(122,91) : WARNING: $WS_CHILD: possibly used before declaration. $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\AutoIt scripts\#3rdPartyIncludes\Webcam.au3(122,103) : WARNING: $WS_VISIBLE: possibly used before declaration. $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\AutoIt scripts\#3rdPartyIncludes\Webcam.au3(122,91) : ERROR: $WS_CHILD: undeclared global variable. $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\AutoIt scripts\#3rdPartyIncludes\WebCamTest.au3 - 1 error(s), 2 warning(s) This is undoubtedly something very basic (and probably embarrassing) that I'm missing. Can someone please enlighten me?
Theri Posted July 19, 2010 Posted July 19, 2010 I see someone else had the same problem in that thread but no response posted. $WS_CHILD, etc, are all defined in WindowsConstants.au3.
PsaltyDS Posted July 19, 2010 Posted July 19, 2010 Maybe #include <WindowsConstants.au3>? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
VelvetElvis Posted July 20, 2010 Author Posted July 20, 2010 Maybe #include <WindowsConstants.au3>? Bingo! Thank you Theri and PsaltyDS.
Xkdash Posted July 27, 2014 Posted July 27, 2014 I got a problem, stating "C:\Program Files (x86)\AutoIt3\Include\Webcam.au3" (153) : ==> Subscript used on non-accessible variable.: DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_GRAB_FRAME_NOSTOP, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap^ ERROR my code is as follows ______________________ #include<Webcam.au3> _WebcamSnapShot() _______________________ when i used #requireadmin problem got solved, but no snapshot!!! ------------------------------------- i also used webcamInit() but of no use.. Please suggest some ways. I just want take a snap.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now