avicap32.dll WM_CAP_DRIVER_CONNECT problem


dears

have problem wm_cap_driver_connect message.
works 1st time after system restart (windows 7 x64). meanwhile works fine on machine same mine. 

please find below example of code.

public void attach(system.windows.forms.control control)
        {
            devicehandle = avicap32.capcreatecapturewindow("", constants.ws_visible | constants.ws_child, 0, 0, control.width, control.height, control.handle, 0);

            if (user32.sendmessage(devicehandle, constants.wm_cap_driver_connect, (intptr)devicenumber, (intptr)0).toint32() > 0)
            {
                user32.sendmessage(devicehandle, constants.wm_cap_set_scale, (intptr)(-1), (intptr)0);
                user32.sendmessage(devicehandle, constants.wm_cap_set_previewrate, (intptr)0x42, (intptr)0);
                user32.sendmessage(devicehandle, constants.wm_cap_set_preview, (intptr)(-1), (intptr)0);
                user32.setwindowpos(devicehandle, new intptr(0), 0, 0, control.width, control.height, 6);
            }
            else
            {
                messagebox.show("oops!");
            }
        }

 public void detach()
        {
            if (devicehandle.toint32() != 0)
            {
                user32.sendmessage(devicehandle, constants.wm_cap_driver_disconnect, (intptr)devicenumber, (intptr)0);
                user32.destroywindow(devicehandle);
            }
            devicehandle = new intptr(0);

        }

i have tried several other examples, problem same - wm_cap_driver_connect fails after 1st successful run. 

can problem? how fix it?

thank in advance

additional detail: when message fails connect shows dialog window "video source" drop down list contains 1 item - build-in web camera. anyway nothing works if item choosen.

hi alex0704,

  welcome msdn forum support.

  we're doing research on issue. might take time before you.

  sincerely,

  jason wang




jason wang [msft]
msdn community support | feedback us



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'