|
-
Jan 4th, 2006, 03:49 AM
#1
[RESOLVED with another method] WIA (Windows Image Acquisition) Video Preview Problem
I recently posted a WIA sample project in the codebank in this forum here :http://www.vbforums.com/showthread.php?t=378126
What I was trying to do is provide a video preview of the webcam video in a window, but I am having problems with trying to pass in the Window Handle. It should be as simple as Adding a reference to "WIAVideo 1.0 Type Library", and then putting in the following code:
VB Code:
Dim MyVidClass As New WIAVIDEOLib.WiaVideoClass
'selecteddevice is a device found in the original WIA project, see project link for details
MyVidClass.CreateVideoByWiaDevID(SelectedDevice.DeviceID, [U]Me.Handle[/U], 1, 1)
However, the CreateVideoByWiaDevID method requires a "WIAVIDEOLib._RemotableHandle" object, which is supposed to be the handle to the window you wish the preview to show in. Because of this, when trying to pass in a normal window handle (intptr), it cannot convert a System.IntPtr to a WIAVIDEOLib._RemotableHandle object. Does anyone know how to utilize this method? Or how I can get some kind of "RemotableHandle" object to create my video in??
I have searched around, and came up with a post here:http://www.codeproject.com/dotnet/wi...tingdotnet.asp . In the video section of the post, he mentions how there is a bug for the methods passing a window handle, so how can I go around this? Anyone know of a fix? He said he included his fixed dll in the project that should remedy it, but it is only 3kb vs. 104kb for the regular one, plus I tried using it and still got an error when trying to pass in the window handle. I would have figured if there was some sort of bug like this than there would have been a fix or another updated version of the dll from the boys at Microsoft, but I am unable to find any. If anyone has any ideas, Im all ears 
MSDN Link for the CreateVideoByDevID Method: http://msdn.microsoft.com/library/de...bywiadevid.asp
**Notice that in the msdn link, it simply refers to "hwndparent" for the handle, which is usually an intptr or an int32 representing the window handle, yet in intellisense when using it, it is wanting a "WIAVIDEOLib._RemotableHandle" object
Last edited by gigemboy; Jan 6th, 2006 at 03:07 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|