本文整理汇总了C++中atl::CString::GetString方法的典型用法代码示例。如果您正苦于以下问题:C++ CString::GetString方法的具体用法?C++ CString::GetString怎么用?C++ CString::GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atl::CString
的用法示例。
在下文中一共展示了CString::GetString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RegisterComDLL
bool RegisterComDLL(HINSTANCE hin,LPCTSTR dll)
{
TCHAR curpath[MAX_PATH];
GetModuleFileName( hin, curpath, MAX_PATH );
PathRemoveFileSpec(curpath);
ATL::CString file;
file += "regsvr32 \"";
file += curpath;
file += "\\";
file += dll;
file += "\" /s";
STARTUPINFO si={0};
si.cb = sizeof(si);
PROCESS_INFORMATION pi={0};
if(!CreateProcess( NULL,(LPWSTR)file.GetString(), NULL,NULL,FALSE,0, NULL,NULL,&si, &pi ))
{
DebugOutF(filelog::log_error,"CreateProcess failed with %d",GetLastError() );
return false;
}
WaitForSingleObject(pi.hProcess,-1);
DWORD exitcode = 0;
GetExitCodeProcess(pi.hProcess,&exitcode);
if(pi.hProcess)CloseHandle(pi.hProcess);
if(pi.hThread)CloseHandle(pi.hThread);
return exitcode == 0;
}
示例2: OnClicked_BtnOK
LRESULT CSiteSelectedBoxWnd::OnClicked_BtnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
ATL::CString strName;
m_ctrlSiteCombo.GetLBText(m_ctrlSiteCombo.GetCurSel(), strName);
map<TSTLSTRING, TSTLSTRING>::iterator iterSite = m_SiteMap.find(strName.GetString());
if(iterSite == m_SiteMap.end())
{
MessageBox(TEXT("您没有选择站点?"), TEXT("提示"), MB_OK|MB_ICONINFORMATION);
bHandled = TRUE;
return 0;
}
try
{
ConfigureManager::GetInstance().SetSettingValue(TEXT("sitename"), iterSite->second);
ConfigureManager::GetInstance().Save();
}
catch(Exception& error)
{
MessageBox(error.GetMessage().c_str(), TEXT("错误"), MB_OK|MB_ICONERROR);
}
DestroyWindow();
if(!OnSelected.m_EventList.empty())
{
Event< SiteSelected >::EventIterator iter;
for( iter = OnSelected.m_EventList.begin();
iter != OnSelected.m_EventList.end();
++iter )
{
InvokeEvent(true, iterSite->second);
}
}
bHandled = TRUE;
return 0;
}