home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 39 / IOPROG_39.ISO / SOFT / sdkjava40.exe / data1.cab / fg_Samples / Samples / Native / JView / jview.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-04  |  2.8 KB  |  133 lines

  1. /*++
  2.  
  3. (C) Copyright 1995 - 1999 Microsoft Corporation.  All rights reserved.
  4.  
  5. Module Name:
  6.  
  7.     jview.h
  8.  
  9. Abstract:
  10.  
  11.     Front end to the Java virtual machine.
  12.  
  13. --*/
  14.  
  15. #ifndef _JVIEW_INCLUDED_
  16. #define _JVIEW_INCLUDED_
  17.  
  18. #include <windows.h>
  19. #include <cguid.h>
  20. #include <stdio.h>
  21. #include <conio.h>
  22. #include <stdarg.h>
  23. #include <string.h>
  24.  
  25. #include <javaexec.h>
  26.  
  27. interface IJVIEWProfiler;
  28.  
  29. #include "resource.h"
  30.  
  31. #ifndef APPLETVIEWER
  32. #include "javaprop.hpp"
  33. #endif
  34.  
  35. #define BUFSIZE 512     // A one-size fits all buffer size...
  36.  
  37. // Macros
  38. //------------------------------------------------------------------------------
  39. #define deleteSZ(p) if ((p) != NULL)  \
  40.                     {                 \
  41.                        delete [] (p); \
  42.                        (p) = NULL;    \
  43.                     }
  44.  
  45. __inline int __cdecl _purecall(void)
  46. {
  47.    return(0);
  48. }
  49.  
  50. __inline void* __cdecl operator new(size_t cbSize)
  51. {
  52.     return (void*) LocalAlloc(LPTR, cbSize);
  53. }
  54.  
  55. __inline void __cdecl operator delete(void* pvMemory)
  56. {
  57.     LocalFree((HLOCAL) pvMemory);
  58. }
  59.  
  60.  
  61. class CJView
  62. {
  63. public:
  64.     DWORD m_dwMsgLoopThreadID;
  65.  
  66.     int    m_ac;
  67.     char **m_av;
  68.  
  69.     BOOL      m_fApplet;
  70.     BOOL      m_fPause;
  71.     BOOL      m_fVerify;
  72.     BOOL      m_fVerboseStackTraces;
  73.     LPSTR     m_pszClassPath;
  74.     LPSTR     m_pszAppend;
  75.     LPSTR     m_pszPrepend;
  76.     LPSTR     m_pszClassName;
  77.     INT       m_iArgs;
  78.     LPOLESTR *m_ppszArgs;
  79.     LPOLESTR  m_pszNamespace;
  80.  
  81. #ifdef PROFILER_HOOK
  82.     IJVIEWProfiler *m_pProfiler;
  83.     BOOL      m_fAttemptedLoadProfiler;
  84.     BOOL      m_fEnableProfiling;
  85. #endif
  86.  
  87.     IJavaExecute *m_pJE;
  88.  
  89. #ifndef APPLETVIEWER
  90.     CEnumJAVAPROPERTY *m_pProperties;
  91. #endif
  92.  
  93. #ifdef PROFILER_HOOK
  94.     IJVIEWProfiler *LoadProfiler (BOOL fSilent = FALSE);
  95.  
  96.     IJVIEWProfiler *LoadProfilerSilently ()
  97.     {
  98.         return LoadProfiler(TRUE);
  99.     }
  100.  
  101.     BOOL ParseProfilingParams (PCSTR pcszParams);
  102. #endif
  103.  
  104.     BOOL   m_InitComAndJava   ();
  105.     LPWSTR m_MB2WC            (LPCSTR szAnsi,int cchAnsi = -1);
  106.     LPSTR  m_WC2MB            (LPCWSTR pwsz, int cchWide = -1);
  107.     LPSTR  m_newSZ            (int cBytes);
  108.     BOOL   m_AppendPathString (LPSTR *ppszPath, LPSTR pszAppend);
  109.     void   m_DisplayUsage     ();
  110.     void   m_PreParseSwitches ();
  111.     BOOL   m_ParseSwitches    (int *piArg);
  112.     BOOL   m_ParseParameters  (int iNext);
  113.     void   m_DisplayBanner    ();
  114.     BOOL   m_SetNamespace     (LPSTR pszNamespace);
  115.  
  116. public:
  117.     CJView(int ac, char **av);
  118.     ~CJView();
  119.  
  120. public:
  121.     BOOL Initialize         ();
  122.     BOOL ParseCommandLine   ();
  123.     HRESULT ExecuteClass    (LPERRORINFO*);
  124.     HRESULT SetSystemProperties();
  125. };
  126.  
  127. void FatalError(INT idString, ...);
  128. void FatalErrorHR(HRESULT hr, INT idString, ...);
  129. void Pause();
  130.  
  131. #endif //_JVIEW_INCLUDED_
  132.  
  133.