/*****************************************************************************
* wince.cpp: WinCE gui plugin for VLC
*****************************************************************************
- * Copyright (C) 2003 VideoLAN
+ * Copyright (C) 2003 the VideoLAN team
* $Id$
*
* Author: Gildas Bazin <gbazin@videolan.org>
* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
-#include <vlc/intf.h>
+#include <vlc_interface.h>
#if defined( UNDER_CE ) && defined(__MINGW32__)
/* This is a gross hack for the wince gcc cross-compiler */
// Check if the application is running.
// If it's running then focus its window and bail out.
- HWND hwndMain = FindWindow( _T("VLC WinCE"), _T("VLC media player") );
+ HWND hwndMain = FindWindow( _T("VLC WinCE"), _T("VLC media player") );
if( hwndMain )
{
SetForegroundWindow( hwndMain );
}
// Suscribe to messages bank
- p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
+ p_intf->p_sys->p_sub = msg_Subscribe( p_intf, MSG_QUEUE_NORMAL );
// Misc init
p_intf->p_sys->p_audio_menu = NULL;
static void MainLoop( intf_thread_t *p_intf )
{
MSG msg;
- Interface intf;
+ Interface *intf = 0;
- p_intf->p_sys->p_main_window = &intf;
if( !hInstance ) hInstance = GetModuleHandle(NULL);
// Register window class
if( !p_intf->pf_show_dialog )
{
/* The module is used in interface mode */
- p_intf->p_sys->p_window = &intf;
+ p_intf->p_sys->p_window = intf = new Interface( p_intf, 0, hInstance );
/* Create/Show the interface */
- if( !intf.InitInstance( hInstance, p_intf ) )
- {
-#ifndef UNDER_CE
- /* Uninitialize OLE/COM */
- CoUninitialize();
-#endif
- return;
- }
+ if( !intf->InitInstance() ) goto end;
}
/* Creates the dialogs provider */
DispatchMessage( &msg );
}
+ end:
+ if( intf ) delete intf;
+
#ifndef UNDER_CE
/* Uninitialize OLE/COM */
CoUninitialize();