本文整理汇总了C++中CCANMonitorApp类的典型用法代码示例。如果您正苦于以下问题:C++ CCANMonitorApp类的具体用法?C++ CCANMonitorApp怎么用?C++ CCANMonitorApp使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CCANMonitorApp类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitInstance
BOOL CCANMonitorApp::InitInstance()
{
// Begin of Multiple Language support
if ( CMultiLanguage::m_nLocales <= 0 ) // Not detected yet
{
CMultiLanguage::DetectLangID(); // Detect language as user locale
CMultiLanguage::DetectUILanguage(); // Detect language in MUI OS
}
TCHAR szModuleFileName[MAX_PATH]; // Get Module File Name and path
int ret = ::GetModuleFileName(theApp.m_hInstance, szModuleFileName, MAX_PATH);
if ( ret == 0 || ret == MAX_PATH )
{
ASSERT(false);
}
// Load resource-only language DLL. It will use the languages
// detected above, take first available language,
// or you can specify another language as second parameter to
// LoadLangResourceDLL. And try that first.
ghLangInst = CMultiLanguage::LoadLangResourceDLL( szModuleFileName );
if (ghLangInst)
{
AfxSetResourceHandle( ghLangInst );
}
// End of Multiple Language support
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
//InitCommonControls();
// START CHANGES MADE FOR AUTOMATION
CWinAppEx::InitInstance();
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(_("Fail to Intilaize OLE"));
return FALSE;
}
//CoInitializeEx(nullptr, COINIT_MULTITHREADED );
CBusmasterDump dump("BUSMASTER");
// END CHANGES MADE FOR AUTOMATION
// Enable OLE/ActiveX objects support
AfxEnableControlContainer();
InitContextMenuManager();
InitKeyboardManager();
InitTooltipManager();
CMFCToolTipInfo ttParams;
ttParams.m_bVislManagerTheme = TRUE;
theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,
RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need. DEBUG
//#ifdef _AFXDLL
// Enable3dControls(); // Call this when using MFC in a shared DLL
//#else
// Enable3dControlsStatic(); // Call this when linking to MFC statically
//#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey("RBEI-ETAS\\BUSMASTER_v3.1.0");
// START CHANGES MADE FOR AUTOMATION
COleTemplateServer::RegisterAll();
// END CHANGES MADE FOR AUTOMATION
//LoadStdProfileSettings(0); // Load standard INI file options (including MRU)
// Enable drag/drop open
// Enable DDE Execute open
//EnableShellOpen();
//RegisterShellFileTypes(TRUE);
// Display splash screen
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
short shRegServer = -1;
short shUnRegServer = -1;
if (__argc > 1)
{
shRegServer = (short) strcmpi(__targv[1],"/regserver");
shUnRegServer = (short) strcmpi(__targv[1],"/unregserver");
}
// Don't display a new MDI child window during startup
if (cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew
|| cmdInfo.m_nShellCommand == CCommandLineInfo::FileOpen)
{
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
}
// START CHANGES MADE FOR AUTOMATION
if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
{
m_bFromAutomation = TRUE;
// return TRUE;
}
//.........这里部分代码省略.........
示例2: vInitFilterDataList
/*******************************************************************************
Function Name : vInitFilterDataList
Input(s) : -
Output : -
Functionality : To initialise message filter list data
Member of : CMsgFilterConfigPage
Author(s) : Raja N
Date Created : 8.7.2005
Modifications :
*******************************************************************************/
VOID CMsgFilterConfigPage::vInitFilterDataList()
{
#if 0
// Get the data from config module and update local list
CModuleFilterArray* psData = &m_omFilterList;
// Update Filter List
theApp.bGetData( MSG_DISPLAY_FILTER_DETAILS, (void** )&psData );
#endif
}
示例3: OnCreateClient
BOOL CMsgSignalDBWnd::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
// Set Icon for DB Window
SetIcon( theApp.LoadIcon( IDI_ICO_DB_EDITOR ), TRUE );
// Create Static Splitter Window with 1 ROW and 2 COLUMNS
m_bSplitWndCreated =
m_omSplitterWnd.CreateStatic( this, // Parent Frame Window
SPLT_ONE_ROWS, // #Rows
SPLT_ONE_COLS, // #Columns
WS_CHILD |
WS_VISIBLE |
WS_BORDER, // Window Style
AFX_IDW_PANE_FIRST); // Splitter NOT Nested
// Get size of Frame wnd
CSize om_Size(0,0);
vCalculateSplitterPosition(om_Size);
if ( TRUE == m_bSplitWndCreated )
{
// Create the Right Pane for static splitter window
CMsgSgDetView::sm_sDbParams = m_sDbParams;
m_bSplitWndCreated =
m_omSplitterWnd.CreateView( FIRST_ROW, // #Row
SECOND_COL, // #Column
RUNTIME_CLASS(CMsgSgDetView), // View associated with
om_Size, // Sizeof Pane
pContext);
}
if ( TRUE == m_bSplitWndCreated )
{
// Create the Left Pane for static splitter window
CMsgSgTreeView::sm_sDbParams = m_sDbParams;
m_bSplitWndCreated =
m_omSplitterWnd.CreateView( FIRST_ROW, // #Row
FIRST_COL, // #Column
RUNTIME_CLASS(CMsgSgTreeView), // View associated with
om_Size, //CSize( 350,100 ), // Sizeof Pane
pContext);
}
CString omTitle = _T("DatabaseEditor - ");
omTitle += m_sDbParams.m_omBusName;
SetWindowText(omTitle.GetBuffer(MAX_PATH));
if (m_sDbParams.m_eBus == J1939)
{
CMsgSignalDBWnd::sm_bValidJ1939Wnd = TRUE;
}
return m_bSplitWndCreated;
}
示例4: vGetWinStatus
/*******************************************************************************
Function Name : vGetWinStatus
Input(s) : -
Output : -
Functionality : This function will update window postion from configuration
module. This function will use m_eWindowIdentity member to
denote window type.
Member of : CMDIChildBase
Author(s) : Raja N
Date Created : 18.4.2005
Modifications :
*******************************************************************************/
void CMDIChildBase::vGetWinStatus()
{
#if 0
// Create pointer to member so that configuraiton module will fill data
WINDOWPLACEMENT * pDetails = &m_sWindowPlacement;
// Get data from the configuration module
theApp.bGetData(m_eWindowIdentity, (void**)&pDetails);
// Add this flag as this is required to restore minimised window postion
// also. Refer WINDOWPLACEMENT Structure help from MSDN
m_sWindowPlacement.flags |= WPF_SETMINPOSITION;
// Check for initial condition
if( m_sWindowPlacement.rcNormalPosition.bottom == -1 ||
m_sWindowPlacement.rcNormalPosition.top == -1 ||
m_sWindowPlacement.rcNormalPosition.left == -1 ||
m_sWindowPlacement.rcNormalPosition.right == -1 )
{
// Get Propotionate Initial value from Config Module
theApp.bGetDefaultValue( m_eWindowIdentity, m_sWindowPlacement );
// Update Config Module to update Window position value
theApp.bSetData( m_eWindowIdentity, (void*)&m_sWindowPlacement);
}
#endif
}
示例5: vGetWinStatus
/******************************************************************************
Function Name : vGetWinStatus
Input(s) : sWinCurrStatus - A reference to (system defined)
WINDOWPLACEMENT structure to contain previous display
status of this window to be retrieved from the registry
Output : -
Functionality : This function is called to get the display status of window
stored
Member of : CMessageInterpretation
Friend of : -
Author(s) : Raja N
Date Created : 05.04.2004
Modifications : Raja N on 18.04.2005, Modified to refer new window placement
identity - CRH0030
******************************************************************************/
void CMessageInterpretation::vGetWinStatus()
{
#if 0
// Get window postion details from the configuration file
WINDOWPLACEMENT* pDetails = &m_sWinCurrStatus;
// Get data from the configuration module
theApp.bGetData(MSGINTERP_WND_PLACEMENT, (void**)&pDetails);
// Add this flag as this is required to restore minimised window postion
// also. Refer WINDOWPLACEMENT Structure help from MSDN
m_sWinCurrStatus.flags |= WPF_SETMINPOSITION;
// Check for initial condition
if( m_sWinCurrStatus.rcNormalPosition.bottom == -1 ||
m_sWinCurrStatus.rcNormalPosition.top == -1 ||
m_sWinCurrStatus.rcNormalPosition.left == -1 ||
m_sWinCurrStatus.rcNormalPosition.right == -1 )
{
// Get Propotionate Initial value from Config Module
theApp.bGetDefaultValue( MSGINTERP_WND_PLACEMENT, m_sWinCurrStatus );
// Update Config Module to update Window position value
theApp.bSetData( MSGINTERP_WND_PLACEMENT, (void*)&m_sWinCurrStatus);
}
#endif
}
示例6: OnCreateClient
BOOL CNotificWnd::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
//Creation of the listbox window
CRect omRect;
this->GetClientRect(omRect);
m_omListBox.Create(WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL
|LBS_HASSTRINGS |LBS_NOTIFY | LBS_WANTKEYBOARDINPUT |
LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL,
omRect, this, IDC_LSTB_OUTPUT);
// Set the window icon
SetIcon(theApp.LoadIcon(IDI_ICO_WRITE), TRUE);
m_unTimer = SetTimer(0x50, 100, NULL);
return CMDIChildBase::OnCreateClient(lpcs, pContext);
}
示例7: OnClose
void CMsgSignalDBWnd::OnClose()
{
// Get active frame
CMainFrame* pFrame =
static_cast<CMainFrame*> (AfxGetApp()->m_pMainWnd);
if (pFrame != NULL)
{
// Get appropriate data structure
CMsgSignal** ppTempMsgSg = NULL;
ppTempMsgSg = (CMsgSignal**)(m_sDbParams.m_ppvActiveDB);
//CMsgSgDetView* podMsgSg =
pFrame->podGetMsgSgDetView(m_sDbParams.m_eBus);
if ((*ppTempMsgSg)->bGetModifiedFlag() == FALSE)
{
UINT bRetVal = AfxMessageBox(ASK_SAVE_PROMPT,
MB_YESNO|MB_ICONQUESTION);
if ( bRetVal == IDYES )
{
(*ppTempMsgSg)->
bWriteIntoDatabaseFileFromDataStructure(
m_sDbParams.m_omDBPath );
if ((*ppTempMsgSg)->bGetDBAcitveFlagStatus() == TRUE)
{
pFrame->vPostMsgToSendMsgDlg(m_sDbParams.m_eBus);
}
// Check if the modified file is being loaded or not.
//If yes then prompt the user whether he wants to
//import it or not.
CStringArray omImportedDBNames;
CMsgSignal** m_ppsMSTemp = (CMsgSignal**)(m_sDbParams.m_ppvImportedDBs);
if ((*m_ppsMSTemp) != NULL)
{
(*m_ppsMSTemp)->vGetDataBaseNames(&omImportedDBNames);
for (INT nDBCount = 0; nDBCount < omImportedDBNames.GetSize();
nDBCount++)
{
if (m_sDbParams.m_omDBPath ==
omImportedDBNames.GetAt(nDBCount))
{
CString omText;
omText.Format( _T("File \"%s\" has been modified which is currently being loaded.\nDo you want to re-import it to reflect the changes?"),
m_sDbParams.m_omDBPath);
if (MessageBox(omText, "", MB_ICONQUESTION | MB_YESNO) == IDYES)
{
switch (m_sDbParams.m_eBus)
{
case CAN:
{
pFrame->dLoadDataBaseFile(m_sDbParams.m_omDBPath, FALSE);
}
break;
case J1939:
{
pFrame->dLoadJ1939DBFile(m_sDbParams.m_omDBPath, FALSE);
}
break;
};
}
}
}
}
//Checking ends
// Set the modified flag as saved
if (NULL != (*ppTempMsgSg))
{
(*ppTempMsgSg)->vSetModifiedFlag(TRUE);
}
}
else if( bRetVal == IDNO )
{
// if this is new database
// then delete the memory and the file itself
if ( pFrame->vGetNewDatabaseFlag())
{
// This file is no longer required
CFile::Remove( m_sDbParams.m_omDBPath );
pFrame->vSetNewDatabaseFlag(FALSE);
}
}
}
else
{
// If the user just creates new database,
// and closes the window
// delete the file
if ( pFrame->vGetNewDatabaseFlag() )
{
// This file is no longer required
CFile::Remove( m_sDbParams.m_omDBPath );
//.........这里部分代码省略.........
示例8: vSetFlagStatus
VOID CFlags::vSetFlagStatus(eCANMONITORFLAG eWhichFlag, INT nValue)
{
m_omCriticalSec.Lock();
switch( eWhichFlag )
{
case LOGTODISPLAY:
m_bLogToWindow = nValue;
break;
case LOGTOFILE:
{
if (m_bLogEnable != nValue)
{
theApp.vSetConfigurationModified();
}
m_bLogEnable = nValue ;
}
break;
case LOGTOFILE_LIN:
{
if (m_bLogEnable != nValue)
{
theApp.vSetConfigurationModified();
}
m_bLogEnable = nValue ;
}
break;
case REPLAYMODE:
m_wReplayMode = (WORD)nValue ;
break;
case REPLAYFILESELECTED:
m_bReplayFileSelected = nValue;
break;
case LOGFILTER:
if ( m_bLogFilterOn != nValue )
{
theApp.vSetConfigurationModified();
}
m_bLogFilterOn = nValue ;
break;
case LOGFILTER_LIN:
if ( m_bLogFilterOnLIN != nValue )
{
theApp.vSetConfigurationModified();
}
m_bLogFilterOnLIN = nValue ;
break;
case DISPLAYFILTERON :
if ( m_bDisplayFilterOn != nValue)
{
theApp.vSetConfigurationModified();
}
m_bDisplayFilterOn = nValue;
break;
case DISPLAYFILTERONLIN :
if ( m_bDisplayFilterOnLin != nValue)
{
theApp.vSetConfigurationModified();
}
m_bDisplayFilterOnLin = nValue;
break;
case TRANSLATIONMODE :
if ( m_bTranslationMode != nValue)
{
theApp.vSetConfigurationModified();
}
m_bTranslationMode = nValue;
break;
case FILTERUNDEFINEDMSGS :
m_bFilterUndefinedMsgs = nValue;
break;
case RXMSG :
m_bRxMsg = nValue;
break;
case SELECTDATABASEFILE :
m_bSelectDatabaseFile = nValue ;
break;
case DLLLOADED :
m_bDllLoaded = nValue;
break;
case TIMERBUTTON :
m_bTimerButtonOn = nValue;
break;
case MSGHANDLERBUTTON :
m_bMsgHandlerOn = nValue;
break;
case FUNCEDITOR :
m_bFunctionEditorOn = nValue;
break;
case FILTERTXMSGS :
m_bFilterTxMsg = nValue;
break;
case DBOPEN :
m_bDbOpen = nValue;
break;
//.........这里部分代码省略.........
示例9: OnBnClickedCbtnDissociate
/******************************************************************************
Function Name : OnBnClickedCbtnDissociate
Input(s) :
Output :
Functionality : Call the functions to remove the selected Databases
Member of : CDatabaseDissociateDlg
Friend of : -
Author(s) : Anish Kumar
Date Created : 06.12.2006
Modifications :
******************************************************************************/
void CDatabaseDissociateDlg::OnBnClickedCbtnDissociate()
{
//TO store the path of files dissociated
CStringArray aomStrFilesDissociated;
CMainFrame* pMainFrame = static_cast<CMainFrame*> (theApp.m_pMainWnd);
// Get the indexes of all the selected items.
int nCount = m_omDissociateDbLst.GetSelCount();
if ( nullptr == pMainFrame )
{
return;
}
if(nCount > 0)
{
// Array of selected item's position
CArray<int,int> aomListBoxSel;
aomListBoxSel.SetSize(nCount);
//Pass the array pointer to get the selected item's positions
m_omDissociateDbLst.GetSelItems(nCount, aomListBoxSel.GetData());
aomStrFilesDissociated.RemoveAll();
for(int nTempCnt = 0 ; nTempCnt < nCount ; nTempCnt++)
{
BOOL bDBDeleted = FALSE;
CString omstrDBPath ;
//Selected file's index
int nSelectedPos = aomListBoxSel.GetAt(nTempCnt);
//Find the length of string to pass the buffer to have the selected File path
int nBufferSize = m_omDissociateDbLst.GetTextLen(nSelectedPos);
m_omDissociateDbLst.GetText(nSelectedPos,omstrDBPath.GetBuffer(nBufferSize));
bDBDeleted = (*(CMsgSignal**)(m_sDbParams.m_ppvImportedDBs))->bDeAllocateMemory(omstrDBPath.GetBuffer(0));
if(TRUE == bDBDeleted)
{
aomStrFilesDissociated.Add(omstrDBPath.GetBuffer(0));
}
}
//To remove from theApp class
CStringArray aomstrDBFiles;
(*(CMsgSignal**)(m_sDbParams.m_ppvImportedDBs))->vGetDataBaseNames(&aomstrDBFiles);
//Delete the file path from the List box
int nTotalCount = aomStrFilesDissociated.GetSize();
CString omStrTempFile;
for(int nCount=0 ; nCount<nTotalCount ; nCount++)
{
omStrTempFile = aomStrFilesDissociated.GetAt(nCount);
int nIndex = 0;
if( (nIndex = m_omDissociateDbLst.FindString(0,
omStrTempFile)) != LB_ERR )
{
//Delete the file path from the list box
m_omDissociateDbLst.DeleteString(nIndex);
int nStoredFile = aomstrDBFiles.GetSize();
CString omStrTemp;
BOOL bRemoved = FALSE;
for(int nTemp = 0 ; nTemp < nStoredFile && bRemoved != TRUE; nTemp++)
{
omStrTemp = aomstrDBFiles.GetAt(nTemp);
if(!(omStrTemp.Compare(omStrTempFile)))
{
aomstrDBFiles.RemoveAt(nTemp);
bRemoved = TRUE;
}
}
}
}
//Set the new file name array
(*(CMsgSignal**)(m_sDbParams.m_ppvImportedDBs))->vSetDataBaseNames(&aomstrDBFiles);
// Send a message to Tx Window about database change
if( pMainFrame != nullptr)
{
eUSERSELCTION eUserSel = eDATABASEIMPORTCMD;
pMainFrame->m_objTxHandler.vPostMessageToTxWnd(WM_USER_CMD, (WPARAM)eUserSel,0);
}
////Delete Signal watch list and Graph window list
//// Check for Signal Watch & DLL load Condition
//
BOOL bUserOption = FALSE;
if(pMainFrame->m_psSignalWatchList != nullptr)
{
if(theApp.m_bFromAutomation == FALSE)
//.........这里部分代码省略.........