home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 November / CMCD1104.ISO / Software / Shareware / Programare / skincraft / SkinCrafter_v1.4.12_Demo.msi / _49E29CB9A65AABBF653C1037E1AA74B6 / _86776541577C4824B268121C91DC0343 < prev    next >
Encoding:
Text File  |  2004-03-18  |  2.9 KB  |  111 lines

  1. // SCPlayer.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "SCPlayer.h"
  6. #include "SCPlayerDlg.h"
  7. #include "PlayerControlDlg.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CSCPlayerApp
  16.  
  17. BEGIN_MESSAGE_MAP(CSCPlayerApp, CWinApp)
  18.     //{{AFX_MSG_MAP(CSCPlayerApp)
  19.         // NOTE - the ClassWizard will add and remove mapping macros here.
  20.         //    DO NOT EDIT what you see in these blocks of generated code!
  21.     //}}AFX_MSG
  22.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  23. END_MESSAGE_MAP()
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CSCPlayerApp construction
  27.  
  28. CSCPlayerApp::CSCPlayerApp():m_pPlayListDlg(NULL),m_pSCPlayerDlg(NULL)
  29. {
  30.     // TODO: add construction code here,
  31.     // Place all significant initialization in InitInstance
  32. }
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // The one and only CSCPlayerApp object
  36.  
  37. CSCPlayerApp theApp;
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CSCPlayerApp initialization
  41.  
  42. BOOL CSCPlayerApp::InitInstance()
  43. {
  44.     // Standard initialization
  45.     // If you are not using these features and wish to reduce the size
  46.     //  of your final executable, you should remove from the following
  47.     //  the specific initialization routines you do not need.
  48.     AfxEnableControlContainer( );
  49.  
  50. #ifdef _AFXDLL
  51.     Enable3dControls();            // Call this when using MFC in a shared DLL
  52. #else
  53.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  54. #endif
  55.  
  56.  
  57.     
  58.     CoInitialize(NULL);
  59.  
  60.     m_pSkin = new ISCSkin;
  61.     m_pSkin->CreateDispatch("SkinCrafter.SCSkin");
  62.     m_pSkin->InitLicenKeys("0","SKINCRAFTER","SKINCRAFTER.COM","support@skincrafter.com","DEMOSKINCRAFTERLICENCE");
  63.     m_pSkin->DefineLanguage(0);
  64.     m_pSkin->InitDecoration(0);
  65.     
  66.     //The skin we load by default
  67.     CString defaultSkin = "PlayerSkin.skf";
  68.     
  69.     FILE* f= fopen(defaultSkin ,"r");
  70.     if(!f)
  71.     {
  72.         AfxMessageBox("Could not load a skin",MB_OK|MB_ICONERROR);
  73.         return FALSE;
  74.     }
  75.     fclose(f);
  76.     m_pSkin->LoadSkinFromFile(defaultSkin);
  77.     m_pSkin->ApplySkin();
  78.  
  79.     
  80.     CPlayerControlDlg dlg;
  81.     m_pMainWnd = &dlg;
  82.     int nResponse = dlg.DoModal();
  83.     if (nResponse == IDOK)
  84.     {
  85.         // TODO: Place code here to handle when the dialog is
  86.         //  dismissed with OK
  87.     }
  88.     else if (nResponse == IDCANCEL)
  89.     {
  90.         // TODO: Place code here to handle when the dialog is
  91.         //  dismissed with Cancel
  92.     }
  93.  
  94.     // Since the dialog has been closed, return FALSE so that we exit the
  95.     //  application, rather than start the application's message pump.
  96.     return FALSE;
  97. }
  98.  
  99. int CSCPlayerApp::ExitInstance() 
  100. {
  101.     m_pSkin->DeInitDecoration();
  102.     delete m_pSkin;
  103.  
  104.     if(m_pPlayListDlg)
  105.         delete m_pPlayListDlg;
  106.     
  107.     if(m_pSCPlayerDlg)
  108.         delete m_pSCPlayerDlg;
  109.     return CWinApp::ExitInstance();
  110. }
  111.