CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Threaded View

  1. #1
    Join Date
    Jun 2012
    Posts
    8

    Video player in vc++ (each frame being shown in a new window)

    I am trying to show all the frames of a video sequence in the same window. But currently it is showing each frame in a different window. e.g. once it shows first frame, I need to close that window and then another window pops up and it shows next frame and then I need to close that one and then next window pops up...and so on.

    i am using createwindow function to create a window and I associate HINSTANCE of a frame to HWND using CreateWindow function. If I do createwindow only once it just shows first frame in a window and once I close it nothing happens..

    can anybody help me out with this???

    Here is the part of code related to it:-

    Code:
    BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
    {
       hInst = hInstance; // Store instance handle in our global variable
    
       hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
    
    
       if (!hWnd)
       {
          return FALSE;
       }
    
    
       ShowWindow(hWnd, nCmdShow);
       UpdateWindow(hWnd);
    
       return TRUE;
    }
    So when I call it in loop, each time it creates a new window for each frame. But if I call CreateWindow only once, then it doesn't update frame. If I am right its happening that way coz it doesn't associate new hInstance with window as hInstance is being updated with each frame.
    Is there a way to associate/update hInstance to a hWnd without calling CreateWindow function? Or am I thinking in wrong direction? Can someone clarify please.
    Last edited by Marc G; July 2nd, 2012 at 01:46 AM. Reason: Added code tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured