//网络关闭消息 bool __cdecl CPlazaViewItem::OnEventTCPSocketShut(WORD wSocketID, BYTE cbShutReason) { if (m_bLogonPlaza==false) { if (cbShutReason!=SHUT_REASON_NORMAL) { g_GlobalAttemper.DestroyStatusWnd(this); ShowMessageBox(TEXT("登录服务器连接失败,请稍后再试或留意网站公告!"),MB_ICONINFORMATION); SendLogonMessage(); } } //自定义头像 CGameFrame *pGameFrame = (CGameFrame *)AfxGetMainWnd() ; CDlgCustomFace &DlgCustomFace = pGameFrame->m_DlgCustomFace; if ( DlgCustomFace.m_hWnd != NULL ) DlgCustomFace.SetStatus(enOperateStatus_NULL); //释放内存 if ( m_CustomFace.pFaceData != NULL ) m_CustomFace.Clear(); return true; }
bool CheckProfilePasswordResult(ProfilePasswordResult result, const Error &error) { switch (result) { case ProfilePasswordResult::UNPROTECTED: case ProfilePasswordResult::MATCH: return true; case ProfilePasswordResult::MISMATCH: ShowMessageBox(_("Wrong password."), _("Password"), MB_OK); return false; case ProfilePasswordResult::CANCEL: return false; case ProfilePasswordResult::ERROR: ShowError(error, _("Password")); return false; } gcc_unreachable(); }
bool OrderedTaskSave(const OrderedTask& task, bool noask) { assert(protected_task_manager != NULL); if (!noask && ShowMessageBox(_("Save task?"), _("Task Selection"), MB_YESNO | MB_ICONQUESTION) != IDYES) return false; TCHAR fname[69] = _T(""); if (!dlgTextEntryShowModal(fname, 64)) return false; TCHAR path[MAX_PATH]; LocalPath(path, _T("tasks")); Directory::Create(path); _tcscat(fname, _T(".tsk")); LocalPath(path, _T("tasks"), fname); protected_task_manager->TaskSave(path, task); return true; }
inline void ProfileListWidget::NewClicked() { StaticString<64> name; name.clear(); if (!TextEntryDialog(name, _("Profile name"))) return; StaticString<80> filename; filename = name; filename += _T(".prf"); StaticString<MAX_PATH> path; LocalPath(path.buffer(), filename); if (!File::CreateExclusive(path)) { ShowMessageBox(name, _("File exists already."), MB_OK|MB_ICONEXCLAMATION); return; } UpdateList(); SelectPath(path); }
void InfoBoxesConfigWidget::OnPaste() { if (clipboard_size == 0) return; if(ShowMessageBox(_("Overwrite?"), _("InfoBox paste"), MB_YESNO | MB_ICONQUESTION) != IDYES) return; for (unsigned item = 0; item < clipboard_size; item++) { InfoBoxFactory::Type content = clipboard.contents[item]; if (content >= InfoBoxFactory::NUM_TYPES) continue; data.contents[item] = content; if (item < previews.size()) previews[item].Invalidate(); } RefreshEditContent(); }
LRESULT SnapshotWizardPage1::OnWizardNext() { CAutoPtr<wchar_t> sourcePath(new wchar_t[sourceEdit_.GetWindowTextLengthW() + 1]); sourceEdit_.GetWindowTextW(sourcePath, sourceEdit_.GetWindowTextLengthW() + 1); CAutoPtr<wchar_t> destinationPath(new wchar_t[destinationEdit_.GetWindowTextLengthW() + 1]); destinationEdit_.GetWindowTextW(destinationPath, destinationEdit_.GetWindowTextLengthW() + 1); wchar_t expandedSourcePath[MAX_PATH]; wchar_t expandedDestinationPath[MAX_PATH]; if (0 == ::ExpandEnvironmentStrings(sourcePath, expandedSourcePath, MAX_PATH)) { ShowMessageBox(L"Bad source path format."); return -1; } if (0 == ::ExpandEnvironmentStrings(destinationPath, expandedDestinationPath, MAX_PATH)) { ShowMessageBox(L"Bad destination path format."); return -1; } if (!ATLPath::FileExists(expandedSourcePath)) { ShowMessageBox(L"The source file does not exists."); return -1; } if (ATLPath::FileExists(expandedDestinationPath)) { ShowMessageBox(L"The Destination file already exists."); return -1; } auto hr = Vss::CopyFileFromSnapshot(sourcePath, destinationPath); if (FAILED(hr)) { CString errorMessage; errorMessage.Format(L"%s : %d", L"Vss copy Failed.", hr); ShowMessageBox(errorMessage); return -1; } if (!InvokeEsentutilP(destinationPath)) { CString errorMessage; errorMessage.Format(L"%s : %d", L"Database repair Failed. : ", GetLastError()); ShowMessageBox(errorMessage); return -1; } wcscpy_s(sharedStringPage1_, MAX_PATH + 1, destinationPath); return 0; }
bool Cmd_MessageBoxEx_Execute(COMMAND_ARGS) { *result = 0; char buffer[kMaxMessageLength]; if(!ExtractFormatStringArgs(0, buffer, paramInfo, scriptData, opcodeOffsetPtr, scriptObj, eventList, kCommandInfo_MessageBoxEx.numParams)) return true; //extract the buttons char * b[10] = {0}; UInt32 btnIdx = 0; for(char* ch = buffer; *ch && btnIdx < 10; ch++) { if(*ch == GetSeparatorChar(scriptObj)) { *ch = '\0'; b[btnIdx++] = ch + 1; } } if(!btnIdx) // supply default OK button b[0] = "Ok"; if(thisObj && !(thisObj->flags & TESForm::kFormFlags_DontSaveForm)) // if not temporary object and not quest script *ShowMessageBox_pScriptRefID = thisObj->refID; else *ShowMessageBox_pScriptRefID = scriptObj->refID; *ShowMessageBox_button = 0xFF; // overwrite any previously pressed button ShowMessageBox(buffer, 0, 0, ShowMessageBox_Callback, 0, 0x17, 0, 0, b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], NULL); return true; }
void TextInputMessageBox::Init() { char* buttons[10] = { NULL }; UInt32 numButtons = 0; UInt32 fmtStringLen = strlen(m_fmtString); char* fmtString = new char[fmtStringLen + 1]; strcpy_s(fmtString, fmtStringLen + 1, m_fmtString); //separate prompt text and button text for (UInt32 strPos = 0; strPos < fmtStringLen && numButtons < 10; strPos++) { if (fmtString[strPos] == GetSeparatorChar(m_script) && (strPos + 1 < fmtStringLen)) { fmtString[strPos] = '\0'; buttons[numButtons++] = fmtString + strPos + 1; } } m_promptText = fmtString; if (!buttons[0]) //supply default button if none specified buttons[0] = "Finished"; //now display the messagebox ShowMessageBox(fmtString, ShowMessageBox_Callback, 0, buttons[0], buttons[1], buttons[2], buttons[3], buttons[4], buttons[5], buttons[6], buttons[7], buttons[8], buttons[9], 0); //Register it with the game so scripts can pick up button pressed *ShowMessageBox_pScriptRefID = m_scriptRefID; *ShowMessageBox_button = -1; //Disable menu shortcut keys so they don't interfere with typing if (!m_bShortcutsDisabled) { m_bShortcutsDisabled = true; ToggleMenuShortcutKeys(false, GetMenuByType(kMenuType_Message)); } }
void TaskListPanel::LoadTask() { const OrderedTask* orig = get_cursor_task(); if (orig == NULL) return; StaticString<1024> text; text.Format(_T("%s\n(%s)"), _("Load the selected task?"), get_cursor_name()); if (ShowMessageBox(text.c_str(), _("Task Browser"), MB_YESNO | MB_ICONQUESTION) != IDYES) return; // create new task first to guarantee pointers are different OrderedTask* temptask = orig->Clone(CommonInterface::GetComputerSettings().task); delete *active_task; *active_task = temptask; RefreshView(); *task_modified = true; dialog.SwitchToEditTab(); }
void ParamSetWindow::OnPushbuttonOKClicked() { RobotHighLevelControl::ParamCXB temp; bool flag = true; temp.duty = ui->lineEditDuty->text().toDouble(&flag); if (!flag || temp.duty > 1 || temp.duty < 0) { ShowMessageBox("Wrong duty setting!"); return; } temp.stepHeight = ui->lineEditStepHeight->text().toDouble(&flag); if (!flag || temp.stepHeight < 0) { ShowMessageBox("Wrong stepHeight setting!"); return; } temp.desireVelocity = ui->lineEditStepLength->text().toDouble(&flag); if (!flag || temp.desireVelocity < -0.4 || temp.desireVelocity > 0.4) { ShowMessageBox("Wrong speed setting!"); return; } temp.standHeight = ui->lineEditStandHeight->text().toDouble(&flag); if (!flag || temp.standHeight < 450) { ShowMessageBox("Wrong standHeight setting!"); return; } temp.tdDeltaMidLeg = ui->lineEditStepDpMid->text().toDouble(&flag); if (!flag) { ShowMessageBox("Wrong Step DP Mid setting!"); return; } temp.tdDeltaSideLeg = ui->lineEditStepDpSide->text().toDouble(&flag); if (!flag) { ShowMessageBox("Wrong Step DP Side setting!"); return; } temp.totalPeriodCount = ui->lineEditPeriodCount->text().toUInt(&flag); if (!flag) { ShowMessageBox("Wrong total period count setting!"); return; } temp.T = ui->lineEditPeriodTime->text().toDouble(&flag); if (!flag || temp.T < 0) { ShowMessageBox("Wrong period time setting!"); return; } temp.Lside = ui->lineEditLside->text().toDouble(&flag); if (!flag) { ShowMessageBox("Wrong Lside setting!"); return; } temp.rotationAngle = ui->lineRotationAngle->text().toDouble(&flag); if (!flag) { ShowMessageBox("Wrong rotation angle setting!"); return; } m_param = temp; this->close(); }
void DeleteTempo (COMMAND_T* ct) { // Get tempo map BR_Envelope tempoMap(GetTempoEnv()); if (!tempoMap.CountSelected()) return; int offset = 0; // Loop through selected points and perform BPM calculations int skipped = 0; for (int i = 0; i < tempoMap.CountSelected(); ++i) { int id = tempoMap.GetSelected(i) + offset; if (id == 0) continue; // Get tempo points double t1, t2, t3, t4; double b1, b2, b3, b4; int s0, s1, s2, s3; tempoMap.GetPoint(id, &t2, &b2, &s2, NULL); bool P0 = tempoMap.GetPoint(id-2, NULL, NULL, &s0, NULL); bool P1 = tempoMap.GetPoint(id-1, &t1, &b1, &s1, NULL); bool P3 = tempoMap.GetPoint(id+1, &t3, &b3, &s3, NULL); bool P4 = tempoMap.GetPoint(id+2, &t4, &b4, NULL, NULL); // Hold new values double Nt1, Nb1; double Nt3, Nb3; // If previous point doesn't exist, fake it if (!P0) s0 = SQUARE; // Get P2-P3 length double m2; if (s2 == SQUARE) m2 = b2*(t3-t2) / 240; else m2 = (b2+b3)*(t3-t2) / 480; ///// CALCULATE BPM VALUES ///// //////////////////////////////// if (P3) { if (s0 == SQUARE) { if (s1 == SQUARE) { Nt1 = t1; Nb1 = (240*m2 + b1*(t2-t1)) / (t3-t1); } else { Nt1 = t1; Nb1 = (480*m2 + (b1+b2)*(t2-t1)) / (t3-t1) - b3; } // Check new value is legal if (Nb1 > MAX_BPM || Nb1 < MIN_BPM) SKIP(skipped, 1); // Next point stays the same P3 = false; } else { // If P4 exists... if (P4) { if (s1 == SQUARE) { if (s3 == SQUARE) { Nt3 = t2 + 240*m2 / b1; Nb3 = b3*(t4-t3) / (t4-Nt3); } else { Nt3 = t2 + 240*m2 / b1; Nb3 = (b3+b4)*(t4-t3) / (t4-Nt3) - b4; } } else { if (s3 == SQUARE) { double f1 = (b1+b2)*(t2-t1) + 480*m2; double f2 = b3*(t4-t3); double a = b1; double b = (a*(t1+t4) + f1+f2) / 2; double c = a*(t1*t4) + f1*t4 + f2*t1; Nt3 = c / (b + sqrt(pow(b,2) - a*c)); Nb3 = f2 / (t4 - Nt3); } else { double f1 = (b1+b2)*(t2-t1) + 480*m2; double f2 = (b3+b4)*(t4-t3); double a = b1-b4; double b = (a*(t1+t4) + f1+f2) / 2; double c = a*(t1*t4) + f1*t4 + f2*t1; Nt3 = c / (b + sqrt(pow(b,2) - a*c)); Nb3 = f2 / (t4 - Nt3) - b4; } } // Check new position is legal if ((Nt3 - t1) < MIN_TEMPO_DIST || (t4 - Nt3) < MIN_TEMPO_DIST) SKIP(skipped, 1); } // If P4 does not exist else { if (s1 == SQUARE) { Nt3 = t2 + 240*m2 / b1; Nb3 = b3; } else { Nt3 = t3; Nb3 = (480*m2 + (b1+b2)*(t2-t1)) / (t3-t1) - b1; } // Check new position is legal if ((Nt3 - t1) < MIN_TEMPO_DIST) SKIP(skipped, 1); } // Check new value is legal if (Nb3 > MAX_BPM || Nb3 < MIN_BPM) SKIP(skipped, 1); // Previous point stays the same P1 = false; } } else { // No surrounding points get edited P1 = false; P3 = false; } ///// SET NEW BPM ///// /////////////////////// // Previous point if (P1) tempoMap.SetPoint(id-1, &Nt1, &Nb1, NULL, NULL); // Next point if (P3) tempoMap.SetPoint(id+1, &Nt3, &Nb3, NULL, NULL); // Delete point tempoMap.DeletePoint(id); --offset; } // Commit changes if (tempoMap.Commit()) Undo_OnStateChangeEx2(NULL, SWS_CMD_SHORTNAME(ct), UNDO_STATE_ALL, -1); // Warn user if some points weren't processed static bool s_warnUser = true; if (s_warnUser && skipped != 0) { char buffer[512]; _snprintfSafe(buffer, sizeof(buffer), __LOCALIZE_VERFMT("%d of the selected points didn't get processed because some points would end up with illegal BPM or position. Would you like to be warned if it happens again?", "sws_mbox"), skipped); int userAnswer = ShowMessageBox(buffer, __LOCALIZE("SWS - Warning", "sws_mbox"), 4); if (userAnswer == 7) s_warnUser = false; } }
//左键双击 void __cdecl CPlazaViewItem::OnTreeLeftDBClick(CListItem *pListItem, HTREEITEM hTreeItem, CTreeCtrl *pTreeCtrl) { //效验参数 if(pListItem==NULL) { return ; } //消息处理 switch (pListItem->GetItemGenre()) { //游戏类型 case ItemGenre_Kind: { CListKind *pListKind = (CListKind *)pListItem; tagGameKind *pGameKind = pListKind->GetItemInfo(); //Add by doctor 20071014 //大类型ID int gameTypeInt = pGameKind->wTypeID ; CString gameExeStr; gameExeStr.Format("%s", pGameKind->szProcessName ); if ( IsTimeOut()) {} else { //是否为单机,FLASH游戏 switch (gameTypeInt) { //单机游戏 case 5: { CString lpszFileName ; CString gamePath; CString applicationPath; CFileFind fFind; //获得应用程序路径 int nPos; GetModuleFileName(NULL,applicationPath.GetBufferSetLength (MAX_PATH+1),MAX_PATH); applicationPath.ReleaseBuffer(); nPos = applicationPath.ReverseFind('\\'); applicationPath = applicationPath.Left(nPos); gamePath = applicationPath + "\\LocalGame"; lpszFileName = gamePath +"\\"+gameExeStr;//这里修改成你的调用应用程序的文件名称 //启动单机游戏 if(!fFind.FindFile(lpszFileName)) { AfxMessageBox("没有找到调用的应用程序!"+ lpszFileName); return ; } else { CString cmdLine; cmdLine.Format("-%s", "FlyGame2007"); // ShellExecute(NULL,"open", gameExeStr, cmdLine ,NULL,SW_SHOW); ShellExecute(NULL,"open", gameExeStr, cmdLine ,gamePath,SW_SHOW); // ShellExecute(NULL,NULL,_T(gameExeStr),NULL, gamePath,NULL); } return; } break; //flash游戏 case 6: { //启动FLASH游戏 //连接规则 TCHAR szRuleUrl[256]=TEXT(""); _snprintf(szRuleUrl,sizeof(szRuleUrl),TEXT("%sPlayGame.asp?KindID=%ld"), Glb().m_MainHomeUrl, pGameKind->wKindID); WebBrowse(szRuleUrl,true); return; } break; default: {} } //End add }//End if //安装判断 if (pListKind->m_bInstall==false) { TCHAR szBuffer[512]=TEXT(""); _snprintf(szBuffer,sizeof(szBuffer),TEXT("【%s】还没有安装,现在是否下载?"),pGameKind->szKindName); int nResult = ShowMessageBox(szBuffer, MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON1); if(nResult == IDYES) { g_GlobalAttemper.DownLoadClient(pGameKind->szKindName, pGameKind->wKindID, true); } } return; } //进程类型 case ItemGenre_Process: { CListProcess *pListProcess = (CListProcess *)pListItem; tagGameProcess *pGameProcess= pListProcess->GetItemInfo(); //构造命令行 CString strCommonLine; tagGlobalUserData & UserData=g_GlobalUnits.GetGolbalUserData(); strCommonLine.Format(TEXT("%s /UserToken:%ld#%s#%s /KindID:%ld /WndPlaza:%ld"), pGameProcess->szProcessName, UserData.dwUserID, UserData.szAccounts, UserData.szPassWord, pGameProcess->wKindID, m_hWnd); //启动游戏客户端 STARTUPINFO StartInfo; PROCESS_INFORMATION ProcessInfo; memset(&StartInfo,0,sizeof(StartInfo)); memset(&ProcessInfo,0,sizeof(ProcessInfo)); StartInfo.cb=sizeof(StartInfo); StartInfo.wShowWindow=SW_SHOWMAXIMIZED; BOOL bSuccess=CreateProcess(NULL,strCommonLine.GetBuffer(),NULL,NULL,FALSE,CREATE_DEFAULT_ERROR_MODE,NULL,NULL,&StartInfo,&ProcessInfo); strCommonLine.ReleaseBuffer(); if(bSuccess == FALSE) { //下载询问 TCHAR szBuffer[512]=TEXT(""); _snprintf(szBuffer,sizeof(szBuffer),TEXT("【%s】还没有安装,现在是否下载?"),pGameProcess->szKindName); int nResult=ShowMessageBox(szBuffer,MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON1); if (nResult==IDYES) g_GlobalAttemper.DownLoadClient(pGameProcess->szKindName,pGameProcess->wKindID,true); } else { CloseHandle(ProcessInfo.hThread); CloseHandle(ProcessInfo.hProcess); } return; } //游戏房间 case ItemGenre_Server: { CListServer * pListServer=(CListServer *)pListItem; g_pControlBar->CreateRoomViewItem(pListServer); return; } }//End switch (pListItem->GetItemGenre()) return; }
//登陆消息 bool CPlazaViewItem::OnSocketMainLogon(CMD_Command Command, void *pBuffer, WORD wDataSize, IClientSocket *pIClientSocke) { ASSERT(Command.wMainCmdID==MDM_GP_LOGON); switch (Command.wSubCmdID) { //登陆成功 case SUB_GP_LOGON_SUCCESS: { //效验参数 ASSERT(wDataSize>=sizeof(CMD_GP_LogonSuccess)); if (wDataSize<sizeof(CMD_GP_LogonSuccess)) { return false; } //保存信息 tagGlobalUserData & UserData=g_GlobalUnits.GetGolbalUserData(); CMD_GP_LogonSuccess * pLogonSuccess=(CMD_GP_LogonSuccess *)pBuffer; UserData.wFaceID=pLogonSuccess->wFaceID; UserData.cbGender=pLogonSuccess->cbGender; UserData.cbMember=pLogonSuccess->cbMember; UserData.dwUserID=pLogonSuccess->dwUserID; UserData.dwGroupID=pLogonSuccess->dwGroupID; UserData.dwExperience=pLogonSuccess->dwExperience; UserData.dwUserRight=pLogonSuccess->dwUserRight; UserData.dwMasterRight=pLogonSuccess->dwMasterRight; //扩展信息 void * pDataBuffer=NULL; tagDataDescribe DataDescribe; CRecvPacketHelper RecvPacket(pLogonSuccess+1,wDataSize-sizeof(CMD_GP_LogonSuccess)); while (true) { pDataBuffer=RecvPacket.GetData(DataDescribe); if (DataDescribe.wDataDescribe==DTP_NULL) break; switch (DataDescribe.wDataDescribe) { case DTP_USER_ACCOUNTS: //用户帐户 { ASSERT(pDataBuffer!=NULL); ASSERT(DataDescribe.wDataSize>0); ASSERT(DataDescribe.wDataSize<=sizeof(UserData.szAccounts)); if (DataDescribe.wDataSize<=sizeof(UserData.szAccounts)) { CopyMemory(UserData.szAccounts,pDataBuffer,DataDescribe.wDataSize); UserData.szAccounts[CountArray(UserData.szAccounts)-1]=0; } break; } case DTP_USER_PASS: //用户密码 { ASSERT(pDataBuffer!=NULL); ASSERT(DataDescribe.wDataSize>0); ASSERT(DataDescribe.wDataSize<=sizeof(UserData.szPassWord)); if (DataDescribe.wDataSize<=sizeof(UserData.szPassWord)) { CopyMemory(UserData.szPassWord,pDataBuffer,DataDescribe.wDataSize); UserData.szPassWord[CountArray(UserData.szPassWord)-1]=0; } break; } case DTP_USER_GROUP_NAME: //社团名字 { ASSERT(pDataBuffer!=NULL); ASSERT(DataDescribe.wDataSize>0); ASSERT(DataDescribe.wDataSize<=sizeof(UserData.szGroupName)); if (DataDescribe.wDataSize<=sizeof(UserData.szGroupName)) { CopyMemory(UserData.szGroupName,pDataBuffer,DataDescribe.wDataSize); UserData.szGroupName[CountArray(UserData.szGroupName)-1]=0; } break; } case DTP_STATION_PAGE: //游戏主站 { ASSERT(pDataBuffer!=NULL); if (pDataBuffer!=NULL) { g_GlobalUnits.SetStationPage((LPCTSTR)pDataBuffer); m_pHtmlBrower->Navigate(g_GlobalUnits.GetStationPage()); } break; } default: { ASSERT(FALSE); } } } //刷新界面 Invalidate(TRUE); //设置提示 g_GlobalAttemper.ShowStatusMessage(TEXT("正在读取服务器列表信息..."),this); return true; } //登陆失败 case SUB_GP_LOGON_ERROR: { //效验参数 CMD_GP_LogonError *pLogonError = (CMD_GP_LogonError *)pBuffer; ASSERT(wDataSize>=(sizeof(CMD_GP_LogonError)-sizeof(pLogonError->szErrorDescribe))); if (wDataSize<(sizeof(CMD_GP_LogonError)-sizeof(pLogonError->szErrorDescribe))) return false; //关闭连接 g_GlobalAttemper.DestroyStatusWnd(this); pIClientSocke->CloseSocket(false); //显示消息 WORD wDescribeSize=wDataSize-(sizeof(CMD_GP_LogonError)-sizeof(pLogonError->szErrorDescribe)); if (wDescribeSize>0) { pLogonError->szErrorDescribe[wDescribeSize-1]=0; ShowMessageBox(pLogonError->szErrorDescribe,MB_ICONINFORMATION); } //发送登陆 SendLogonMessage(); return true; } //登陆完成 case SUB_GP_LOGON_FINISH: { //关闭提示 g_GlobalAttemper.DestroyStatusWnd(this); //展开类型 INT_PTR nIndex=0; CListType * pListType=NULL; do { pListType=g_GlobalUnits.m_ServerListManager.EnumTypeItem(nIndex++); if (pListType==NULL) break; g_GlobalUnits.m_ServerListManager.ExpandListItem(pListType); } while (true); //展开列表 nIndex=0; CListInside * pListInside=NULL; do { pListInside=g_GlobalUnits.m_ServerListManager.EnumInsideItem(nIndex++); if (pListInside==NULL) break; g_GlobalUnits.m_ServerListManager.ExpandListItem(pListInside); } while (true); //记录信息 m_bLogonPlaza=true; m_DlgLogon.OnLogonSuccess(); m_pHtmlBrower->EnableBrowser(true); return true; } } return true; }
bool InitialiseDirectX() { const D3DFORMAT backBufferFormat = D3DFMT_D16; const D3DFORMAT textureFormat = D3DFMT_A8R8G8B8; if(FAILED(d3d = Direct3DCreate9(D3D_SDK_VERSION))) { ShowMessageBox("Direct3D interface creation has failed"); return false; } // Build present params D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); D3DMULTISAMPLE_TYPE antiAliasingLvl; bool antiAliasing = false; if(SUCCEEDED(d3d->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, textureFormat, true, D3DMULTISAMPLE_2_SAMPLES, nullptr))) { d3dpp.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES; antiAliasingLvl = D3DMULTISAMPLE_2_SAMPLES; antiAliasing = true; } d3dpp.hDeviceWindow = hWnd; d3dpp.Windowed = true; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.BackBufferFormat = textureFormat; d3dpp.BackBufferWidth = WINDOW_WIDTH; d3dpp.BackBufferHeight = WINDOW_HEIGHT; d3dpp.EnableAutoDepthStencil = TRUE; d3dpp.AutoDepthStencilFormat = backBufferFormat; if(FAILED(d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &d3ddev))) { ShowMessageBox("Direct3D interface creation has failed"); return false; } // Create Z-buffer if(FAILED(d3ddev->CreateDepthStencilSurface(WINDOW_WIDTH, WINDOW_HEIGHT, backBufferFormat, antiAliasing ? antiAliasingLvl : D3DMULTISAMPLE_NONE, NULL, TRUE, &backBuffer, NULL))) { ShowMessageBox("Z-buffer creation has failed"); return false; } d3ddev->SetRenderTarget(0,backBuffer); // Set render states d3ddev->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, antiAliasing); // Check shader capabilities D3DCAPS9 caps; d3ddev->GetDeviceCaps(&caps); // Check for vertex shader version 2.0 support. if(caps.VertexShaderVersion < D3DVS_VERSION(2, 0)) { ShowMessageBox("Shader model 2.0 or higher is required"); return false; } return true; }
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) { #ifndef _DEBUG // Is there a debugger present? if ( IsDebuggerPresent () ) { // Exit ExitProcess ( -1 ); } #endif // Create the gui instance pGUI = new CGUI; #ifndef _DEBUG // Create the updater instance /*pUpdater = new CUpdate; // Check for updates pUpdater->CheckForUpdates();*/ #endif // bool bFoundCustomDirectory = false; char szInstallDirectory[ MAX_PATH ]; // Try get the custom directory if( !SharedUtility::ReadRegistryString( HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Mafia 2 Multiplayer", "GameDir", NULL, szInstallDirectory, sizeof(szInstallDirectory) ) ) { // Ask them to find their own directory if( ShowMessageBox( "Failed to find Mafia II install directory. Do you want to select it now?", (MB_ICONEXCLAMATION | MB_YESNO) ) == IDYES ) { // Construct the browse info BROWSEINFO browseInfo = {0}; browseInfo.lpszTitle = "Select your Mafia II directory"; ITEMIDLIST * pItemIdList = SHBrowseForFolder( &browseInfo ); // Did they finish looking for a folder? if( pItemIdList != NULL ) { // Get the name of the selected folder if( SHGetPathFromIDList( pItemIdList, szInstallDirectory ) ) bFoundCustomDirectory = true; // Was any memory used? IMalloc * pIMalloc = NULL; if( SUCCEEDED( SHGetMalloc( &pIMalloc ) ) ) { // Free the memory pIMalloc->Free( pItemIdList ); // Release the malloc pIMalloc->Release(); } } // Did they not find the registry? if( !bFoundCustomDirectory ) { ShowMessageBox( "Failed to find Mafia II install directory. Can't launch "MOD_NAME"." ); return 1; } } } // Get the launch path string String strLaunchPath( "%s\\pc", szInstallDirectory ); // Get the full path to Mafia2.exe String strApplicationPath( "%s\\Mafia2.exe", strLaunchPath.Get() ); // Does Mafia2.exe not exist? if( !SharedUtility::Exists( strApplicationPath.Get() ) ) { ShowMessageBox( "Failed to find Mafia2.exe. Can't launch "MOD_NAME"." ); return 1; } // If we have a custom directory, save it! if( bFoundCustomDirectory ) SharedUtility::WriteRegistryString( HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Mafia 2 Multiplayer", "GameDir", szInstallDirectory, sizeof(szInstallDirectory) ); // Get the full path to m2mp.dll String strModulePath( "%s\\%s", SharedUtility::GetAppPath(), CORE_MODULE ); // Does m2mp.dll not exist? if( !SharedUtility::Exists( strModulePath.Get() ) ) { ShowMessageBox( "Failed to find "CORE_MODULE". Can't launch "MOD_NAME"." ); return 1; } // Terminate Mafia II process if it's already running? if( SharedUtility::IsProcessRunning( "Mafia2.exe" ) ) SharedUtility::_TerminateProcess( "Mafia2.exe" ); // Create the startup info struct STARTUPINFO siStartupInfo; PROCESS_INFORMATION piProcessInfo; memset( &siStartupInfo, 0, sizeof(siStartupInfo) ); memset( &piProcessInfo, 0, sizeof(piProcessInfo) ); siStartupInfo.cb = sizeof(siStartupInfo); // Create the Mafia II process if( !CreateProcess( strApplicationPath.Get(), NULL, NULL, NULL, TRUE, CREATE_SUSPENDED, NULL, SharedUtility::GetAppPath(), &siStartupInfo, &piProcessInfo ) ) { ShowMessageBox( "Failed to start Mafia2.exe. Can't launch "MOD_NAME"." ); return 1; } // Inject m2mp.dll into Mafia2.exe int iReturn = SharedUtility::InjectLibraryIntoProcess( piProcessInfo.hProcess, strModulePath.Get() ); // Did m2mp.dll fail to inject? if( iReturn > 0 ) { // Terminate Mafia2.exe TerminateProcess( piProcessInfo.hProcess, 0 ); // Generate the error string String strError( "Unknown Error. Can't launch "MOD_NAME"." ); // Find the cause of the error if( iReturn == 1 ) strError = "Failed to write library path into remote process. Can't launch "MOD_NAME"."; else if( iReturn == 2 ) strError = "Failed to create remote thread in remote process. Can't launch "MOD_NAME"."; else if( iReturn == 2 ) strError = "Failed to open the remote process. Can't launch "MOD_NAME"."; // Show the error message ShowMessageBox( strError.Get() ); return 1; } // Resume Mafia2.exe thread ResumeThread( piProcessInfo.hThread ); return 0; }
void EditTempoGradual (COMMAND_T* ct) { // Get tempo map BR_Envelope tempoMap(GetTempoEnv()); if (!tempoMap.CountSelected()) return; // Get values and type of operation to be performed bool percentage = false; double diff; if (GetFirstDigit((int)ct->user) == 1) diff = (double)ct->user / 1000; else { diff = (double)ct->user / 200000; percentage = true; } // Loop through selected points and perform BPM calculations int skipped = 0; for (int i = 0; i < tempoMap.CountSelected(); ++i) { int id = tempoMap.GetSelected(i); // Hold new values for selected and next point double Nb1, Nt1; vector<double> selPos; vector<double> selBpm; ///// CURRENT POINT ///// ///////////////////////// // Store new values for selected points into vectors int offset = 0; while (true) { // Get point currently in the loop and points surrounding it double t0, t1, t2, b0, b1, b2; int s0, s1; bool P0 = tempoMap.GetPoint(id+offset-1, &t0, &b0, &s0, NULL); tempoMap.GetPoint(id+offset, &t1, &b1, &s1, NULL); tempoMap.GetPoint(id+offset+1, &t2, &b2, NULL, NULL); // If square or not selected, break if (s1 == SQUARE || !tempoMap.GetSelection(id+offset)) { // If breaking on the first selected point, don't adjust i (so for loop doesn't go backwards). i += (offset == 0) ? (0) : (offset-1); --offset; // since this point is not taken into account, correct offset break; } // Get new BPM double bpm = b1 + ((percentage) ? (b1*diff) : (diff)); if (bpm < MIN_BPM) bpm = MIN_BPM; else if (bpm > MAX_BPM) bpm = MAX_BPM; // Get new position (special case for the first point) double position; if (offset == 0) { if (P0 && s0 == LINEAR) { position = (t1*(b0+b1) + t0*(bpm-b1)) / (b0 + bpm); // first point moves but the one before it if (position - t0 < MIN_TEMPO_DIST) // doesn't so check if their distance is legal break; } else position = t1; } else position = ((b0+b1)*(t1-t0) + selPos.back() * (selBpm.back() + bpm)) / (selBpm.back() + bpm); // Store new values selPos.push_back(position); selBpm.push_back(bpm); ++offset; } // Check for illegal position/no linear points encountered (in that case offset is -1 so skipped won't change) if (!selPos.size()) SKIP(skipped, offset+1); ///// NEXT POINT ///// ////////////////////// // Get points after the last selected point double t1, t2; double b1, b2; int s2; bool P1 = tempoMap.GetPoint(id+offset+1, &t1, &b1, &s2, NULL); bool P2 = tempoMap.GetPoint(id+offset+2, &t2, &b2, NULL, NULL); // Calculate new value and position for the next point if (P1) { // Get last selected tempo point (old and new) double Nb0 = selBpm.back(); double Nt0 = selPos.back(); double t0, b0; tempoMap.GetPoint(id+offset, &t0, &b0, NULL, NULL); if (P2) { if (s2 == SQUARE) { double f1 = (b0+b1)*(t1-t0); double f2 = b1*(t2-t1); double a = Nb0; double b = (a*(Nt0+t2) + f1+f2) / 2; double c = a*(Nt0*t2) + f1*t2 + f2*Nt0; Nt1 = c / (b + sqrt(pow(b,2) - a*c)); Nb1 = f2 / (t2-Nt1); } else { double f1 = (b0+b1)*(t1-t0); double f2 = (b1+b2)*(t2-t1); double a = Nb0 - b2; double b = (a*(Nt0+t2) + f1+f2) / 2; double c = a*(Nt0*t2) + f1*t2 + f2*Nt0; Nt1 = c / (b + sqrt(pow(b,2) - a*c)); Nb1 = f2 / (t2-Nt1) - b2; } } else { Nt1 = t1; Nb1 = (b0+b1)*(t1-t0) / (t1-Nt0) - Nb0; } // If points after selected point don't exist, fake them if (!P1) Nt1 = Nt0 + 1; if (!P2) t2 = Nt1 + 1; // Check new value is legal if (Nb1 > MAX_BPM || Nb1 < MIN_BPM) SKIP(skipped, offset+1); if ((Nt1-Nt0) < MIN_TEMPO_DIST || (t2 - Nt1) < MIN_TEMPO_DIST) SKIP(skipped, offset+1); } ///// SET NEW BPM ///// /////////////////////// // Current point(s) for (int i = 0; i < (int)selPos.size(); ++i) tempoMap.SetPoint(id+i, &selPos[i], &selBpm[i], NULL, NULL); // Next point if (P1) tempoMap.SetPoint(id+offset+1, &Nt1, &Nb1, NULL, NULL); } // Commit changes if (tempoMap.Commit()) Undo_OnStateChangeEx2(NULL, SWS_CMD_SHORTNAME(ct), UNDO_STATE_ALL, -1); // Warn user if some points weren't processed static bool s_warnUser = true; if (s_warnUser && skipped != 0 && tempoMap.CountSelected() > 1 ) { char buffer[512]; _snprintfSafe(buffer, sizeof(buffer), __LOCALIZE_VERFMT("%d of the selected points didn't get processed because some points would end up with illegal BPM or position. Would you like to be warned if it happens again?", "sws_mbox"), skipped); int userAnswer = ShowMessageBox(buffer, __LOCALIZE("SWS - Warning", "sws_mbox"), 4); if (userAnswer == 7) s_warnUser = false; } }
/*void CFMUnlockPatientList::OnClerkAddNew(){ CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); } */ void CFMUnlockPatientList::OnPrintPreviewSelect() { CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); UpdateData(true); CReport rpt; CRecord rs(&pMF->m_db); CRecord rss(&pMF->m_db); CString szSQL, tmpStr, szSysDate; CString szTemp, szClass; int nIdx = 0; double nAmount = 0; long double nTotal = 0; long double nGroupTotal = 0; m_nTotal = 0; szSQL = GetQueryString(); rs.ExecSQL(szSQL); szSQL = GetDepositString(); rss.ExecSQL(szSQL); if (rs.GetRecordCount() + rss.GetRecordCount() <= 0) { ShowMessageBox(_T("No Data"), MB_OK | MB_ICONERROR); return; } if (!rpt.Init(_T("Reports/HMS/HF_DANHSACHBNCHUAKHOASO.RPT"))) return; rpt.GetReportHeader()->SetValue(_T("HealthService"), pMF->m_CompanyInfo.sc_pname); rpt.GetReportHeader()->SetValue(_T("HospitalName"), pMF->m_CompanyInfo.sc_name); tmpStr.Format(rpt.GetReportHeader()->GetValue(_T("ReportDate")), CDateTime::Convert(m_szFromDate, yyyymmdd | hhmm, ddmmyyyy | hhmm), CDateTime::Convert(m_szToDate, yyyymmdd | hhmm, ddmmyyyy | hhmm)); rpt.GetReportHeader()->SetValue(_T("ReportDate"), tmpStr); CReportSection *rptDetail; CString szGroup[] = {_T("I"), _T("II"), _T("III"), _T("IV")}; int nIndex = 0; while (!rs.IsEOF()) { if (szClass != rs.GetValue(_T("fclass"))) { if (nGroupTotal > 0) { rptDetail = rpt.AddDetail(rpt.GetGroupHeader(1)); TranslateString(_T("Total Amt"), tmpStr); tmpStr.AppendFormat(_T(" %s"), szGroup[nIndex++]); rptDetail->SetValue(_T("GroupName"), tmpStr); //tmpStr.Format(_T("%.2lf"), nGroupTotal); FormatCurrency(nGroupTotal, tmpStr); rptDetail->SetValue(_T("SumGroupName"), tmpStr); nTotal += nGroupTotal; nGroupTotal = 0; } nIdx = 1; rs.GetValue(_T("fclass"), szClass); if (szClass == _T("NO")) { rptDetail = rpt.AddDetail(rpt.GetGroupHeader(1)); rptDetail->SetValue(_T("GroupName"), _T("\x43\xE1\x63 kho\x61 n\x1ED9i tr\xFA")); } } rptDetail = rpt.AddDetail(); tmpStr.Format(_T("%d"), nIdx++); rptDetail->SetValue(_T("1"), tmpStr); rs.GetValue(_T("pname"), tmpStr); rptDetail->SetValue(_T("2"), tmpStr); rs.GetValue(_T("docno"), tmpStr); rptDetail->SetValue(_T("3"), tmpStr); rs.GetValue(_T("deptid"), tmpStr); rptDetail->SetValue(_T("4"), tmpStr); rs.GetValue(_T("staff"), tmpStr); rptDetail->SetValue(_T("6"), tmpStr); rs.GetValue(_T("amount"), nAmount); nGroupTotal += nAmount; FormatCurrency(nAmount, tmpStr); rptDetail->SetValue(_T("5"), tmpStr); rs.MoveNext(); } if (nGroupTotal > 0) { rptDetail = rpt.AddDetail(rpt.GetGroupHeader(1)); TranslateString(_T("Total Amt"), tmpStr); tmpStr.AppendFormat(_T(" %s"), szGroup[nIndex++]); rptDetail->SetValue(_T("GroupName"), tmpStr); //tmpStr.Format(_T("%.2lf"), nGroupTotal); FormatCurrency(nGroupTotal, tmpStr); rptDetail->SetValue(_T("SumGroupName"), tmpStr); nTotal += nGroupTotal; nGroupTotal = 0; } //szSQL = GetDepositString(); //rs.ExecSQL(szSQL); if (!rss.IsEOF()) { rptDetail = rpt.AddDetail(rpt.GetGroupHeader(1)); rptDetail->SetValue(_T("GroupName"), _T("Thu t\x1EA1m g\x1EEDi")); nIdx = 1; while (!rss.IsEOF()) { rptDetail = rpt.AddDetail(); tmpStr.Format(_T("%d"), nIdx++); rptDetail->SetValue(_T("1"), tmpStr); rss.GetValue(_T("pname"), tmpStr); rptDetail->SetValue(_T("2"), tmpStr); rss.GetValue(_T("docno"), tmpStr); rptDetail->SetValue(_T("3"), tmpStr); rss.GetValue(_T("deptid"), tmpStr); rptDetail->SetValue(_T("4"), tmpStr); rss.GetValue(_T("staff"), tmpStr); rptDetail->SetValue(_T("6"), tmpStr); rss.GetValue(_T("amount"), nAmount); nGroupTotal += nAmount; FormatCurrency(nAmount, tmpStr); rptDetail->SetValue(_T("5"), tmpStr); rss.MoveNext(); } } if (nGroupTotal > 0) { rptDetail = rpt.AddDetail(rpt.GetGroupHeader(1)); TranslateString(_T("Total Amt"), tmpStr); tmpStr.AppendFormat(_T(" %s"), szGroup[nIndex++]); rptDetail->SetValue(_T("GroupName"), tmpStr); //tmpStr.Format(_T("%.2lf"), nGroupTotal); FormatCurrency(nGroupTotal, tmpStr); rptDetail->SetValue(_T("SumGroupName"), tmpStr); nTotal += nGroupTotal; nGroupTotal = 0; } //rptDetail = rpt.AddDetail(rpt.GetReportFooter()); tmpStr.Format(_T("%s"), _T("T\x1ED5ng \x63\x1ED9ng")); rpt.GetReportFooter()->SetValue(_T("TotalAmount"), tmpStr); nTotal += 0.5; long double nTemp = floor(nTotal); m_nTotal = nTemp; FormatCurrency(nTemp, tmpStr); rpt.GetReportFooter()->SetValue(_T("SumTotalAmount"), tmpStr); tmpStr.Format(_T("%.0lf"), nTemp); CString szMoney = tmpStr; MoneyToString(szMoney, tmpStr); rpt.GetReportFooter()->SetValue(_T("SumInWord"), tmpStr); szSysDate = pMF->GetSysDate(); tmpStr.Format(rpt.GetReportFooter()->GetValue(_T("PrintDate")), szSysDate.Right(2), szSysDate.Mid(5, 2), szSysDate.Left(4)); rpt.GetReportFooter()->SetValue(_T("PrintDate"), tmpStr); rpt.PrintPreview(); }
void dlgNOAAListShowModal() { ShowMessageBox(_("This function is not available on your platform yet."), _("Error"), MB_OK); }
void dlgNOAADetailsShowModal(unsigned station_index) { ShowMessageBox(_("This function is not available on your platform yet."), _("Error"), MB_OK); }
BOOL WINAPI CreateProcessW_Hook(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { // If this is not a call to start the 'GTAIV.exe' process then just call the original CreateProcessW if(wcscmp(lpApplicationName, L"GTAIV.exe")) return g_pfnCreateProcessW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); // Set the CREATE_SUSPENDED flag in the creation flags dwCreationFlags |= CREATE_SUSPENDED; // Get the GTA IV install directory from the registry char szInstallDirectory[MAX_PATH]; bool bFoundCustomDirectory = false; if(!SharedUtility::ReadRegistryString(HKEY_LOCAL_MACHINE, "Software\\Rockstar Games\\Grand Theft Auto IV", "InstallFolder", NULL, szInstallDirectory, sizeof(szInstallDirectory)) || !SharedUtility::Exists(szInstallDirectory)) { if(!SharedUtility::ReadRegistryString(HKEY_CURRENT_USER, "Software\\IVMP", "gtaivdir", NULL, szInstallDirectory, sizeof(szInstallDirectory)) || !SharedUtility::Exists(szInstallDirectory)) { if(ShowMessageBox("Failed to retrieve GTA IV install directory from registry. Specify your GTA IV path now?", (MB_ICONEXCLAMATION | MB_OKCANCEL)) == IDOK) { // Taken from http://vcfaq.mvps.org/sdk/20.htm BROWSEINFO browseInfo = { 0 }; browseInfo.lpszTitle = "Pick a Directory"; ITEMIDLIST * pItemIdList = SHBrowseForFolder(&browseInfo); if(pItemIdList != NULL) { // Get the name of the selected folder if(SHGetPathFromIDList(pItemIdList, szInstallDirectory)) bFoundCustomDirectory = true; // Free any memory used IMalloc * pIMalloc = 0; if(SUCCEEDED(SHGetMalloc(&pIMalloc))) { pIMalloc->Free(pItemIdList); pIMalloc->Release(); } } } if(!bFoundCustomDirectory) { ShowMessageBox("Failed to retrieve GTA IV install directory from registry. Cannot launch IV: Multiplayer."); return FALSE; } } } // Get the full path to GTAIV.exe String strApplicationPath("%s\\GTAIV.exe", szInstallDirectory); // Make sure the GTAIV.exe path is valid if(!SharedUtility::Exists(strApplicationPath.Get())) { ShowMessageBox("Failed to find GTAIV.exe. Cannot launch IV: Multiplayer."); return FALSE; } // If we have a custom directory save it if(bFoundCustomDirectory) SharedUtility::WriteRegistryString(HKEY_CURRENT_USER, "Software\\IVMP", "gtaivdir", szInstallDirectory, strlen(szInstallDirectory)); // Convert the install directory to unicode wchar_t wszInstallDirectory[MAX_PATH]; int iInstallDirectoryLength = SharedUtility::AnsiToUnicode(szInstallDirectory, strlen(szInstallDirectory), wszInstallDirectory, sizeof(wszInstallDirectory)); wszInstallDirectory[iInstallDirectoryLength] = '\0'; // Convert the application path to unicode wchar_t wszApplicationPath[MAX_PATH]; int iApplicationPathLength = SharedUtility::AnsiToUnicode(strApplicationPath.Get(), strApplicationPath.GetLength(), wszApplicationPath, sizeof(wszApplicationPath)); wszApplicationPath[iApplicationPathLength] = '\0'; // Create the process BOOL bReturn = g_pfnCreateProcessW(wszApplicationPath, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, wszInstallDirectory, lpStartupInfo, lpProcessInformation); if(bReturn) { // Get the full path of the client dll String strLibraryPath(SharedUtility::GetAbsolutePath(CLIENT_CORE_NAME DEBUG_SUFFIX LIBRARY_EXTENSION)); // Inject Client.dll into GTAIV.exe int iReturn = SharedUtility::InjectLibraryIntoProcess(lpProcessInformation->hProcess, strLibraryPath.Get()); // Did the injection fail? if(iReturn > 0) { // Terminate the process TerminateProcess(lpProcessInformation->hProcess, 0); String strError("Unknown error. Cannot launch IV: Multiplayer."); if(iReturn == 1) strError = "Failed to write library path into remote process. Cannot launch IV: Multiplayer."; else if(iReturn == 2) strError = "Failed to create remote thread in remote process. Cannot launch IV: Multiplayer"; else if(iReturn == 3) strError = "Failed to open the remote process, Cannot launch IV: Multiplayer."; ShowMessageBox(strError.Get()); return FALSE; } // Resume the GTAIV.exe thread ResumeThread(lpProcessInformation->hThread); } return bReturn; }
void WidgetBase::infoSimulation () { ShowMessageBox (m_widget, GetSimulation ().GetInfo ().c_str ()); }
bool GlueMapWindow::ShowMapItems(const GeoPoint &location, bool show_empty_message) const { /* not using MapWindowBlackboard here because this method is called by the main thread */ const ComputerSettings &computer_settings = CommonInterface::GetComputerSettings(); const MapSettings &settings = CommonInterface::GetMapSettings(); const MoreData &basic = CommonInterface::Basic(); const DerivedInfo &calculated = CommonInterface::Calculated(); fixed range = visible_projection.DistancePixelsToMeters(Layout::GetHitRadius()); MapItemList list; MapItemListBuilder builder(list, location, range); if (settings.item_list.add_location) builder.AddLocation(basic, terrain); if (settings.item_list.add_arrival_altitude && route_planner) builder.AddArrivalAltitudes(*route_planner, terrain, computer_settings.task.safety_height_arrival); if (basic.location_available) builder.AddSelfIfNear(basic.location, basic.attitude.heading); if (task) builder.AddTaskOZs(*task); const Airspaces *airspace_database = airspace_renderer.GetAirspaces(); if (airspace_database) builder.AddVisibleAirspace(*airspace_database, airspace_renderer.GetWarningManager(), computer_settings.airspace, settings.airspace, basic, calculated); if (marks && visible_projection.GetMapScale() <= fixed(30000)) builder.AddMarkers(*marks); if (visible_projection.GetMapScale() <= fixed(4000)) builder.AddThermals(calculated.thermal_locator, basic, calculated); if (waypoints) builder.AddWaypoints(*waypoints); #ifdef HAVE_NOAA if (noaa_store) builder.AddWeatherStations(*noaa_store); #endif builder.AddTraffic(basic.flarm.traffic, computer_settings.team_code); // Sort the list of map items list.Sort(); // Show the list dialog if (list.empty()) { if (show_empty_message) ShowMessageBox(_("There is nothing interesting near this location."), _("Map elements at this location"), MB_OK | MB_ICONINFORMATION); return false; } ShowMapItemListDialog(UIGlobals::GetMainWindow(), list, UIGlobals::GetDialogLook(), look, traffic_look, final_glide_bar_renderer.GetLook(), settings, glide_computer != NULL ? &glide_computer->GetAirspaceWarnings() : NULL); return true; }
void ShowError(std::exception_ptr e, const TCHAR *caption) noexcept { ShowMessageBox(UTF8ToWideConverter(GetFullMessage(e).c_str()), caption, MB_OK|MB_ICONEXCLAMATION); }
void ShowError(const Error &error, const TCHAR *caption) { ShowMessageBox(UTF8ToWideConverter(error.GetMessage()), caption, MB_OK|MB_ICONEXCLAMATION); }
void MessageOperationEnvironment::SetErrorMessage(const TCHAR *text) { ShowMessageBox(text, _T(""), MB_OK|MB_ICONERROR); }
void ExternalLogger::DownloadFlightFrom(DeviceDescriptor &device) { MessageOperationEnvironment env; // Download the list of flights that the logger contains RecordedFlightList flight_list; switch (DoReadFlightList(device, flight_list)) { case TriStateJobResult::SUCCESS: break; case TriStateJobResult::ERROR: device.EnableNMEA(env); ShowMessageBox(_("Failed to download flight list."), _("Download flight"), MB_OK | MB_ICONERROR); return; case TriStateJobResult::CANCELLED: return; } // The logger seems to be empty -> cancel if (flight_list.empty()) { device.EnableNMEA(env); ShowMessageBox(_("Logger is empty."), _("Download flight"), MB_OK | MB_ICONINFORMATION); return; } while (true) { // Show list of the flights const RecordedFlightInfo *flight = ShowFlightList(flight_list); if (!flight) break; // Download chosen IGC file into temporary file TCHAR path[MAX_PATH]; LocalPath(path, _T("logs"), _T("temp.igc")); switch (DoDownloadFlight(device, *flight, path)) { case TriStateJobResult::SUCCESS: break; case TriStateJobResult::ERROR: // Delete temporary file File::Delete(path); ShowMessageBox(_("Failed to download flight."), _("Download flight"), MB_OK | MB_ICONERROR); continue; case TriStateJobResult::CANCELLED: // Delete temporary file File::Delete(path); continue; } /* read the IGC header and build the final IGC file name with it */ IGCHeader header; BrokenDate date; ReadIGCMetaData(path, header, date); if (header.flight == 0) header.flight = GetFlightNumber(flight_list, *flight); TCHAR name[64]; FormatIGCFilenameLong(name, date, header.manufacturer, header.id, header.flight); TCHAR final_path[MAX_PATH]; LocalPath(final_path, _T("logs"), name); // Remove a file with the same name if it exists if (File::Exists(final_path)) File::Delete(final_path); // Rename the temporary file to the actual filename File::Rename(path, final_path); if (ShowMessageBox(_("Do you want to download another flight?"), _("Download flight"), MB_YESNO | MB_ICONQUESTION) != IDYES) break; } device.EnableNMEA(env); }
void CFMUnlockPatientList::OnExportSelect() { CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); UpdateData(true); CExcel xls; CRecord rs(&pMF->m_db); CRecord rss(&pMF->m_db); CString szSQL, tmpStr, szTemp; CString szClass; int nCol = 0, nRow = 0, nIdx = 0; double nAmount = 0; long double nTotal = 0; long double nGroupTotal = 0; m_nTotal = 0; szSQL = GetQueryString(); rs.ExecSQL(szSQL); szSQL = GetDepositString(); rss.ExecSQL(szSQL); if (rs.GetRecordCount() + rss.GetRecordCount() <= 0) { ShowMessageBox(_T("No Data"), MB_OK | MB_ICONERROR); return; } xls.CreateSheet(1); xls.SetWorksheet(0); xls.SetColumnWidth(0, 4); xls.SetColumnWidth(1, 25); xls.SetColumnWidth(2, 9); xls.SetColumnWidth(3, 8); xls.SetColumnWidth(4, 18); xls.SetColumnWidth(5, 15); xls.SetRowHeight(4, 40); //Header xls.SetCellMergedColumns(nCol, nRow, 3); xls.SetCellMergedColumns(nCol, nRow + 1, 3); xls.SetCellMergedColumns(nCol + 3, nRow, 4); xls.SetCellMergedColumns(nCol + 3, nRow + 1, 4); xls.SetCellMergedColumns(nCol, nRow + 2, 6); xls.SetCellMergedColumns(nCol, nRow + 3, 6); xls.SetCellText(nCol, nRow, pMF->m_CompanyInfo.sc_pname, FMT_TEXT | FMT_CENTER, true, 11); xls.SetCellText(nCol, nRow + 1, pMF->m_CompanyInfo.sc_name, FMT_TEXT | FMT_CENTER, true, 11); xls.SetCellText(nCol + 3, nRow, _T("\x43\x1ED8NG H\xD2\x41 \x58\xC3 H\x1ED8I \x43H\x1EE6 NGH\x128\x41 VI\x1EC6T N\x41M"), FMT_TEXT | FMT_CENTER, true); xls.SetCellText(nCol + 3, nRow + 1, _T("\x110\x1ED8\x43 L\x1EACP - T\x1EF0 \x44O - H\x1EA0NH PH\xDA\x43"), FMT_TEXT | FMT_CENTER, true); xls.SetCellText(nCol, nRow + 2, _T("\x42\x1EA2NG TH\x1ED0NG K\xCA \x44\x41NH S\xC1\x43H \x42\x1EC6NH NH\xC2N \x43H\x1AF\x41 KH\xD3\x41 S\x1ED4"), FMT_TEXT | FMT_CENTER, true, 11); tmpStr.Format(_T("T\x1EEB ng\xE0y %s \x111\x1EBFn ng\xE0y %s"), CDateTime::Convert(m_szFromDate, yyyymmdd | hhmm, ddmmyyyy | hhmm), CDateTime::Convert(m_szToDate, yyyymmdd | hhmm, ddmmyyyy | hhmm)); xls.SetCellText(nCol, nRow + 3, tmpStr, FMT_TEXT | FMT_CENTER, false, 11); //Column Header CStringArray arrCol; arrCol.Add(_T("STT")); arrCol.Add(_T("T\xEAn \x62\x1EC7nh nh\xE2n")); arrCol.Add(_T("S\x1ED1 h\x1ED3 s\x1A1")); arrCol.Add(_T("Kho\x61 / Ph\xF2ng kh\xE1m")); arrCol.Add(_T("Ng\x1B0\x1EDDi thu")); arrCol.Add(_T("S\x1ED1 ti\x1EC1n")); CString szGroup[] = {_T("I"), _T("II"), _T("III"), _T("IV")}; int nIndex = 0; nRow = 4; for (int i = 0; i < arrCol.GetCount(); i++) { xls.SetCellText(nCol + i, nRow, arrCol.GetAt(i), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, true, 10); } while (!rs.IsEOF()) { if (szClass != rs.GetValue(_T("fclass"))) { if (nGroupTotal > 0) { nRow++; TranslateString(_T("Total Amt"), tmpStr); tmpStr.AppendFormat(_T(" %s"), szGroup[nIndex++]); xls.SetCellMergedColumns(nCol, nRow, 5); xls.SetCellText(nCol, nRow, tmpStr, FMT_TEXT | FMT_CENTER, true, 11); tmpStr.Format(_T("%.2Lf"), nGroupTotal); xls.SetCellText(nCol + 5, nRow, tmpStr, FMT_NUMBER1 | FMT_WRAPING, true, 11); nTotal += nGroupTotal; nGroupTotal = 0; } nIdx = 1; rs.GetValue(_T("fclass"), szClass); if (szClass == _T("NO")) { nRow++; xls.SetCellMergedColumns(nCol, nRow, 6); xls.SetCellText(nCol, nRow, _T("\x43\xE1\x63 kho\x61 n\x1ED9i tr\xFA"), FMT_TEXT | FMT_CENTER, true, 11); } } nIdx++; nRow++; tmpStr.Format(_T("%d"), nIdx); xls.SetCellText(nCol, nRow, tmpStr, FMT_INTEGER | FMT_WRAPING); rs.GetValue(_T("pname"), tmpStr); xls.SetCellText(nCol + 1, nRow, tmpStr, FMT_TEXT | FMT_WRAPING); rs.GetValue(_T("docno"), tmpStr); xls.SetCellText(nCol + 2, nRow, tmpStr, FMT_INTEGER | FMT_WRAPING); rs.GetValue(_T("deptid"), tmpStr); xls.SetCellText(nCol + 3, nRow, tmpStr, FMT_TEXT | FMT_WRAPING); rs.GetValue(_T("staff"), tmpStr); xls.SetCellText(nCol + 4, nRow, tmpStr, FMT_TEXT | FMT_WRAPING); rs.GetValue(_T("amount"), nAmount); tmpStr.Format(_T("%.2f"), nAmount); nGroupTotal += nAmount; xls.SetCellText(nCol + 5, nRow, tmpStr, FMT_NUMBER1 | FMT_WRAPING); rs.MoveNext(); } if (nGroupTotal > 0) { nRow++; TranslateString(_T("Total Amt"), tmpStr); tmpStr.AppendFormat(_T(" %s"), szGroup[nIndex++]); xls.SetCellMergedColumns(nCol, nRow, 5); xls.SetCellText(nCol, nRow, tmpStr, FMT_TEXT | FMT_CENTER, true, 11); tmpStr.Format(_T("%.2Lf"), nGroupTotal); xls.SetCellText(nCol + 5, nRow, tmpStr, FMT_NUMBER1 | FMT_WRAPING, true, 11); nTotal += nGroupTotal; nGroupTotal = 0; } if (!rss.IsEOF()) { nRow++; xls.SetCellMergedColumns(nCol, nRow, 6); xls.SetCellText(nCol, nRow, _T("Thu t\x1EA1m g\x1EEDi"), FMT_TEXT | FMT_CENTER, true, 11); nIdx = 1; while (!rss.IsEOF()) { nRow++; tmpStr.Format(_T("%d"), nIdx++); xls.SetCellText(nCol, nRow, tmpStr, FMT_INTEGER | FMT_WRAPING); rss.GetValue(_T("pname"), tmpStr); xls.SetCellText(nCol + 1, nRow, tmpStr, FMT_TEXT | FMT_WRAPING); rss.GetValue(_T("docno"), tmpStr); xls.SetCellText(nCol + 2, nRow, tmpStr, FMT_INTEGER | FMT_WRAPING); rss.GetValue(_T("deptid"), tmpStr); xls.SetCellText(nCol + 3, nRow, tmpStr, FMT_TEXT | FMT_WRAPING); rss.GetValue(_T("staff"), tmpStr); xls.SetCellText(nCol + 4, nRow, tmpStr, FMT_TEXT | FMT_WRAPING); rss.GetValue(_T("amount"), nAmount); nGroupTotal += nAmount; tmpStr.Format(_T("%.2f"), nAmount); xls.SetCellText(nCol + 5, nRow, tmpStr, FMT_NUMBER1 | FMT_WRAPING); rss.MoveNext(); } } if (nGroupTotal > 0) { nRow++; TranslateString(_T("Total Amt"), tmpStr); tmpStr.AppendFormat(_T(" %s"), szGroup[nIndex++]); xls.SetCellMergedColumns(nCol, nRow, 5); xls.SetCellText(nCol, nRow, tmpStr, FMT_TEXT | FMT_CENTER, true, 11); tmpStr.Format(_T("%.2Lf"), nGroupTotal); xls.SetCellText(nCol + 5, nRow, tmpStr, FMT_NUMBER1 | FMT_WRAPING, true, 11); nTotal += nGroupTotal; nGroupTotal = 0; } if (nTotal > 0) { nRow++; xls.SetCellMergedColumns(nCol, nRow, 5); xls.SetCellText(nCol, nRow, _T("T\x1ED5ng ti\x1EC1n"), FMT_TEXT | FMT_CENTER, true, 11); tmpStr.Format(_T("%.2Lf"), nTotal); xls.SetCellText(nCol + 5, nRow, tmpStr, FMT_NUMBER1 | FMT_WRAPING, true, 11); } xls.Save(_T("Exports\\DanhSachBNChuaKhoaSo.xls")); }
//连接服务器 void CPlazaViewItem::OnCommandConnect() { //创建组件 if (m_ClientSocket.GetInterface()==NULL) { try { IUnknownEx * pIUnknownEx=(IUnknownEx *)QueryInterface(IID_IUnknownEx,VER_IUnknownEx); if (m_ClientSocket.CreateInstance()==false) { throw TEXT("网络组件创建失败"); } if (m_ClientSocket->SetSocketSink(pIUnknownEx)==false) { throw TEXT("网络组件回调接口设置失败"); } } catch (...) { ShowMessageBox(TEXT("网络组件创建失败,请重新下载游戏大厅!"),MB_ICONSTOP); PostMessage(WM_COMMAND,IDM_LOGON_PLAZA,0); return; } } //地址解释 CRegKey RegServer; LPCTSTR pszServerIP=m_DlgLogon.GetLogonServer(); TCHAR szRegServer[256]=TEXT(""),szServerAddr[64]=TEXT(""); _snprintf(szRegServer,sizeof(szRegServer),TEXT("%s\\%s"),REG_LOGON_SERVER,pszServerIP); if (RegServer.Open(HKEY_CURRENT_USER,szRegServer,KEY_READ)==ERROR_SUCCESS) { TCHAR szReadData[1024]=TEXT(""); DWORD dwReadData=0L,dwDataType=0L,dwDataSize=sizeof(szReadData); LONG lErrorCode=RegServer.QueryValue(TEXT("ServerAddr"),&dwDataType,szReadData,&dwDataSize); if (lErrorCode==ERROR_SUCCESS) { CXOREncrypt::CrevasseData(szReadData,szServerAddr,sizeof(szServerAddr)); pszServerIP=szServerAddr; } } //连接服务器 try { //设置代理 m_ClientSocket->SetProxyServer(m_DlgLogon.m_ProxyInfo); //连接服务器 m_ClientSocket->CloseSocket(false); if (m_ClientSocket->Connect(pszServerIP,PORT_LOGON_SERVER)==false) { throw TEXT("服务器连接错误,可能是你的系统还没有成功连接上网络!"); } } catch (LPCTSTR pszError) { ShowMessageBox(pszError,MB_ICONINFORMATION); SendLogonMessage(); return; } //显示提示框 CString strMessage=TEXT("正在连接服务器,请稍候..."); g_GlobalAttemper.ShowStatusMessage(strMessage,this); return; }
Geometry::Geometry(LPDIRECT3DDEVICE9 d3ddev, const std::string& filename, LPD3DXEFFECT shader) : m_shape(NONE), m_mesh(nullptr), m_shader(shader), m_texture(nullptr) { // Create a assimp mesh std::string errorBuffer; Assimpmesh mesh; if(!mesh.Initialise(filename, errorBuffer)) { ShowMessageBox(errorBuffer); } std::vector<unsigned long> indexData; std::vector<MeshVertex> vertexData; const std::vector<Assimpmesh::SubMesh>& subMeshes = mesh.GetMeshes(); for(unsigned int i = 0; i < subMeshes.size(); ++i) { // Fill in vertex data for(unsigned int j = 0; j < subMeshes[i].vertices.size(); ++j) { MeshVertex v; v.normal.x = subMeshes[i].vertices[j].nx; v.normal.y = subMeshes[i].vertices[j].ny; v.normal.z = subMeshes[i].vertices[j].nz; v.position.x = subMeshes[i].vertices[j].x; v.position.y = subMeshes[i].vertices[j].y; v.position.z = subMeshes[i].vertices[j].z; v.uvs.x = subMeshes[i].vertices[j].u; v.uvs.y = subMeshes[i].vertices[j].v; vertexData.push_back(v); } for(unsigned int j = 0; j < subMeshes[i].indices.size(); ++j) { indexData.push_back(subMeshes[i].indices[j]); } } // Mesh Vertex Declaration D3DVERTEXELEMENT9 VertexDecl[] = { { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, { 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 }, { 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, D3DDECL_END() }; // Create the DirectX Mesh if(FAILED(D3DXCreateMesh(indexData.size()/3, vertexData.size(), D3DXMESH_MANAGED | D3DXMESH_32BIT, VertexDecl, d3ddev, &m_mesh))) { ShowMessageBox("Mesh " + filename + " creation failed"); } // Fill in the vertex buffer MeshVertex* vertexBuffer; if(FAILED(m_mesh->LockVertexBuffer(0, (void**)&vertexBuffer))) { ShowMessageBox(filename + " Vertex buffer lock failed"); } #pragma warning(disable: 4996) std::copy(vertexData.begin(), vertexData.end(), vertexBuffer); m_mesh->UnlockVertexBuffer(); // Fill in the index buffer DWORD* indexBuffer; if(FAILED(m_mesh->LockIndexBuffer(0, (void**)&indexBuffer))) { ShowMessageBox(filename + " Index buffer lock failed"); } #pragma warning(disable: 4996) std::copy(indexData.begin(), indexData.end(), indexBuffer); m_mesh->UnlockIndexBuffer(); CreateMeshData<MeshVertex, DWORD>(false); }
void CEMGeneralSoldierExamination::OnExportSelect() { CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); CRecord rs(&pMF->m_db); CString szSQL; CString tmpStr, szTemp; UpdateData(TRUE); BeginWaitCursor(); szSQL = GetQueryString(); rs.ExecSQL(szSQL); if (rs.IsEOF()) { ShowMessageBox(_T("No Data"), MB_ICONERROR | MB_OK); return; } CExcel xls; xls.CreateSheet(1); xls.SetWorksheet(0); xls.SetColumnWidth(0, 4); xls.SetColumnWidth(1, 23); xls.SetColumnWidth(2, 7); xls.SetColumnWidth(3, 10); xls.SetColumnWidth(4, 7); xls.SetColumnWidth(5, 10); xls.SetColumnWidth(6, 7); xls.SetColumnWidth(7, 10); xls.SetColumnWidth(8, 7); xls.SetColumnWidth(9, 10); xls.SetColumnWidth(10, 7); xls.SetColumnWidth(11, 10); xls.SetColumnWidth(12, 7); xls.SetColumnWidth(13, 10); int nRow = 1; int nCol = 0; xls.SetRowHeight(6, 20); xls.SetRowHeight(7, 36); xls.SetRowHeight(8, 36); xls.SetCellMergedColumns(0, 1, 4); xls.SetCellMergedColumns(0, 2, 4); xls.SetCellText(0, 1, pMF->m_CompanyInfo.sc_pname, FMT_TEXT | FMT_CENTER, true); xls.SetCellText(0, 2, pMF->m_CompanyInfo.sc_name, FMT_TEXT | FMT_CENTER, true); xls.SetCellMergedColumns(nCol, nRow + 3, 16); xls.SetCellMergedColumns(nCol, nRow + 4, 16); xls.SetCellText(nCol, nRow + 3, _T("T\xECnh h\xECnh kh\xE1m, \x63h\x1EEF\x61 \x62\x1EC7nh \x63\x1EE7\x61 qu\xE2n nh\xE2n th\x61m gi\x61 \x110\x1EC1 \xE1n th\xED \x111i\x1EC3m \x62\x1EA3o hi\x1EC3m y t\x1EBF qu\xE2n nh\xE2n"), FMT_TEXT | FMT_CENTER, true, 16, 0); tmpStr.Format(_T("T\x1EEB ng\xE0y %s \x111\x1EBFn ng\xE0y %s"), CDateTime::Convert(m_szFromDate, yyyymmdd | hhmm, ddmmyyyy | hhmm), CDateTime::Convert(m_szToDate, yyyymmdd | hhmm, ddmmyyyy | hhmm)); xls.SetCellText(nCol, nRow + 4, tmpStr, FMT_TEXT | FMT_CENTER, true, 12, 0); xls.SetCellMergedRows(nCol, nRow + 5, 3); xls.SetCellText(nCol, nRow + 5, _T("TT"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, true, 11); xls.SetCellMergedRows(nCol + 1, nRow + 5, 3); xls.SetCellText(nCol + 1, nRow + 5, _T("\x110\x1A1n v\x1ECB th\x61m gi\x61 \x110\x1EC1 \xE1n"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, true, 11); xls.SetCellMergedColumns(nCol + 2, nRow + 5, 6); xls.SetCellText(nCol + 2, nRow + 5, _T("K\x43\x42 ngo\x1EA1i tr\xFA"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, true, 11); xls.SetCellMergedColumns(nCol + 2, nRow + 6, 2); xls.SetCellText(nCol + 2, nRow + 6, _T("\x43hi ph\xED t\x1EEB NSQP"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 2, nRow + 7, _T("S\x1ED1 l\x1B0\x1EE3t"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 3, nRow + 7, _T("S\x1ED1 ti\x1EC1n (\x111\x1ED3ng)"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellMergedColumns(nCol + 4, nRow + 6, 2); xls.SetCellText(nCol + 4, nRow + 6, _T("\x43hi ph\xED t\x1EEB qu\x1EF9 \x42HYT"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 4, nRow + 7, _T("S\x1ED1 l\x1B0\x1EE3t"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 5, nRow + 7, _T("S\x1ED1 ti\x1EC1n (\x111\x1ED3ng)"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellMergedColumns(nCol + 6, nRow + 6, 2); xls.SetCellText(nCol + 6, nRow + 6, _T("\x43\x1ED9ng"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 6, nRow + 7, _T("S\x1ED1 l\x1B0\x1EE3t"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 7, nRow + 7, _T("S\x1ED1 ti\x1EC1n (\x111\x1ED3ng)"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellMergedColumns(nCol + 8, nRow + 5, 6); xls.SetCellText(nCol + 8, nRow + 5, _T("K\x43\x42 n\x1ED9i tr\xFA"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, true, 11); xls.SetCellMergedColumns(nCol + 8, nRow + 6, 2); xls.SetCellText(nCol + 8, nRow + 6, _T("\x43hi ph\xED t\x1EEB NSQP"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 8, nRow + 7, _T("S\x1ED1 l\x1B0\x1EE3t"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 9, nRow + 7, _T("S\x1ED1 ti\x1EC1n (\x111\x1ED3ng)"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellMergedColumns(nCol + 10, nRow + 6, 2); xls.SetCellText(nCol + 10, nRow + 6, _T("\x43hi ph\xED t\x1EEB qu\x1EF9 \x42HYT"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 10, nRow + 7, _T("S\x1ED1 l\x1B0\x1EE3t"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 11, nRow + 7, _T("S\x1ED1 ti\x1EC1n (\x111\x1ED3ng)"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellMergedColumns(nCol + 12, nRow + 6, 2); xls.SetCellText(nCol + 12, nRow + 6, _T("\x43\x1ED9ng"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 12, nRow + 7, _T("S\x1ED1 l\x1B0\x1EE3t"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 13, nRow + 7, _T("S\x1ED1 ti\x1EC1n (\x111\x1ED3ng)"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellMergedColumns(nCol + 14, nRow + 5, 2); xls.SetCellMergedRows(nCol + 14, nRow + 5, 2); xls.SetCellText(nCol + 14, nRow + 5, _T("T\x1ED5ng \x63\x1ED9ng"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 14, nRow + 7, _T("S\x1ED1 l\x1B0\x1EE3t"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); xls.SetCellText(nCol + 15, nRow + 7, _T("S\x1ED1 ti\x1EC1n (\x111\x1ED3ng)"), FMT_TEXT | FMT_CENTER | FMT_VCENTER | FMT_WRAPING, false, 11); int nIndex = 1; nRow = 8; while (!rs.IsEOF()) { nRow++; tmpStr.Format(_T("%d"), nIndex++); xls.SetCellText(nCol, nRow, tmpStr, FMT_INTEGER | FMT_WRAPING); rs.GetValue(_T("workplace"), tmpStr); xls.SetCellText(nCol + 1, nRow, tmpStr, FMT_TEXT | FMT_WRAPING); rs.GetValue(_T("ngt"), tmpStr); xls.SetCellText(nCol + 6, nRow, tmpStr, FMT_INTEGER | FMT_WRAPING); rs.GetValue(_T("nt"), tmpStr); xls.SetCellText(nCol + 12, nRow, tmpStr, FMT_INTEGER | FMT_WRAPING); rs.GetValue(_T("tong"), tmpStr); xls.SetCellText(nCol + 14, nRow, tmpStr, FMT_INTEGER | FMT_WRAPING); rs.MoveNext(); } EndWaitCursor(); xls.Save(_T("Exports\\THKCBQuanNhan.xls")); }