Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to close video capture .....

How to close video capture .....

Scheduled Pinned Locked Moved Visual Basic
databasejsontutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mohan G
    wrote on last edited by
    #1

    hello i have written this application to capture video and to save the picture into database.its working fine ... but when i try to close my application its NOT CLOSING PERFECTLY . some times it hangs. here is my code .... (note : here i might have missed some code and variable ... but the application is running ...) ' in the main form module Private Sub Form_Load() Dim lpszName As String * 100 Dim lpszVer As String * 100 Dim Caps As CAPDRIVERCAPS ' CAPDRIVERCAPS declared in a module ' Capture Window creation ' driver info capGetDriverDescriptionA 0, lpszName, 100, lpszVer, 100 mywdc = capCreateCaptureWindowA(lpszName, WS_CAPTION Or WS_THICKFRAME Or WS_VISIBLE Or WS_CHILD, 0, 0, 160, 120, Me.hwnd, 0) ' Setting the title of window SetWindowText mywdc, lpszName ' Setting the video callback function capSetCallbackOnStatus mywdc, AddressOf MyStatusCallback capSetCallbackOnError mywdc, AddressOf MyErrorCallback ' Connect to the driver If capDriverConnect(mywdc, 0) Then ' getting the capture driver capabilities capDriverGetCaps mywdc, VarPtr(Caps), Len(Caps) ' Start previewing the image capPreview mywdc, True ' resizing the widow to the whole image ResizeCaptureWindow mywdc End If End Sub private sub EndAppln ' code to end the application - called in form's queryunlocad and when close menu is selected in main form 'the below given are functions declared a module and called from the main form capSetCallbackOnError = SendMessage(lwnd,CAP_SET_CALLBACK_ERROR,0,lpProc) capSetCallbackOnStatus = SendMessage( lwnd,CAP_SET_CALLBACK_STATUS,0,lpProc) capSetCallbackOnYield = SendMessage(lwnd,CAP_SET_CALLBACK_YIELD, 0,lpProc) capSetCallbackOnFrame = SendMessage(lwnd,CAP_SET_CALLBACK_FRAME,0,lpProc) capSetCallbackOnVideoStream = SendMessage(lwnd,CAP_SET_CALLBACK_VIDEOSTREAM, 0,lpProc) capSetCallbackOnWaveStream = SendMessage(lwnd,CAP_SET_CALLBACK_WAVESTREAM, 0,lpProc) capSetCallbackOnCapControl = SendMessage(lwnd,CAP_SET_CALLBACK_CAPCONTROL, 0,lpProc) capCaptureStop (mywdc) capDriverDisconnect (mywdc) DestroyWindow (mywdc) ' here the API declared in the module, called UnLoad Me End End Sub any one please suggest any changes to be made to my application TO SAFELY CLOSE MY APPLICATION AN

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups