home *** CD-ROM | disk | FTP | other *** search
- /*++
-
- (C) Copyright 1995 - 1999 Microsoft Corporation. All rights reserved.
-
- Module Name:
-
- jview.h
-
- Abstract:
-
- Front end to the Java virtual machine.
-
- --*/
-
- #ifndef _JVIEW_INCLUDED_
- #define _JVIEW_INCLUDED_
-
- #include <windows.h>
- #include <cguid.h>
- #include <stdio.h>
- #include <conio.h>
- #include <stdarg.h>
- #include <string.h>
-
- #include <javaexec.h>
-
- interface IJVIEWProfiler;
-
- #include "resource.h"
-
- #ifndef APPLETVIEWER
- #include "javaprop.hpp"
- #endif
-
- #define BUFSIZE 512 // A one-size fits all buffer size...
-
- // Macros
- //------------------------------------------------------------------------------
- #define deleteSZ(p) if ((p) != NULL) \
- { \
- delete [] (p); \
- (p) = NULL; \
- }
-
- __inline int __cdecl _purecall(void)
- {
- return(0);
- }
-
- __inline void* __cdecl operator new(size_t cbSize)
- {
- return (void*) LocalAlloc(LPTR, cbSize);
- }
-
- __inline void __cdecl operator delete(void* pvMemory)
- {
- LocalFree((HLOCAL) pvMemory);
- }
-
-
- class CJView
- {
- public:
- DWORD m_dwMsgLoopThreadID;
-
- int m_ac;
- char **m_av;
-
- BOOL m_fApplet;
- BOOL m_fPause;
- BOOL m_fVerify;
- BOOL m_fVerboseStackTraces;
- LPSTR m_pszClassPath;
- LPSTR m_pszAppend;
- LPSTR m_pszPrepend;
- LPSTR m_pszClassName;
- INT m_iArgs;
- LPOLESTR *m_ppszArgs;
- LPOLESTR m_pszNamespace;
-
- #ifdef PROFILER_HOOK
- IJVIEWProfiler *m_pProfiler;
- BOOL m_fAttemptedLoadProfiler;
- BOOL m_fEnableProfiling;
- #endif
-
- IJavaExecute *m_pJE;
-
- #ifndef APPLETVIEWER
- CEnumJAVAPROPERTY *m_pProperties;
- #endif
-
- #ifdef PROFILER_HOOK
- IJVIEWProfiler *LoadProfiler (BOOL fSilent = FALSE);
-
- IJVIEWProfiler *LoadProfilerSilently ()
- {
- return LoadProfiler(TRUE);
- }
-
- BOOL ParseProfilingParams (PCSTR pcszParams);
- #endif
-
- BOOL m_InitComAndJava ();
- LPWSTR m_MB2WC (LPCSTR szAnsi,int cchAnsi = -1);
- LPSTR m_WC2MB (LPCWSTR pwsz, int cchWide = -1);
- LPSTR m_newSZ (int cBytes);
- BOOL m_AppendPathString (LPSTR *ppszPath, LPSTR pszAppend);
- void m_DisplayUsage ();
- void m_PreParseSwitches ();
- BOOL m_ParseSwitches (int *piArg);
- BOOL m_ParseParameters (int iNext);
- void m_DisplayBanner ();
- BOOL m_SetNamespace (LPSTR pszNamespace);
-
- public:
- CJView(int ac, char **av);
- ~CJView();
-
- public:
- BOOL Initialize ();
- BOOL ParseCommandLine ();
- HRESULT ExecuteClass (LPERRORINFO*);
- HRESULT SetSystemProperties();
- };
-
- void FatalError(INT idString, ...);
- void FatalErrorHR(HRESULT hr, INT idString, ...);
- void Pause();
-
- #endif //_JVIEW_INCLUDED_
-
-