The program hang up at DestroyWindow when I'll shut down my camera-program

Hello

I use Visual Studio.Net 2003 and W2K.

The program freezes at DestroyWindow when I'll shut down my camera-program

< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 

I use Vfw32.lib to get Pictures from a camera.

 

The program runs without errors.

 

But if the program runs more than one minute and I shut down the program, it stops at DestroyWindow.

 

Here is the function:

 

void V_leavevideo(){
  if (V_is_capturing){
    capCaptureAbort(ghWndCap);
    V_is_capturing=0;
  }

  // Disable and free all the callbacks
  capSetCallbackOnVideoStream(ghWndCap,NULL);
  if (fpVideoCallback){
    FreeProcInstance(fpVideoCallback);
               fpVideoCallback=NULL;
        }

  capSetCallbackOnStatus(ghWndCap, NULL);
        if (fpStatusCallback){
    FreeProcInstance(fpStatusCallback);
               fpStatusCallback=NULL;
        }

  capSetCallbackOnError(ghWndCap, NULL);
        if (fpErrorCallback){
    FreeProcInstance(fpErrorCallback);
               fpErrorCallback=NULL;
        }

  // Disconnect the current capture driver
  capDriverDisconnect (ghWndCap);

  V_allowcopying=0;
  delete [] V_inscreen;
  V_inscreen=NULL;

  // Destroy this window
  DestroyWindow(ghWndCap); //Exact here freeze the program
}

Here is the whole project:

http://www.geocities.com/sepp_obermayer/Spotlight/VideoTest.zip

 

Could someone help me, please

 

Wfg Sepp

 



Answer this question

The program hang up at DestroyWindow when I'll shut down my camera-program

  • Johnny KNOBLAUCH

    I've tried this.

    But the program freezes when the function get called.

    I have tried to see what's happening, but I get no message which shows what's going wrong.

    Wfg Sepp


  • han33981

    I did what you've written.

    The program is looping the function:

    LRESULT CALLBACK
    AfxWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)

    In the File:
    wincore.cpp

    Could you give me a suggestion where I should search the error, please.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    I’ve no idea what’s going wrong.

    (I have no problems to read English sentences. I've only problems to write them correctly.)


  • H_H_2006

    What do you mean with:
    Press Break All in the debugger. Examine all Threads and view the callstacksPress.
    (Sorry my English is very bad and I'm an progger-newbe.)

    Do you mean that I shoult put a break-point at DestroyWindow(hWnd) and go ahead with the "jump in" button

    I've done this.

    But the debugger didn't jump in the DestroyWindow(hWnd) function.

    I get the "Ablaufmeldungen"-window a message that a win32 thread got closed, but the debugger diddn't jump back in the calling function.

    (Sorry my English is very bad and I'm an progger-newbe.)
    wfg Sepp


  • James Y

    No! Don't step in.
    Just let the process block. Than press break all and examine the Threads you have and look what the try to execute or who called them.

    BTW: If your english is bad, try a NNTP forum microsoft.public.de.vc its german and a lot of people are visiting it.

  • Tipu Delacablu

    Run your program in the debugger. Let the program perform the action that causes the hang. Press Break All in the debugger. Examine all Threads and view the callstacks. May bethis gives you a hint.

  • Agi

    Just break the program with the debugger and look at the callstack. Maybe there are some problems with critical sections or other things that get active when child windows get destroyed.



  • The program hang up at DestroyWindow when I'll shut down my camera-program