当前位置: 首页>>代码示例>>C++>>正文


C++ GetExePath函数代码示例

本文整理汇总了C++中GetExePath函数的典型用法代码示例。如果您正苦于以下问题:C++ GetExePath函数的具体用法?C++ GetExePath怎么用?C++ GetExePath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetExePath函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GenerateExe

	void GenerateExe()
	{
		std::wstring apk = GetExePath() + L"\\dependency\\Android\\Local\\install.apk";
		DeleteFileW(apk.c_str());
		GenerateApk(apk);

		// 调用 packet.exe,生成 exe
		WCHAR wzCmdline[1024] = {0};

		wsprintf(wzCmdline, L"%s\\dependency\\Android\\Local\\packet.exe \"%s\" %s", 
			GetExePath().c_str(), GetPath().c_str(),
			m_rooted ? L"root" : L"unroot");

		STARTUPINFO si;
		PROCESS_INFORMATION pi;

		ZeroMemory( &si, sizeof(si) );
		si.cb = sizeof(si);
		ZeroMemory( &pi, sizeof(pi) );

		si.dwFlags = STARTF_USESHOWWINDOW;
		si.wShowWindow = SW_HIDE;

		CreateProcess(NULL, wzCmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);

		WaitForSingleObject( pi.hProcess, INFINITE );
		CloseHandle( pi.hProcess );
		CloseHandle( pi.hThread );

	}
开发者ID:yzx65,项目名称:GenerateFrontEnd,代码行数:30,代码来源:generatedlg.cpp

示例2: GetExePath

void ConfigDir::_SetupSitePath()
{

#ifdef __WXMSW__
  m_sSitePath = GetExePath();
  nwxFileUtil::EndWithSeparator(&m_sSitePath);
  m_sSitePath.Append("site");
#endif

#ifdef __WXMAC__
  wxString sEXE = GetExePath();
  const wxChar *psLib = wxS("/Library/Application Support");
  const wxChar *psSubDir = wxS("/Osiris-Files");
  if( sEXE.StartsWith(wxS("/Applications/")) &&
      wxDir::Exists(psLib) )
  {
    m_sSitePath = psLib;
    m_sSitePath.Append(psSubDir);
  }
  else
  {
    wxString sUp3 = GetExePath();
    nwxFileUtil::UpDir(&sUp3,3);
    nwxFileUtil::NoEndWithSeparator(&sUp3);
    sUp3.Append(psSubDir);
    m_sSitePath = sUp3;
  }
#endif
}
开发者ID:HelloWilliam,项目名称:osiris,代码行数:29,代码来源:ConfigDir.cpp

示例3: main

int main(int argc, char **argv) {
    try {
        std::string memMaxArg = std::string();
        char * varMemMax = getenv("NEXTFRACTAL_MAX_MEMORY");
        int varMemMaxLen = varMemMax != NULL ? strlen(varMemMax) : 0;
        if (varMemMaxLen > 0) {
            memMaxArg.append("-Xmx");
            memMaxArg.append(std::to_string(std::stoi(varMemMax)));
            memMaxArg.append("m");
        } else {
            memMaxArg.append("-Xmx3g");
        }
        std::string basePath = GetBasePath(GetExePath());
        std::cout << "Base path " << basePath << std::endl;
        std::string jarsPath = basePath + "/../Resources";
        std::string classpathArg = "-Djava.class.path=" + GetClasspath(jarsPath);
        std::string libPathArg = "-Djava.library.path=" + basePath + "/../Resources";
        std::string locPathArg = "-Dbrowser.location=" + basePath + "/../../../examples";
        const char *vm_arglist[] = {
            "-Djava.util.logging.config.class=com.nextbreakpoint.nextfractal.runtime.LogConfig",
            classpathArg.c_str(),
            libPathArg.c_str(),
            locPathArg.c_str(),
            memMaxArg.c_str(),
            0
        };
        struct start_args args(vm_arglist, "com/nextbreakpoint/nextfractal/runtime/javafx/NextFractalApp");
        pthread_t thr;
        pthread_create(&thr, NULL, start_java, &args);
        CFRunLoopRun();
    } catch (const std::runtime_error& e) {
        ShowAlert("Did you install Java JDK 8 or later?", e);
    }
}
开发者ID:adriens,项目名称:nextfractal,代码行数:34,代码来源:NextFractal.cpp

示例4: ReloadAllTexture

namespace kvarco
{

//どうせ他から呼ばないのでこの関数はヘッダに書いてないよ
void ReloadAllTexture()
{
	DxLib::ReloadFileGraphAll();
	TextureManager::GetInst()->Reload();
}

// ファイル名からパスを取り出して返す
std::string GetFilePath(std::string s)
{
	int pos=s.rfind("\\");
	if (pos==(int)std::string::npos) return "";
	return s.substr(0, pos+1);
}

// 実行ファイルのパスを返す(末尾に\が付く)
std::string GetExePath()
{
	char buf[MAX_PATH+1];
	GetModuleFileName(NULL, buf, MAX_PATH);
	return GetFilePath(buf);
}

fsys::path ExePath=fsys::path(GetExePath().c_str());

GameBootSettingPtr GetGameSetting()
{
	return &(Game::GetInst()->Setting);
}
}
开发者ID:ShitijyouA,项目名称:GameEngine-KVARCO,代码行数:33,代码来源:Game.cpp

示例5: ChangeFileExt

	//Class EventLogger
	EventLogger::EventLogger()
	{
		m_fOnDisplay = NULL;
		m_strFP = ChangeFileExt(GetExePath(), DAnsiStr(".pslog"));			
		m_szBufferSize = 0;
		setWriteFlags(PS_LOG_WRITE_EVENTTYPE | PS_LOG_WRITE_SOURCE | PS_LOG_WRITE_TO_SCREEN);
	}
开发者ID:GraphicsEmpire,项目名称:RenderFrameWorkQt5,代码行数:8,代码来源:PS_Logger.cpp

示例6: finFile

void DcmFileProcess::showPosPosition(const char* FilePath, std::vector<float>& position)
{
	std::string coordinate;
	std::ifstream finFile(FilePath);

	while (std::getline(finFile, coordinate))
	{
		std::vector<std::string> result;
		split(coordinate, " ", result);
		//得到输入的原始世界坐标数据
		float realx = (float)atof(result[0].c_str());
		float realy = (float)atof(result[1].c_str());
		float realz = (float)atof(result[2].c_str());
		// position max_axial, min_axial, (max_axial-min_axial)/count, initx, inity, pixelspacing
		int pixelx = (int)((realx - position[3]) / position[5] + 0.5);
		int pixely = (int)((realy - position[4]) / position[5] + 0.5);
		int pixelz = (int)((realz - position[1]) / position[2] + 0.5);

		//找到对应图像
		std::string dirName = GetExePath();
		dirName += "cache\\";
		const char *dir = dirName.c_str();
		char BmpName[256];
		sprintf_s(BmpName, "%s%06d.bmp", dir, pixelz);
		cv::Mat bmp = cv::imread(BmpName);
		ImageConvert::markRect(bmp, pixelx, pixely);
		//将标记文件写入缓冲区,替换原有文件
		cv::imwrite(BmpName, bmp);
	}
}
开发者ID:SalamanderJY,项目名称:OpenCT,代码行数:30,代码来源:DcmFileProcess.cpp

示例7: NPP_New

NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved)
{
    InstanceData *data;

    plogf("sp: NPP_New() mode=%d ", mode);

    if (!instance)
    {
        plogf("error: NPERR_INVALID_INSTANCE_ERROR");
        return NPERR_INVALID_INSTANCE_ERROR;
    }

    if (pluginType)
        plogf("sp:   pluginType: %s ", ScopedMem<TCHAR>(str::conv::FromAnsi(pluginType)));
    if (saved)
        plogf("sp:   SavedData: len=%d", saved->len);

    instance->pdata = calloc(1, sizeof(InstanceData));
    if (!instance->pdata)
    {
        plogf("error: NPERR_OUT_OF_MEMORY_ERROR");
        return NPERR_OUT_OF_MEMORY_ERROR;
    }

    data = (InstanceData *)instance->pdata;
    gNPNFuncs.setvalue(instance, NPPVpluginWindowBool, (void *)true);
    
    if (GetExePath(data->exepath, dimof(data->exepath)))
        data->message = _T("Opening document in SumatraPDF...");
    else
        data->message = _T("Error: SumatraPDF hasn't been found!");
    
    return NPERR_NO_ERROR;
}
开发者ID:monolithpl,项目名称:sumatrapdf,代码行数:34,代码来源:npPdfViewer.cpp

示例8: main

int main(int argc,char** argv)
{
    char _exePathBuf[PATH_MAX];
    char _pyCmd[PATH_N];
    char _pyPath[PATH_N];
    FILE* _pathFP;
    if(GetExePath(_exePathBuf) == NULL)
    {
        fprintf(stderr,"get execute path error!!");
        exit(1);
    }
    _pathFP = popen("python -c \"import sys\nprint sys.path\"", "r");
    if( 0 > fread(_pyPath, 1, PATH_N, _pathFP))
    {
        fprintf(stderr,"get python path error!!");
        exit(1);
    }
    pclose(_pathFP);
    //printf("%s\n",_pyPath);
    sprintf(_pyCmd,
            "import sys\n"
            "sys.path = eval(str(%s))\n"
            "sys.path.insert(0,'%slibXmlRpcNotify.so')\n"
            "import XmlRpcNotify\n"
            "XmlRpcNotify.main()",
            _pyPath,_exePathBuf);
    //printf("%s\n",_pyCmd);
    Py_OptimizeFlag = 2;
    Py_NoSiteFlag = 1;
    Py_Initialize();
    PySys_SetArgv(argc, argv);
    PyRun_SimpleString(_pyCmd);
    Py_Finalize();
    return 0;
}
开发者ID:zdz,项目名称:util.tools,代码行数:35,代码来源:packpy.c

示例9: IsRunningInPortableMode

/* Return false if this program has been started from "Program Files" directory
   (which is an indicator that it has been installed) or from the last known
   location of a SumatraPDF installation: */
bool IsRunningInPortableMode()
{
    // cache the result so that it will be consistent during the lifetime of the process
    static int sCacheIsPortable = -1; // -1 == uninitialized, 0 == installed, 1 == portable
    if (sCacheIsPortable != -1)
        return sCacheIsPortable != 0;
    sCacheIsPortable = 1;

    if (HasBeenInstalled()) {
        sCacheIsPortable = 0;
        return false;
    }

    ScopedMem<WCHAR> exePath(GetExePath());
    ScopedMem<WCHAR> programFilesDir(GetSpecialFolder(CSIDL_PROGRAM_FILES));
    // if we can't get a path, assume we're not running from "Program Files"
    if (!exePath || !programFilesDir)
        return true;

    // check if one of the exePath's parent directories is "Program Files"
    // (or a junction to it)
    WCHAR *baseName;
    while ((baseName = (WCHAR*)path::GetBaseName(exePath)) > exePath) {
        baseName[-1] = '\0';
        if (path::IsSame(programFilesDir, exePath)) {
            sCacheIsPortable = 0;
            return false;
        }
    }

    return true;
}
开发者ID:vipontes,项目名称:sumatrapdf,代码行数:35,代码来源:AppTools.cpp

示例10: MAKEINTRESOURCE

void CT3000DefaultView::OnInitialUpdate()
{
/*	hBitmap_default_bmp =(HBITMAP)LoadImage(AfxGetInstanceHandle(),  
		MAKEINTRESOURCE(IDB_BITMAP_BUILDING_DEFAULT),  
		IMAGE_BITMAP,0,0,  
		LR_LOADMAP3DCOLORS); */ 
    HANDLE hFind;//
    WIN32_FIND_DATA wfd;//
    CString bmppath = GetExePath(true)+_T("default_screen.bmp");
    hFind = FindFirstFile(bmppath, &wfd);//
    if (hFind==INVALID_HANDLE_VALUE)//说明当前目录下无t3000.mdb
    {
        hBitmap_default_bmp =(HBITMAP)LoadImage(AfxGetInstanceHandle(),  
            MAKEINTRESOURCE(IDB_BITMAP_BUILDING_DEFAULT),  
            IMAGE_BITMAP,0,0,  
            LR_LOADMAP3DCOLORS);
    }
    else
    {
        hBitmap_default_bmp =(HBITMAP)LoadImage(AfxGetInstanceHandle(),
            bmppath,  
            IMAGE_BITMAP,0,0,  
            LR_LOADFROMFILE|LR_CREATEDIBSECTION); 
        if(NULL == hBitmap_default_bmp)
        {
            // LoadImage faled so get extended error information.
            DWORD dwError = ::GetLastError();
        }
    }
   
	CFormView::OnInitialUpdate();
}
开发者ID:ALEXLCC,项目名称:T3000_Building_Automation_System,代码行数:32,代码来源:T3000DefaultView.cpp

示例11: temp

void ConnDlg::ApplyDaemonHistory()
{
	std::list<std::wstring>::iterator result =
		std::find(m_daemonHistory.begin(), m_daemonHistory.end(), ui.edtIP->currentText().toStdWString());

	if ( m_daemonHistory.end() != 
		result )
	{
		std::wstring temp(*result);
		m_daemonHistory.erase(result);
		m_daemonHistory.push_front(temp);
	}
	else
	{
		if ( m_daemonHistory.size() > 5 )
		{
			m_daemonHistory.pop_back();
		}

		m_daemonHistory.push_front(ui.edtIP->currentText().toStdWString());
	}

	std::wstring iniPath = GetExePath() + L"\\setting.ini";

	int i = 1;
	WCHAR key[256] = {0};

	for ( std::list<std::wstring>::iterator it = m_daemonHistory.begin();
		it != m_daemonHistory.end() && i <= 5;
		++it, ++i )
	{
		wsprintf(key, L"DaemonIp%d", i);
		WriteStringPolicyToLocal(L"DaemonHistory", key, it->c_str(), iniPath.c_str());
	}
}
开发者ID:yzx65,项目名称:RemoteControl,代码行数:35,代码来源:conndlg.cpp

示例12: exePath

/* Caller needs to free() the result. */
WCHAR *AppGenDataFilename(WCHAR *fileName)
{
    ScopedMem<WCHAR> path;
    if (IsRunningInPortableMode()) {
        /* Use the same path as the binary */
        ScopedMem<WCHAR> exePath(GetExePath());
        if (exePath)
            path.Set(path::GetDir(exePath));
    } else {
        /* Use %APPDATA% */
        WCHAR dir[MAX_PATH];
        dir[0] = '\0';
        BOOL ok = SHGetSpecialFolderPath(NULL, dir, CSIDL_APPDATA, TRUE);
        if (ok) {
            path.Set(path::Join(dir, APP_NAME_STR));
            if (path && !dir::Create(path))
                path.Set(NULL);
        }
    }

    if (!path || !fileName)
        return NULL;

    return path::Join(path, fileName);
}
开发者ID:Jens1970,项目名称:sumatrapdf,代码行数:26,代码来源:AppTools.cpp

示例13: while

void ConnDlg::GetDaemonHistory()
{
	while ( 0 != ui.edtIP->count())
		ui.edtIP->removeItem(0);

	m_daemonHistory.clear();

	std::wstring iniPath = GetExePath() + L"\\setting.ini";

	std::wstring ip;
	WCHAR key[256] = {0};
	
	for ( int i = 1; i <= 5; ++i )
	{
		wsprintf(key, L"DaemonIp%d", i);
		std::wstring ip = ReadStringPolicyFromLocal(L"DaemonHistory", key, iniPath.c_str());

		if ( ip != L"" )
		{
			m_daemonHistory.push_back(ip);
			ui.edtIP->addItem(QString::fromStdWString(ip));
		}
		else
			break;
	}
}
开发者ID:yzx65,项目名称:RemoteControl,代码行数:26,代码来源:conndlg.cpp

示例14: ServerBase

CMySql::CMySql() :
	ServerBase("MySQL", MYSQL_DEFAULT_PORT)
{
	char szMySqlExe[4][_MAX_PATH] = { "mysqld.exe", "mysqld-nt.exe", "mysqld-opt.exe", "mysqld-shareware.exe"};
	char szMyIniPath[_MAX_PATH] = {0}, szExePath[_MAX_PATH] = {0};

	_snprintf(m_sMySqlPath, sizeof(m_sMySqlPath)-1, "%sMySql\\", CUtils::GetEasyPhpPath());

	for (int niI = 0; niI <= 3; niI++)
	{
		_snprintf(szExePath, _MAX_PATH-1, "%sbin\\%s", (LPCTSTR) m_sMySqlPath, szMySqlExe[niI]);
		if (_access(szExePath, 0) != -1)
		{
			SetExePath(szExePath);
			break;
		}
	}
 
/*	GetWindowsDirectory(szMyIniPath, MAX_PATH);
	strcat(szMyIniPath, "\\My.Ini");*/
	_snprintf(szMyIniPath, sizeof(szMyIniPath)-1, "%smy.ini", m_sMySqlPath);

	SetConfFile(szMyIniPath);

	char szTempPath[MAX_PATH] = {0};
	_snprintf(szTempPath, sizeof(szTempPath)-1, "%sconf_files\\my.ini", CUtils::GetEasyPhpPath());
	SetTemplateConfFile(szTempPath);

	m_szMySqlParams[0] = '\0';

	CUtils::ScanProcess(GetExePath(), m_stProcInfo.dwProcessId);
	ReadConfFile();
}
开发者ID:TheTypoMaster,项目名称:instantrails,代码行数:33,代码来源:CMySql.cpp

示例15: NPP_New

NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved)
{
    plogf("sp: NPP_New() mode=%d ", mode);

    if (!instance)
    {
        plogf("sp: error: NPERR_INVALID_INSTANCE_ERROR");
        return NPERR_INVALID_INSTANCE_ERROR;
    }

    if (pluginType)
        plogf("sp:   pluginType: %s ", pluginType);
    if (saved)
        plogf("sp:   SavedData: len=%d", saved->len);

    instance->pdata = AllocStruct<InstanceData>();
    if (!instance->pdata)
    {
        plogf("sp: error: NPERR_OUT_OF_MEMORY_ERROR");
        return NPERR_OUT_OF_MEMORY_ERROR;
    }

    gNPNFuncs.setvalue(instance, NPPVpluginWindowBool, (void *)true);
    
    InstanceData *data = (InstanceData *)instance->pdata;
    bool ok = GetExePath(data->exepath, dimof(data->exepath));
    SelectTranslation(ok ? data->exepath : NULL);
    if (ok)
        data->message = _TR("Opening document in SumatraPDF...");
    else
        data->message = _TR("Error: SumatraPDF hasn't been found!");
    
    return NPERR_NO_ERROR;
}
开发者ID:DavidWiberg,项目名称:sumatrapdf,代码行数:34,代码来源:npPdfViewer.cpp


注:本文中的GetExePath函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。