Пример #1
0
	int StartHost()
	{	
		// preload some of the troublesome common runtime DLLs
		for (int i = 0; i < preloadSize; i++)
		{
			HMODULE module;
			if (!SafeLoadRuntimeDLL(preload[i], &module)) return __LINE__;
		}
		
		HMODULE khost;	
		if (!SafeLoadRuntimeDLL("khost.dll", &khost)) return __LINE__;
		
		Executor *executor = (Executor*)GetProcAddress(khost, "Execute");
		if (!executor)
		{
			ShowError(string("Invalid entry point 'Execute' in khost.dll"));
			return __LINE__;
		}

		return executor(::GetModuleHandle(NULL), argc,(const char**)argv);
	}
Пример #2
0
    int StartHost()
    {
        string runtimePath(EnvironmentUtils::Get("KR_RUNTIME"));
        string dll(FileUtils::Join(runtimePath.c_str(), "khost.dll", 0));
        HMODULE khost = SafeLoadRuntimeDLL(dll);
        if (!khost)
            return __LINE__;

        Executor *executor = (Executor*) GetProcAddress(khost, "Execute");
        if (!executor)
        {
            ShowError(string("Invalid entry point 'Execute' in khost.dll"));
            return __LINE__;
        }

        return executor(::GetModuleHandle(NULL), argc, (const char**)argv);
    }