home *** CD-ROM | disk | FTP | other *** search
/ Xentax forum attachments archive / xentax.7z / 8090 / ModelEdit.7z / ModelEdit.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2006-03-08  |  3.1 KB  |  112 lines

  1. // ModelEdit.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "precompile.h"
  5. #include "modeledit.h"
  6. #include "modeleditdlg.h"
  7. #include "tdguard.h"
  8. #include <direct.h>
  9.  
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. TCHAR szRegKeyCompany[] = _T( "LithTech Inc." );
  17. TCHAR szRegKeyApp[] = _T( "Jupiter" );
  18. TCHAR szRegKeyVer[] = _T( "ModelEdit" );
  19. char g_szStartPath[_MAX_PATH];    // working directory at launch
  20. char g_szExePath[_MAX_PATH];    // path to executable
  21.  
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CModelEditApp
  25.  
  26. BEGIN_MESSAGE_MAP(CModelEditApp, CWinApp)
  27.     //{{AFX_MSG_MAP(CModelEditApp)
  28.         // NOTE - the ClassWizard will add and remove mapping macros here.
  29.         //    DO NOT EDIT what you see in these blocks of generated code!
  30.     //}}AFX_MSG
  31.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  32. END_MESSAGE_MAP()
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CModelEditApp construction
  36.  
  37. CModelEditApp::CModelEditApp()
  38. {
  39.     // TODO: add construction code here,
  40.     // Place all significant initialization in InitInstance
  41. }
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // The one and only CModelEditApp object
  45.  
  46. CModelEditApp theApp;
  47.  
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CModelEditApp initialization
  50.  
  51. BOOL CModelEditApp::InitInstance()
  52. {
  53.     if (!TdGuard::Aegis::GetSingleton().Init() ||
  54.         !TdGuard::Aegis::GetSingleton().DoWork())
  55.     {
  56.         ExitProcess(0);
  57.         return FALSE;
  58.     }
  59.  
  60.  
  61.     AfxEnableControlContainer();
  62.  
  63.     // Standard initialization
  64.     // If you are not using these features and wish to reduce the size
  65.     //  of your final executable, you should remove from the following
  66.     //  the specific initialization routines you do not need.
  67.  
  68.  
  69. //    CMyCommandLineParse cmdLine;    // Note: For parsing command lines (took this out for now) -JE
  70. //    ParseCommandLine(cmdLine);
  71.  
  72. //    // If it's a known process command, go ahead and run it...
  73. //    const char* szCommand = cmdLine.GetProcessCmd();
  74. //    bool bSuccessfulProcess = false;
  75. //    if (szCommand) {
  76. //        if (stricmp(szCommand,"export_ltb_d3d")==0) {
  77. //            bSuccessfulProcess = ExportLTB_D3D(&cmdLine); }
  78. //        // Put other types of processing here...
  79. //    }
  80. //    if (bSuccessfulProcess) return FALSE;
  81.  
  82.     _getcwd(g_szStartPath,_MAX_PATH);    // Save off the starting path...
  83.  
  84.     // save off the path to the executable
  85.     char exePath[_MAX_PATH];
  86.     if( GetModuleFileName( NULL, exePath, _MAX_PATH ) )
  87.     {
  88.         *strrchr( exePath,'\\') = '\0';
  89.         strcpy( g_szExePath, exePath );
  90.     }
  91.     else
  92.         g_szExePath[0] = '\0';
  93.  
  94.     CModelEditDlg dlg;
  95.     m_pMainWnd = &dlg;
  96.     int nResponse = dlg.DoModal();
  97.     if (nResponse == IDOK)
  98.     {
  99.         // TODO: Place code here to handle when the dialog is
  100.         //  dismissed with OK
  101.     }
  102.     else if (nResponse == IDCANCEL)
  103.     {
  104.         // TODO: Place code here to handle when the dialog is
  105.         //  dismissed with Cancel
  106.     }
  107.  
  108.     // Since the dialog has been closed, return FALSE so that we exit the
  109.     //  application, rather than start the application's message pump.
  110.     return FALSE;
  111. }
  112.