void CLog::LogString(int logLevel, std::string&& logString) { CSingleLock waitLock(g_logState.critSec); std::string strData(logString); StringUtils::TrimRight(strData); if (!strData.empty()) { if (g_logState.m_repeatLogLevel == logLevel && g_logState.m_repeatLine == strData) { g_logState.m_repeatCount++; return; } else if (g_logState.m_repeatCount) { std::string strData2 = StringUtils::Format("Previous line repeats %d times.", g_logState.m_repeatCount); PrintDebugString(strData2); WriteLogString(g_logState.m_repeatLogLevel, strData2); g_logState.m_repeatCount = 0; } g_logState.m_repeatLine = strData; g_logState.m_repeatLogLevel = logLevel; PrintDebugString(strData); WriteLogString(logLevel, strData); } }
/** * sendPackage - uses SendMessage(WM_COPYDATA) to do IPC messaging * with the Java AccessBridge DLL * * NOTE: WM_COPYDATA is only for one-way IPC; there * is now way to return parameters (especially big ones) * Use sendMemoryPackage() to do that! */ LRESULT AccessBridgeJavaVMInstance::sendPackage(char *buffer, long bufsize) { COPYDATASTRUCT toCopy; toCopy.dwData = 0; // 32-bits we could use for something... toCopy.cbData = bufsize; toCopy.lpData = buffer; PrintDebugString("In AccessBridgeVMInstance::sendPackage"); PrintDebugString(" javaAccessBridgeWindow: %p", javaAccessBridgeWindow); /* This was SendMessage. Normally that is a blocking call. However, if * SendMessage is sent to another process, e.g. another JVM and an incoming * SendMessage is pending, control will be passed to the DialogProc to handle * the incoming message. A bug occurred where this allowed an AB_DLL_GOING_AWAY * message to be processed deleting an AccessBridgeJavaVMInstance object in * the javaVMs chain. SendMessageTimeout with SMTO_BLOCK set will prevent the * calling thread from processing other requests while waiting, i.e control * will not be passed to the DialogProc. Also note that PostMessage or * SendNotifyMessage can't be used. Although they don't allow transfer to * the DialogProc they can't be used in cases where pointers are passed. This * is because the referenced memory needs to be available when the other thread * gets control. */ UINT flags = SMTO_BLOCK | SMTO_NOTIMEOUTIFNOTHUNG; DWORD_PTR out; // not used LRESULT lr = SendMessageTimeout( javaAccessBridgeWindow, WM_COPYDATA, (WPARAM)ourAccessBridgeWindow, (LPARAM)&toCopy, flags, 4000, &out ); return lr; }
void CSVBatchAdd::refresh() { char *szQuery = NULL; string szIn = "c:$d:$"; list<string> lsValue ; list<string>::iterator lsItem; //SV_Split::SplitString(lsValue, szIn, '$'); SV_Split::SplitString(lsValue, szIn, '$'); for(lsItem = lsValue.begin(); lsItem != lsValue.end(); lsItem ++) { PrintDebugString("Item's value:"); PrintDebugString((*lsItem).c_str()); } szQuery = getenv("QUERY_STRING"); if(m_pList) { while(m_pList->numRows() > 1) { m_pList->deleteRow(m_pList->numRows() - 1); } } if(szQuery) { m_nMonitorType = getMonitorType(szQuery); } }
/** * print a GetLastError message */ char *printError(char *msg) { LPVOID lpMsgBuf = NULL; static char retbuf[256]; if (msg != NULL) { strncpy((char *)retbuf, msg, sizeof(retbuf)); // if msg text is >= 256 ensure buffer is null terminated retbuf[255] = '\0'; } if (!FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &lpMsgBuf, 0, NULL )) { PrintDebugString(" %s: FormatMessage failed", msg); } else { PrintDebugString(" %s: %s", msg, (char *)lpMsgBuf); } if (lpMsgBuf != NULL) { strncat((char *)retbuf, ": ", sizeof(retbuf) - strlen(retbuf) - 1); strncat((char *)retbuf, (char *)lpMsgBuf, sizeof(retbuf) - strlen(retbuf) - 1); } return (char *)retbuf; }
/** * AccessBridgeATInstance descructor */ AccessBridgeATInstance::~AccessBridgeATInstance() { PrintDebugString("\r\nin AccessBridgeATInstance::~AccessBridgeATInstance"); // if IPC memory mapped file view is valid, unmap it if (memoryMappedView != (char *) 0) { PrintDebugString(" unmapping memoryMappedView; view = %p", memoryMappedView); UnmapViewOfFile(memoryMappedView); memoryMappedView = (char *) 0; } // if IPC memory mapped file handle map is open, close it if (memoryMappedFileMapHandle != (HANDLE) 0) { PrintDebugString(" closing memoryMappedFileMapHandle; handle = %p", memoryMappedFileMapHandle); CloseHandle(memoryMappedFileMapHandle); memoryMappedFileMapHandle = (HANDLE) 0; } }
void CSVReportSet::refresh() { //nullTable -> clear(); PrintDebugString("Begin refresh function\n"); UpdatePhoneList(); if(!GetUserRight("m_reportlistAdd")) m_pAdd->hide(); else m_pAdd->show(); if(!GetUserRight("m_reportlistDel")) m_pDel->hide(); else m_pDel->show(); //翻译 int bTrans = GetIniFileInt("translate", "translate", 0, "general.ini"); if(bTrans == 1) { pTranslateBtn->show(); pExChangeBtn->show(); } else { pTranslateBtn->hide(); pExChangeBtn->hide(); } }
NOMANGLE bool EXPORTED SetDebugOutputCallback(DebugOutputCallback* doCallback) { if(detail::pdoCallback!=nullptr) return false; detail::pdoCallback = doCallback; PrintDebugString("Output Initialized!", "SetDebugOutputCallback", "Post callback initialization.", "This message is printed when a callback is successfully set."); return true; }
void CMainForm::Translate() { PrintDebugString("-------Translate-------\n"); WebSession::js_af_up = "showTranslate('"; WebSession::js_af_up += "plansetRes"; WebSession::js_af_up += "')"; }
DWORD WINAPI SVDeviceTest::ThreadFunc(LPVOID lpParam) { PrintDebugString(((SVDeviceTest*)lpParam)->m_szQuery.c_str()); if(!((SVDeviceTest*)lpParam)->m_szQuery.empty()) { ((SVDeviceTest*)lpParam)->TestDevice(); } return 0; }
void WTreeNode::UpdateContentText() { if(labelText_) { string szMenu(makeMenuText()); PrintDebugString(szMenu.c_str()); sprintf(labelText_->contextmenu_, "class='treelink' onclick='%s' oncontextmenu='showPopMenu(\"%s\",\"%d\",\"%s\");' onmouseover='mouseover(this)' onmouseout='mouseout(this)'", m_szFocus.c_str(), strId.c_str(), nTreeType, szMenu.c_str()); } }
CSVReportSet::CSVReportSet(WContainerWidget * parent): WContainerWidget(parent) { IsShow = true; chgstr = ""; loadString(); initForm(); PrintDebugString("Init ReportSet Finish\n"); }
bool session_factory::verify_connection( boost::shared_ptr<monkey::net::connection> conn, boost::shared_ptr<google::protobuf::Message> message ) const { auto pLogin = boost::dynamic_pointer_cast<common::Login>(message); std::cout << "User Login:"******"1") { return true; } else { boost::shared_ptr<common::LoginReturn> p_login_return(new common::LoginReturn); p_login_return->set_login_successed(false); conn->send_protobuf(p_login_return); } } return false; }
/** * Sets up the memory-mapped file to do IPC messaging * 1 files is created: to handle requests for information * initiated from Windows AT. The package is placed into * the memory-mapped file (char *memoryMappedView), * and then a special SendMessage() is sent. When the * JavaDLL returns from SendMessage() processing, the * data will be in memoryMappedView. The SendMessage() * return value tells us if all is right with the world. * * The set-up proces involves creating the memory-mapped * file, and writing a special string to it so that the * WindowsDLL so it knows about it as well. */ LRESULT AccessBridgeATInstance::initiateIPC() { DWORD errorCode; PrintDebugString("\r\nIn AccessBridgeATInstance::initiateIPC()"); // open Windows-initiated IPC filemap & map it to a ptr memoryMappedFileMapHandle = OpenFileMapping(FILE_MAP_READ | FILE_MAP_WRITE, FALSE, memoryMappedFileName); if (memoryMappedFileMapHandle == NULL) { errorCode = GetLastError(); PrintDebugString(" Failed to CreateFileMapping for %s, error: %X", memoryMappedFileName, errorCode); return errorCode; } else { PrintDebugString(" CreateFileMapping worked - filename: %s", memoryMappedFileName); } memoryMappedView = (char *) MapViewOfFile(memoryMappedFileMapHandle, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0); if (memoryMappedView == NULL) { errorCode = GetLastError(); PrintDebugString(" Failed to MapViewOfFile for %s, error: %X", memoryMappedFileName, errorCode); return errorCode; } else { PrintDebugString(" MapViewOfFile worked - view: %p", memoryMappedView); } // look for the JavaDLL's answer to see if it could read the file if (strcmp(memoryMappedView, AB_MEMORY_MAPPED_FILE_OK_QUERY) != 0) { PrintDebugString(" JavaVM failed to write to memory mapped file %s", memoryMappedFileName); return -1; } else { PrintDebugString(" JavaVM successfully wrote to file!"); } // write some data to the memory mapped file for WindowsDLL to verify strcpy(memoryMappedView, AB_MEMORY_MAPPED_FILE_OK_ANSWER); return 0; }
/////////////////////////////////////////////////////////////////////////////// // Switches the current language HKL SwitchLayout() { HWND hwnd = RemoteGetFocus(); HKL currentLayout = GetCurrentLayout(); // Find the current keyboard layout's index UINT i; for(i = 0; i < g_keyboardInfo.count; i++) { if(g_keyboardInfo.hkls[i] == currentLayout) break; } UINT currentLanguageIndex = i; // Find the next active layout BOOL found = FALSE; UINT newLanguage = currentLanguageIndex; for(UINT i = 0; i < g_keyboardInfo.count; i++) { newLanguage = (newLanguage + 1) % g_keyboardInfo.count; if(g_keyboardInfo.inUse[newLanguage]) { found = TRUE; break; } } // Activate the selected language if(found) { g_keyboardInfo.current = newLanguage; PostMessage(hwnd, WM_INPUTLANGCHANGEREQUEST, 0, (LPARAM)(g_keyboardInfo.hkls[g_keyboardInfo.current])); #ifdef _DEBUG PrintDebugString("Language set to %S", g_keyboardInfo.names[g_keyboardInfo.current]); #endif return g_keyboardInfo.hkls[g_keyboardInfo.current]; } return NULL; }
string SVDeviceTest::GetSEID(const char *pszQuery) { string szSEID; char *pPos = strstr(pszQuery, "seid="); if(pPos) { char *chSEID = new char[strlen(pPos)]; if(chSEID) { sscanf(pPos, "seid= %[0-9]", chSEID); szSEID = chSEID; delete []chSEID; } } else { szSEID = "1"; PrintDebugString("not found seid"); } return szSEID; }
BOOL initializeAccessBridge() { #ifdef ACCESSBRIDGE_ARCH_32 // For 32bit AT new bridge theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE-32"); #else #ifdef ACCESSBRIDGE_ARCH_64 // For 64bit AT new bridge theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE-64"); #else // legacy theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE"); #endif #endif if (theAccessBridgeInstance != 0) { LOAD_FP(Windows_run, Windows_runFP, "Windows_run"); LOAD_FP(SetJavaShutdown, SetJavaShutdownFP, "setJavaShutdownFP"); LOAD_FP(SetFocusGained, SetFocusGainedFP, "setFocusGainedFP"); LOAD_FP(SetFocusLost, SetFocusLostFP, "setFocusLostFP"); LOAD_FP(SetCaretUpdate, SetCaretUpdateFP, "setCaretUpdateFP"); LOAD_FP(SetMouseClicked, SetMouseClickedFP, "setMouseClickedFP"); LOAD_FP(SetMouseEntered, SetMouseEnteredFP, "setMouseEnteredFP"); LOAD_FP(SetMouseExited, SetMouseExitedFP, "setMouseExitedFP"); LOAD_FP(SetMousePressed, SetMousePressedFP, "setMousePressedFP"); LOAD_FP(SetMouseReleased, SetMouseReleasedFP, "setMouseReleasedFP"); LOAD_FP(SetMenuCanceled, SetMenuCanceledFP, "setMenuCanceledFP"); LOAD_FP(SetMenuDeselected, SetMenuDeselectedFP, "setMenuDeselectedFP"); LOAD_FP(SetMenuSelected, SetMenuSelectedFP, "setMenuSelectedFP"); LOAD_FP(SetPopupMenuCanceled, SetPopupMenuCanceledFP, "setPopupMenuCanceledFP"); LOAD_FP(SetPopupMenuWillBecomeInvisible, SetPopupMenuWillBecomeInvisibleFP, "setPopupMenuWillBecomeInvisibleFP"); LOAD_FP(SetPopupMenuWillBecomeVisible, SetPopupMenuWillBecomeVisibleFP, "setPopupMenuWillBecomeVisibleFP"); LOAD_FP(SetPropertyNameChange, SetPropertyNameChangeFP, "setPropertyNameChangeFP"); LOAD_FP(SetPropertyDescriptionChange, SetPropertyDescriptionChangeFP, "setPropertyDescriptionChangeFP"); LOAD_FP(SetPropertyStateChange, SetPropertyStateChangeFP, "setPropertyStateChangeFP"); LOAD_FP(SetPropertyValueChange, SetPropertyValueChangeFP, "setPropertyValueChangeFP"); LOAD_FP(SetPropertySelectionChange, SetPropertySelectionChangeFP, "setPropertySelectionChangeFP"); LOAD_FP(SetPropertyTextChange, SetPropertyTextChangeFP, "setPropertyTextChangeFP"); LOAD_FP(SetPropertyCaretChange, SetPropertyCaretChangeFP, "setPropertyCaretChangeFP"); LOAD_FP(SetPropertyVisibleDataChange, SetPropertyVisibleDataChangeFP, "setPropertyVisibleDataChangeFP"); LOAD_FP(SetPropertyChildChange, SetPropertyChildChangeFP, "setPropertyChildChangeFP"); LOAD_FP(SetPropertyActiveDescendentChange, SetPropertyActiveDescendentChangeFP, "setPropertyActiveDescendentChangeFP"); LOAD_FP(SetPropertyTableModelChange, SetPropertyTableModelChangeFP, "setPropertyTableModelChangeFP"); LOAD_FP(ReleaseJavaObject, ReleaseJavaObjectFP, "releaseJavaObject"); LOAD_FP(GetVersionInfo, GetVersionInfoFP, "getVersionInfo"); LOAD_FP(IsJavaWindow, IsJavaWindowFP, "isJavaWindow"); LOAD_FP(IsSameObject, IsSameObjectFP, "isSameObject"); LOAD_FP(GetAccessibleContextFromHWND, GetAccessibleContextFromHWNDFP, "getAccessibleContextFromHWND"); LOAD_FP(getHWNDFromAccessibleContext, getHWNDFromAccessibleContextFP, "getHWNDFromAccessibleContext"); LOAD_FP(GetAccessibleContextAt, GetAccessibleContextAtFP, "getAccessibleContextAt"); LOAD_FP(GetAccessibleContextWithFocus, GetAccessibleContextWithFocusFP, "getAccessibleContextWithFocus"); LOAD_FP(GetAccessibleContextInfo, GetAccessibleContextInfoFP, "getAccessibleContextInfo"); LOAD_FP(GetAccessibleChildFromContext, GetAccessibleChildFromContextFP, "getAccessibleChildFromContext"); LOAD_FP(GetAccessibleParentFromContext, GetAccessibleParentFromContextFP, "getAccessibleParentFromContext"); /* begin AccessibleTable */ LOAD_FP(getAccessibleTableInfo, getAccessibleTableInfoFP, "getAccessibleTableInfo"); LOAD_FP(getAccessibleTableCellInfo, getAccessibleTableCellInfoFP, "getAccessibleTableCellInfo"); LOAD_FP(getAccessibleTableRowHeader, getAccessibleTableRowHeaderFP, "getAccessibleTableRowHeader"); LOAD_FP(getAccessibleTableColumnHeader, getAccessibleTableColumnHeaderFP, "getAccessibleTableColumnHeader"); LOAD_FP(getAccessibleTableRowDescription, getAccessibleTableRowDescriptionFP, "getAccessibleTableRowDescription"); LOAD_FP(getAccessibleTableColumnDescription, getAccessibleTableColumnDescriptionFP, "getAccessibleTableColumnDescription"); LOAD_FP(getAccessibleTableRowSelectionCount, getAccessibleTableRowSelectionCountFP, "getAccessibleTableRowSelectionCount"); LOAD_FP(isAccessibleTableRowSelected, isAccessibleTableRowSelectedFP, "isAccessibleTableRowSelected"); LOAD_FP(getAccessibleTableRowSelections, getAccessibleTableRowSelectionsFP, "getAccessibleTableRowSelections"); LOAD_FP(getAccessibleTableColumnSelectionCount, getAccessibleTableColumnSelectionCountFP, "getAccessibleTableColumnSelectionCount"); LOAD_FP(isAccessibleTableColumnSelected, isAccessibleTableColumnSelectedFP, "isAccessibleTableColumnSelected"); LOAD_FP(getAccessibleTableColumnSelections, getAccessibleTableColumnSelectionsFP, "getAccessibleTableColumnSelections"); LOAD_FP(getAccessibleTableRow, getAccessibleTableRowFP, "getAccessibleTableRow"); LOAD_FP(getAccessibleTableColumn, getAccessibleTableColumnFP, "getAccessibleTableColumn"); LOAD_FP(getAccessibleTableIndex, getAccessibleTableIndexFP, "getAccessibleTableIndex"); /* end AccessibleTable */ /* AccessibleRelationSet */ LOAD_FP(getAccessibleRelationSet, getAccessibleRelationSetFP, "getAccessibleRelationSet"); /* AccessibleHypertext */ LOAD_FP(getAccessibleHypertext, getAccessibleHypertextFP, "getAccessibleHypertext"); LOAD_FP(activateAccessibleHyperlink, activateAccessibleHyperlinkFP, "activateAccessibleHyperlink"); LOAD_FP(getAccessibleHyperlinkCount, getAccessibleHyperlinkCountFP, "getAccessibleHyperlinkCount"); LOAD_FP(getAccessibleHypertextExt, getAccessibleHypertextExtFP, "getAccessibleHypertextExt"); LOAD_FP(getAccessibleHypertextLinkIndex, getAccessibleHypertextLinkIndexFP, "getAccessibleHypertextLinkIndex"); LOAD_FP(getAccessibleHyperlink, getAccessibleHyperlinkFP, "getAccessibleHyperlink"); /* Accessible KeyBinding, Icon and Action */ LOAD_FP(getAccessibleKeyBindings, getAccessibleKeyBindingsFP, "getAccessibleKeyBindings"); LOAD_FP(getAccessibleIcons, getAccessibleIconsFP, "getAccessibleIcons"); LOAD_FP(getAccessibleActions, getAccessibleActionsFP, "getAccessibleActions"); LOAD_FP(doAccessibleActions, doAccessibleActionsFP, "doAccessibleActions"); /* AccessibleText */ LOAD_FP(GetAccessibleTextInfo, GetAccessibleTextInfoFP, "getAccessibleTextInfo"); LOAD_FP(GetAccessibleTextItems, GetAccessibleTextItemsFP, "getAccessibleTextItems"); LOAD_FP(GetAccessibleTextSelectionInfo, GetAccessibleTextSelectionInfoFP, "getAccessibleTextSelectionInfo"); LOAD_FP(GetAccessibleTextAttributes, GetAccessibleTextAttributesFP, "getAccessibleTextAttributes"); LOAD_FP(GetAccessibleTextRect, GetAccessibleTextRectFP, "getAccessibleTextRect"); LOAD_FP(GetAccessibleTextLineBounds, GetAccessibleTextLineBoundsFP, "getAccessibleTextLineBounds"); LOAD_FP(GetAccessibleTextRange, GetAccessibleTextRangeFP, "getAccessibleTextRange"); LOAD_FP(GetCurrentAccessibleValueFromContext, GetCurrentAccessibleValueFromContextFP, "getCurrentAccessibleValueFromContext"); LOAD_FP(GetMaximumAccessibleValueFromContext, GetMaximumAccessibleValueFromContextFP, "getMaximumAccessibleValueFromContext"); LOAD_FP(GetMinimumAccessibleValueFromContext, GetMinimumAccessibleValueFromContextFP, "getMinimumAccessibleValueFromContext"); LOAD_FP(AddAccessibleSelectionFromContext, AddAccessibleSelectionFromContextFP, "addAccessibleSelectionFromContext"); LOAD_FP(ClearAccessibleSelectionFromContext, ClearAccessibleSelectionFromContextFP, "clearAccessibleSelectionFromContext"); LOAD_FP(GetAccessibleSelectionFromContext, GetAccessibleSelectionFromContextFP, "getAccessibleSelectionFromContext"); LOAD_FP(GetAccessibleSelectionCountFromContext, GetAccessibleSelectionCountFromContextFP, "getAccessibleSelectionCountFromContext"); LOAD_FP(IsAccessibleChildSelectedFromContext, IsAccessibleChildSelectedFromContextFP, "isAccessibleChildSelectedFromContext"); LOAD_FP(RemoveAccessibleSelectionFromContext, RemoveAccessibleSelectionFromContextFP, "removeAccessibleSelectionFromContext"); LOAD_FP(SelectAllAccessibleSelectionFromContext, SelectAllAccessibleSelectionFromContextFP, "selectAllAccessibleSelectionFromContext"); LOAD_FP(setTextContents, setTextContentsFP, "setTextContents"); LOAD_FP(getParentWithRole, getParentWithRoleFP, "getParentWithRole"); LOAD_FP(getTopLevelObject, getTopLevelObjectFP, "getTopLevelObject"); LOAD_FP(getParentWithRoleElseRoot, getParentWithRoleElseRootFP, "getParentWithRoleElseRoot"); LOAD_FP(getObjectDepth, getObjectDepthFP, "getObjectDepth"); LOAD_FP(getActiveDescendent, getActiveDescendentFP, "getActiveDescendent"); // additional methods for Teton LOAD_FP(getVirtualAccessibleName, getVirtualAccessibleNameFP, "getVirtualAccessibleName"); LOAD_FP(requestFocus, requestFocusFP, "requestFocus"); LOAD_FP(selectTextRange, selectTextRangeFP, "selectTextRange"); LOAD_FP(getTextAttributesInRange, getTextAttributesInRangeFP, "getTextAttributesInRange"); LOAD_FP(getVisibleChildrenCount, getVisibleChildrenCountFP, "getVisibleChildrenCount"); LOAD_FP(getVisibleChildren, getVisibleChildrenFP, "getVisibleChildren"); LOAD_FP(setCaretPosition, setCaretPositionFP, "setCaretPosition"); LOAD_FP(getCaretLocation, getCaretLocationFP, "getCaretLocation"); LOAD_FP(getEventsWaiting, getEventsWaitingFP, "getEventsWaiting"); theAccessBridge.Windows_run(); theAccessBridgeInitializedFlag = TRUE; PrintDebugString("theAccessBridgeInitializedFlag = TRUE"); return TRUE; } else { return FALSE; } }
void CMainForm::ExChange() { PrintDebugString("-------ExChange-------\n"); WebSession::js_af_up="setTimeout(\"location.href ='/fcgi-bin/planset.exe?'\",1250); "; appSelf->quit(); }
void CSVReportSet::AddGroupOperate(WTable * pTable) { PrintDebugString("begin Init AddOperator function\n"); m_pGroupOperate = new WTable((WContainerWidget *)pTable->elementAt( 8, 0)); if ( m_pGroupOperate ) { WImage * pSelAll = new WImage("../icons/selall.gif", (WContainerWidget *)m_pGroupOperate->elementAt(0, 1)); if (pSelAll) { pSelAll->setStyleClass("imgbutton"); pSelAll->setToolTip(m_formText.szTipSelAll1); connect(pSelAll, SIGNAL(clicked()), this, SLOT(SelAll())); } WImage * pSelNone = new WImage("../icons/selnone.gif", (WContainerWidget *)m_pGroupOperate->elementAt(0, 2)); if (pSelAll) { pSelNone->setStyleClass("imgbutton"); pSelNone->setToolTip(m_formText.szTipSelNone); connect(pSelNone, SIGNAL(clicked()), this, SLOT(SelNone())); } WImage * pSelinvert = new WImage("../icons/selinvert.gif", (WContainerWidget *)m_pGroupOperate->elementAt(0, 3)); if (pSelinvert) { pSelinvert->setStyleClass("imgbutton"); pSelinvert->setToolTip(m_formText.szTipSelInv); connect(pSelinvert, SIGNAL(clicked()), this, SLOT(SelInvert())); } pDel = new WImage("../icons/del.gif", (WContainerWidget *)m_pGroupOperate->elementAt(0, 4)); if(!GetUserRight("m_reportlistDel")) pDel->hide(); else pDel->show(); if (pDel) { pDel->setStyleClass("imgbutton"); pDel->setToolTip(m_formText.szTipDel); connect(pDel , SIGNAL(clicked()),this, SLOT(BeforeDelPhone())); } pAdd = new WPushButton(m_formText.szAddPhoneBut, (WContainerWidget *)m_pGroupOperate->elementAt(0, 6)); pAdd->setStyleClass("wizardbutton"); if(!GetUserRight("m_reportlistAdd")) pAdd->hide(); else pAdd->show(); if (pAdd) { pAdd->setToolTip(m_formText.szTipAddNew); WObject::connect(pAdd, SIGNAL(clicked()),"showbar();", this, SLOT(AddPhone()) , WObject::ConnectionType::JAVASCRIPTDYNAMIC); } m_pGroupOperate->elementAt(0, 6)->resize(WLength(100,WLength::Percentage),WLength(100,WLength::Percentage)); m_pGroupOperate->elementAt(0, 6)->setContentAlignment(AlignRight); } PrintDebugString("Init AddOperator function\n"); //隐藏按钮 pHideBut = new WPushButton("hide button",this); if(pHideBut) { pHideBut->setToolTip("Hide Button"); connect(pHideBut,SIGNAL(clicked()),this,SLOT(DelPhone())); pHideBut->hide(); } PrintDebugString("Init AddOperator function finish\n"); }
void CSVReportSet::UpdatePhoneList() { /* int nNum =m_ptbPhone->numRows(); for(int i=1;i<nNum;i++) { m_ptbPhone->deleteRow(1); } */ PrintDebugString("Into UpdatePhoneList\n"); m_pReportListTable->GeDataTable()->clear(); m_pListReport.clear(); std::list<string> sectionlist; std::list<string>::iterator m_sItem; GetIniFileSections(sectionlist, "reportset.ini"); //if(sectionlist.size() == 0) //{ // WText * nText = new WText("[----------统计报告列表为空-----------]", (WContainerWidget*)m_pReportListTable->GeDataTable() -> elementAt(0, 0)); // nText ->decorationStyle().setForegroundColor(Wt::red); // //nullTable -> elementAt(0, 0) -> setContentAlignment(AlignTop | AlignCenter); //} int numRow = 1; for(m_sItem = sectionlist.begin(); m_sItem != sectionlist.end(); m_sItem++) { std::string section = *m_sItem; std::list<string> keylist; std::list<string>::iterator m_pItem; bool bRet = false; bRet = GetIniFileKeys(section,keylist, "reportset.ini" ); if(!bRet) { } m_pItem = keylist.begin(); std::string str = *m_pItem; std::string ret = "error"; REPORT_LIST list; m_pReportListTable->InitRow(numRow); // 是否选择 WCheckBox * pCheck = new WCheckBox("", (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow, 0)); m_pReportListTable->GeDataTable()->elementAt(numRow, 0)->setContentAlignment(AlignCenter); // 名称 std::string ReportName = GetIniFileString(section, "Title", ret, "reportset.ini"); std::string strlinkname; std::string hrefstr = RepHrefStr(ReportName); strlinkname ="<a href=/fcgi-bin/statsreportlist.exe?id="+hrefstr+">"+ReportName+"</a>"; OutputDebugString("----------------report link name include null----------------\n"); OutputDebugString(strlinkname.c_str()); OutputDebugString("\n"); if(strcmp(ReportName.c_str(), "error") == 0) { } WText *pName = new WText(strlinkname, (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow , 2)); m_pReportListTable->GeDataTable()->elementAt(numRow, 2)->setContentAlignment(AlignCenter); std::string ReportPeriod = GetIniFileString(section, "Period", ret, "reportset.ini"); if(strcmp(ReportPeriod.c_str(), "error") == 0) { } WText *pPeriod = new WText(ReportPeriod, (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow, 4)); m_pReportListTable->GeDataTable()->elementAt(numRow, 4)->setContentAlignment(AlignCenter); WImage *pEdit = new WImage("/Images/edit.gif", (WContainerWidget*)m_pReportListTable->GeDataTable()->elementAt(numRow ,6)); m_pReportListTable->GeDataTable()->elementAt(numRow, 6)->setContentAlignment(AlignCenter); if(!GetUserRight("m_reportlistEdit")) pEdit->hide(); else pEdit->show(); pEdit->decorationStyle().setCursor(WCssDecorationStyle::Pointer); connect(pEdit, SIGNAL(clicked()),"showbar();", &m_signalMapper, SLOT(map()), WObject::ConnectionType::JAVASCRIPTDYNAMIC); m_signalMapper.setMapping(pEdit, section); list.pSelect = pCheck; list.pName = pName; list.pPeriod = pPeriod; list.pEdit = pEdit; m_pListReport.push_back(list); numRow++; PrintDebugString("Into UpdatePhoneList loop\n"); } }
void CSVReportSet::ExChange() { PrintDebugString("------ExChangeEvent------\n"); emit ExChangeEvent(); }
void CSVReportSet::EditRow(const std::string str) { PrintDebugString("Begin EditRow\n"); chgstr = str; std::string ret = "error"; SAVE_REPORT_LIST report; report.szTitle = GetIniFileString(str, "Title", ret, "reportset.ini"); if(strcmp(report.szTitle.c_str(), "error") == 0) { report.szTitle = ""; } report.szDescript = GetIniFileString(str, "Descript", ret, "reportset.ini"); if(strcmp(report.szDescript.c_str(), "error") == 0) { report.szDescript = ""; } report.szPlan = GetIniFileString(str, "Plan", ret, "reportset.ini"); if(strcmp(report.szPlan.c_str(), "error") == 0) { } report.szPeriod = GetIniFileString(str, "Period", ret, "reportset.ini"); if(strcmp(report.szPeriod.c_str(), "error") == 0) { } report.szStatusresult = GetIniFileString(str, "StatusResult", ret, "reportset.ini"); if(strcmp(report.szStatusresult.c_str(), "error") == 0) { } report.szErrorresult = GetIniFileString(str, "ErrorResult", ret, "reportset.ini"); if(strcmp(report.szErrorresult.c_str(), "error") == 0) { } report.szGraphic = GetIniFileString(str, "Graphic", ret, "reportset.ini"); if(strcmp(report.szGraphic.c_str(), "error") == 0) { } report.szComboGraphic = GetIniFileString(str, "ComboGraphic", ret, "reportset.ini"); if(strcmp(report.szComboGraphic.c_str(), "error") == 0) { } report.szListData = GetIniFileString(str, "ListData", ret, "reportset.ini"); if(strcmp(report.szListData.c_str(), "error") == 0) { } report.szListNormal = GetIniFileString(str, "ListNormal", ret, "reportset.ini"); if(strcmp(report.szListNormal.c_str(), "error") == 0) { } report.szListError = GetIniFileString(str, "ListError", ret, "reportset.ini"); if(strcmp(report.szListError.c_str(), "error") == 0) { } report.szListDanger = GetIniFileString(str, "ListDanger", ret, "reportset.ini"); if(strcmp(report.szListDanger.c_str(), "error") == 0) { } report.szListAlert = GetIniFileString(str, "ListAlert", ret, "reportset.ini"); if(strcmp(report.szListAlert.c_str(), "error") == 0) { } report.szEmailSend = GetIniFileString(str, "EmailSend", ret, "reportset.ini"); if(strcmp(report.szEmailSend.c_str(), "error") == 0) { report.szEmailSend = ""; } report.szParameter = GetIniFileString(str, "Parameter", ret, "reportset.ini"); if(strcmp(report.szParameter.c_str(), "error") == 0) { } report.szDeny = GetIniFileString(str, "Deny", ret, "reportset.ini"); if(strcmp(report.szDeny.c_str(), "error") == 0) { } report.szGenerate = GetIniFileString(str, "Generate", ret, "reportset.ini"); if(strcmp(report.szGenerate.c_str(), "error") == 0) { } report.szClicketValue = GetIniFileString(str, "ClicketValue", ret, "reportset.ini"); if(strcmp(report.szClicketValue.c_str(), "error") == 0) { report.szClicketValue = ""; } report.szListClicket = GetIniFileString(str, "ListClicket", ret, "reportset.ini"); if(strcmp(report.szListClicket.c_str(), "error") == 0) { } report.szStartTime = GetIniFileString(str, "StartTime", ret, "reportset.ini"); if(strcmp(report.szStartTime.c_str(), "error") == 0) { report.szStartTime = ""; } report.szEndTime = GetIniFileString(str, "EndTime", ret, "reportset.ini"); if(strcmp(report.szEndTime.c_str(), "error") == 0) { report.szEndTime = ""; } report.nWeekEndIndex = GetIniFileInt(str,"WeekEndTime",0,"reportset.ini"); //Ticket #123 start -------苏合 report.szExcel = GetIniFileString(str, "GenExcel", ret, "reportset.ini"); if(strcmp(report.szExcel.c_str(), "error") == 0) { report.szExcel = ""; } //Ticket #123 end -------苏合 report.szGroupRight= GetIniFileString(str, "GroupRight", ret, "reportset.ini"); char abc[2000]; sprintf(abc,"\n%s-------%s\n",str.c_str(),report.szGroupRight.c_str()); OutputDebugString(abc); if(strcmp(report.szGroupRight.c_str(), "error") == 0) { } report.chgstr = str; emit EditPhone(report); }
void SVDeviceTest::TestDevice() { bool bRet = false; char szReturn [svBufferSize] = {0}; int nSize = sizeof(szReturn); int nQuerySize = static_cast<int>(m_szQuery.length()) + 2; char *pszQueryString = new char[nQuerySize]; if(pszQueryString) { OutputDebugString("-------------enter TestDevice()-----------------\n"); //PrintDebugString(m_szQuery.c_str()); memset(pszQueryString, 0 , nQuerySize); changeQueryString(m_szQuery.c_str(), pszQueryString); string szDll = "", szFunc = ""; GetDllAndFunc(m_szQuery.c_str(), szDll, szFunc); string szSEID(GetSEID(m_szQuery.c_str())); PrintDebugString("DLL name: " + szDll + "\tFunc name: " + szFunc); if(szSEID == "1") { szDll = GetSiteViewRootPath() + "\\fcgi-bin\\" + szDll; if(!szDll.empty() && !szFunc.empty()) { #ifdef WIN32 HINSTANCE hdll = LoadLibrary(szDll.c_str()); if (hdll) { DeviceTest* func = (DeviceTest*)::GetProcAddress(hdll, szFunc.c_str()); if (func) { bRet = (*func)(pszQueryString, szReturn, nSize); } //Jansion.zhou 2007-01-07 //int nRow = m_pSubContent->numRows(); //new WText(m_szTestSucc, m_pSubContent->elementAt(nRow, 0)); FreeLibrary(hdll); } #else #endif } } else { PrintDebugString("Test Device by SiteView ECC Slave"); string szMsg = "dll is " + szDll + " func is " + szFunc + " query stirng is "; szMsg += pszQueryString; PrintDebugString(szMsg); bRet = ReadWriteDynQueue(szSEID, szDll, szFunc, pszQueryString, nQuerySize, szReturn, nSize); } delete []pszQueryString; } if(bRet) { PrintReturn(szReturn); int nRow = m_pSubContent->numRows(); OutputDebugString("\n----------TestDevice-----------\n"); } else { int nRow = m_pSubContent->numRows(); } }