Example #1
0
void __stdcall ServiceMain(int argc, char **argv) {
  ServiceHandle = RegisterServiceCtrlHandler(service, (void (__stdcall *)(unsigned long))ServiceControl);
  ServiceStatus(SERVICE_RUNNING);
  CreateJVM();
  InvokeMethod("serviceStart", ConvertStringArray(g_env, argc, argv), "([Ljava/lang/String;)V");
  (*g_jvm)->DestroyJavaVM(g_jvm);
}
Example #2
0
bool DispatchObj::InvokeMethod(Variant *res, OLECHAR *name)
{
    DISPID dispid;
    if (!GetDispatchId(&dispid, name))
        return false;
    return InvokeMethod(res, dispid);
}
Example #3
0
void __stdcall ServiceControl(int OpCode) {
  switch (OpCode) {
    case SERVICE_CONTROL_STOP:
      AttachJVM();
      ServiceStatus(SERVICE_STOPPED);
      InvokeMethod("serviceStop", NULL, "()V");
      break;
  }
}
//-----------------------------------------------------------------------------
// Init, shutdown game system
//-----------------------------------------------------------------------------
bool IGameManager::InitAllManagers()
{
	m_nFrameNumber = 0;
	if ( !InvokeMethod( &IGameManager::Init ) )
		return false;

	m_bIsInitialized = true;
	return true;
}
Example #5
0
/** Invokes the main method in a new thread. */
int JavaStart(void *ignore) {
  CreateJVM();

  char **argv = g_argv;
  int argc = g_argc;
  //skip argv[0]
  argv++;
  argc--;
  InvokeMethod(method, ExpandStringArray(g_env, ConvertStringArray(g_env, argc, argv)), "([Ljava/lang/String;)V");

  (*g_jvm)->DestroyJavaVM(g_jvm);  //waits till all threads are complete

  return 1;
}
Example #6
0
void IGameSystem::LevelInitPreEntityAllSystems( char const* pMapName )
{
	// Store off the map name
	if ( s_pMapName )
	{
		delete[] s_pMapName;
	}

	int len = Q_strlen(pMapName) + 1;
	s_pMapName = new char [ len ];
	Q_strncpy( s_pMapName, pMapName, len );

	InvokeMethod( &IGameSystem::LevelInitPreEntity, "LevelInitPreEntity" );
}
Example #7
0
void VDScriptInterpreter::InvokeMethod(const VDScriptObject *obj, const char *name, int argc) {
	if (obj->func_list) {
		const VDScriptFunctionDef *sfd = obj->func_list;

		while(sfd->arg_list) {
			if (sfd->name && !strcmp(sfd->name, name)) {
				InvokeMethod(sfd, argc);
				return;
			}

			++sfd;
		}
	}

	SCRIPT_ERROR(OVERLOADED_FUNCTION_NOT_FOUND);
}
Example #8
0
VARIANT CWebView::CallJsFunction(LPCWSTR lpFun, std::vector<VARIANT>& params)
{
	LPCWSTR lpObjName = L"window";
	VARIANT* pps = new VARIANT[params.size()];
	VARIANT ret = {};
	std::copy_n(params.rbegin(), params.size(), pps);
	
	//»ñÈ¡window
	IDispatch *pHtmlWindow = GetHtmlWindow();

	////»ñÈ¡object
	//CVariant obj;
	//CWebBrowserBase::GetProperty(pHtmlWindow, (LPOLESTR)lpObjName, &obj);

	InvokeMethod(pHtmlWindow, (LPOLESTR)lpFun, &ret, pps, params.size());
	return ret;
}
Example #9
0
void
PMachine()
{
	//	Load the class table, allocate the p-machine stack

	Script*	script;
	word		startMethod;

	theGame = 0;

	if (!gameStarted) {
		LoadClassTbl();
		pmCode = (fptr) GetDispatchAddrInHeapFromC;
		restArgs = 0;
		pStack = NeedPtr(PSTACKSIZE);
		pStackEnd = pStack + PSTACKSIZE;
		FillPtr(pStack, 'S');
	}

#if defined(DEBUG)
	ssPtr = &sendStack[-2];
#else
	interpVerStamp = verStamp + VERSTAMPDELTA;
	if (!interpVerStamp || interpVerStamp != gameVerStamp)
	   Panic(E_VER_STAMP_MISMATCH,interpVerStamp,gameVerStamp);
#endif

	scriptHandle = 0;
	GetDispatchAddrInHeapFromC(0, 0, &object, &script);
	theGame = object;
	scriptHandle = script->hunk;
	globalVar = script->vars;

	GetLanguage();

	pmsp = pStack;

	if (!gameStarted) {
		gameStarted = TRUE;
		startMethod = s_play;
	} else
		startMethod = s_replay;

   InvokeMethod(object, startMethod, 0, 0);
}
::Ice::DispatchStatus
pera::Demo601Server::PeraDemo601ServerService::___InvokeMethod(::IceInternal::Incoming& __inS, const ::Ice::Current& __current)
{
    __checkMode(::Ice::Normal, __current.mode);
    ::IceInternal::BasicStream* __is = __inS.startReadParams();
    ::std::string methodName;
    ::std::string strJsonIn;
    __is->read(methodName);
    __is->read(strJsonIn);
    __inS.endReadParams();
    try
    {
        ::std::string __ret = InvokeMethod(methodName, strJsonIn, __current);
        ::IceInternal::BasicStream* __os = __inS.__startWriteParams(::Ice::DefaultFormat);
        __os->write(__ret);
        __inS.__endWriteParams(true);
        return ::Ice::DispatchOK;
    }
    catch(const ::pera::Demo601Server::InvokeException& __ex)
    {
        __inS.__writeUserException(__ex, ::Ice::DefaultFormat);
    }
    return ::Ice::DispatchUserException;
}
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CToolFrameworkInternal::ClientPostRenderAllTools()
{
	InvokeMethod( &IToolSystem::ClientPostRender );
}
//-----------------------------------------------------------------------------
// Purpose: 
// Input  :  - 
//-----------------------------------------------------------------------------
void CToolFrameworkInternal::ClientLevelShutdownPreEntityAllTools()
{
	InvokeMethod( &IToolSystem::ClientLevelShutdownPreEntity );
}
//-----------------------------------------------------------------------------
// Purpose: 
// Input  :  - 
//-----------------------------------------------------------------------------
void CToolFrameworkInternal::ClientLevelInitPostEntityAllTools()
{
	InvokeMethod( &IToolSystem::ClientLevelInitPostEntity );
}
Example #14
0
void IGameSystem::OnRestoreAllSystems()
{
	InvokeMethod( &IGameSystem::OnRestore );
}
//-----------------------------------------------------------------------------
// Purpose: 
// Input  :  - 
//-----------------------------------------------------------------------------
void CToolFrameworkInternal::RenderFrameBegin()
{
	InvokeMethod( &IToolSystem::RenderFrameBegin );
}
void CToolFrameworkInternal::HostRunFrameBegin()
{
	InvokeMethod( &IToolSystem::HostRunFrameBegin );
}
void CToolFrameworkInternal::ServerPreSetupVisibilityAllTools()
{
	InvokeMethod( &IToolSystem::ServerPreSetupVisibility );
}
//-----------------------------------------------------------------------------
// Purpose: Called after entities think
// Input  :  - 
//-----------------------------------------------------------------------------
void CToolFrameworkInternal::ServerFrameUpdatePostEntityThinkAllTools()
{
	InvokeMethod( &IToolSystem::ServerFrameUpdatePostEntityThink );
}
//-----------------------------------------------------------------------------
// Purpose: Level init, shutdown
//-----------------------------------------------------------------------------
void CToolFrameworkInternal::ServerLevelInitPreEntityAllTools()
{
	InvokeMethod( &IToolSystem::ServerLevelInitPreEntity );
}
Example #20
0
void LabMax::SendMsg(const std::string &str) {
	BSTR bstr = Tools::ConvertMBSToBSTR(str);
	if ( InvokeMethod("SendCommandOrQuery", &bstr)!=S_OK )
		throw ExceptionCOMMethodFailed("SendCommandOrQuery");
}
//-----------------------------------------------------------------------------
// Purpose: Entities are deleted / released here...
// Input  :  - 
//-----------------------------------------------------------------------------
void CToolFrameworkInternal::ServerLevelShutdownPostEntityAllTools()
{
	InvokeMethod( &IToolSystem::ServerLevelShutdownPostEntity );
}
Example #22
0
BOOL DuiLib::CWebBrowserUI::CallJsFun(LPOLESTR pName, VARIANT *pVarResult, VARIANT *params /* = NULL */, int cArgs /* = 0 */)
{
	IDispatch *pHtmlWindow = GetHTMLWindow2(); 	//»ñÈ¡Ò³Ãæwindow
	ASSERT(pHtmlWindow);
	return SUCCEEDED(InvokeMethod(pHtmlWindow,pName,pVarResult,params,cArgs));
}
//-----------------------------------------------------------------------------
// Purpose: Called before client networking occurs on the server
// Input  :  - 
//-----------------------------------------------------------------------------
void CToolFrameworkInternal::ServerPreClientUpdateAllTools()
{
	InvokeMethod( &IToolSystem::ServerPreClientUpdate );
}
Example #24
0
void IGameSystem::PostInitAllSystems( void )
{
	InvokeMethod( &IGameSystem::PostInit, "PostInit" );
}
void CToolFrameworkInternal::VGui_PostSimulateAllTools()
{
	InvokeMethod( &IToolSystem::VGui_PostSimulate );
}
Example #26
0
void IGameSystem::LevelInitPostEntityAllSystems( void )
{
	InvokeMethod( &IGameSystem::LevelInitPostEntity, "LevelInitPostEntity" );
}
void CToolFrameworkInternal::HostRunFrameEnd()
{
	InvokeMethod( &IToolSystem::HostRunFrameEnd );
}
Example #28
0
void IGameSystem::OnSaveAllSystems()
{
	InvokeMethod( &IGameSystem::OnSave );
}
//-----------------------------------------------------------------------------
// Purpose: 
// Input  :  - 
//-----------------------------------------------------------------------------
void CToolFrameworkInternal::RenderFrameEnd()
{
	InvokeMethod( &IToolSystem::RenderFrameEnd );
}
Example #30
0
void VDScriptInterpreter::ParseValue() {
	int t = Token();

	if (t=='(') {
		t = Token();

		if (t == TOK_INT) {
			if (Token() != ')')
				SCRIPT_ERROR(CLOSEPARENS_EXPECTED);

			ParseExpression();

			VDScriptValue& v = mStack.back();

			if (v.isDouble())
				v = (int)v.asDouble();
			else if (v.isLong())
				v = (int)v.asLong();
			else if (!v.isInt())
				SCRIPT_ERROR(CANNOT_CAST);
		} else if (t == TOK_LONG) {
			if (Token() != ')')
				SCRIPT_ERROR(CLOSEPARENS_EXPECTED);

			ParseExpression();

			VDScriptValue& v = mStack.back();

			if (v.isDouble())
				v = (sint64)v.asDouble();
			else if (v.isInt())
				v = (sint64)v.asInt();
			else if (!v.isLong())
				SCRIPT_ERROR(CANNOT_CAST);
		} else if (t == TOK_DOUBLE) {
			if (Token() != ')')
				SCRIPT_ERROR(CLOSEPARENS_EXPECTED);

			ParseExpression();

			VDScriptValue& v = mStack.back();

			if (v.isInt())
				v = (double)v.asInt();
			else if (v.isLong())
				v = (double)v.asLong();
			else if (!v.isDouble())
				SCRIPT_ERROR(CANNOT_CAST);
		} else {
			TokenUnput(t);

			ParseExpression();

			if (Token() != ')')
				SCRIPT_ERROR(CLOSEPARENS_EXPECTED);
		}
	} else if (t==TOK_IDENT) {
		mStack.push_back(LookupRootVariable(szIdent));
	} else if (t == TOK_INTVAL)
		mStack.push_back(VDScriptValue(tokival));
	else if (t == TOK_LONGVAL)
		mStack.push_back(VDScriptValue(toklval));
	else if (t == TOK_DBLVAL)
		mStack.push_back(VDScriptValue(tokdval));
	else if (t == TOK_STRING)
		mStack.push_back(VDScriptValue(tokslit));
	else if (t=='!' || t=='~' || t=='-' || t=='+') {
		ParseValue();

		switch(t) {
		case '!':		InvokeMethod(&obj_Sylia, "!", 1); break;
		case '~':		InvokeMethod(&obj_Sylia, "~", 1); break;
		case '+':		InvokeMethod(&obj_Sylia, "+", 1); break;
		case '-':		InvokeMethod(&obj_Sylia, "-", 1); break;
			break;
		default:
			SCRIPT_ERROR(PARSE_ERROR);
		}
	} else if (t == TOK_TRUE)
		mStack.push_back(VDScriptValue(1));
	else if (t == TOK_FALSE)
		mStack.push_back(VDScriptValue(0));
	else
		SCRIPT_ERROR(PARSE_ERROR);
}