//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "FlashPlayerControl.hpp"
#pragma resource "res\\flash_ocx.res"

//---------------------------------------------------------------------------
USEFORM("MainUnit.cpp", MainForm);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
        try
        {
                 Application->Initialize();

                 TResourceStream* FlashCodeStream = new TResourceStream(0, "FlashOCXCode", "BIN");
                 Flashplayercontrol::LoadFlashOCXCodeFromStream(FlashCodeStream);
                 delete FlashCodeStream;

                 Application->Title = "Sample 3 - Standalone Player (How to embed Flash.ocx)";
                 Application->CreateForm(__classid(TMainForm), &MainForm);
                 Application->Run();
        }
        catch (Exception &exception)
        {
                 Application->ShowException(&exception);
        }
        catch (...)
        {
                 try
                 {
                         throw Exception("");
                 }
                 catch (Exception &exception)
                 {
                         Application->ShowException(&exception);
                 }
        }
        return 0;
}
//---------------------------------------------------------------------------
