hello there,.. :)
yesterday i decided that i want to learn ASM. so, i downloaded masm, and a nice interface for it, RadASM.
I have learned a lot i think... considering, but I am still trying to grasp a few concepts.

Well, to start, im having problems with this one program im trying to make. It does nothing so far except beep when the errors start flaging, but compiles fine. It is 'suppose' to use the VFW32 video capture functions to display video on my screen from my capture card as well as capture a frame(s) to the hard disk... - a very simple coded program.

Here is the part of the code of my program which isnt working like I want it too. Probably because i dont understand what is really going on with it.
(VFW32 API resource located @...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/avicap_6ugn.asp

*********** CODE STARTS *************
...
;;;Index for Driver is = 0
push 0 ;?
push 0 ;Do I need a parent window?
push offset lengthwin ;400
push offset widthwin ;300
push offset ycord ;0
push offset xcord ;0
push offset styleWin ;WS_CHILD or WS_VISABLE
push offset nameofwindow ;My window
call capCreateCaptureWindow

mov nameofcapture, eax

;;; Why do I not have my video window being displayed yet?
;;;;;;;;;;;;;;;;;

invoke SendMessage, addr nameofcapture, WM_CAP_DRIVER_CONNECT, 0,0 ; first 0 is index, 0 to 9 possible
;;; result so far is eax == 0


;;;;;;;;;;;;;;;;;
invoke SendMessage, addr nameofcapture, WM_CAP_SEQUENCE, 0, 0
;;; same thing here, eax == 0
;;; What Gives??
....

*************** CODE ENDS **************
***********************************************************************8
***********************************************************************8


Thank you for any help you can give.
Posted on 2002-07-22 19:07:54 by Xyster
capCreateCaptureWindow returns a handle to the capture window so you don't need to dereference nameofcapture.

invoke SendMessage, addr nameofcapture, ...
should be just
invoke SendMessage, nameofcapture, ...

I would personally also change the variable name to something like hcapture which makes it easier to read.
Posted on 2002-07-22 21:23:10 by grv575
Afternoon, Xyster.

AFAIK, capCreateCaptureWindow requires a parents' handle to work.

Grab one of the Masm32 examples which display a window, and add your code to it (i.e. initialize the Capture window inside WM_CREATE, and use a menuitem to save a snapshot).

Cheers,
Scronty
Posted on 2002-07-22 21:38:31 by Scronty
Thank you ,. thank you .. and thank you.

I have no idea what that 'addr' command really is for. i guess it points the the variable's memory address or something, but ... i dont got the concept solid yet. thanks for the help, its working now...
Posted on 2002-07-22 21:50:48 by Xyster
um, Scronty
i really have no concept yet of making windows work... so im trying to avoid them right now until i can teach my self enough about them. i saw the example of a basic window in that Iczelion's tutorial #3, but, my head was about to explode when i finished trying to read it. Is there a simple code that will make just a VERY SIMPLE, preferable invisiable window that i can create to load my VidCam window with?
Posted on 2002-07-22 21:54:25 by Xyster
Afternoon, Xyster.
Is there a simple code that will make just a VERY SIMPLE, preferable invisiable window that i can create to load my VidCam window with?

Nope.

You won't see anything with an invisible window. capCreateCaptureWindow requires it to be visible.

Don't worry too much about wrapping your head around how a window is created/etc yet. Sure, you've got to learn it, however you can get away with a lot of copy/paste/modify for now.

Cheers,
Scronty
Posted on 2002-07-23 00:21:47 by Scronty