本文整理汇总了C++中TRACEUSER函数的典型用法代码示例。如果您正苦于以下问题:C++ TRACEUSER函数的具体用法?C++ TRACEUSER怎么用?C++ TRACEUSER使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TRACEUSER函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Phil_Martin
/********************************************************************************************
> virtual BOOL CamLaunchProcess::Execute(const wxString& cmd)
Author: Phil_Martin (Xara Group Ltd) <[email protected]>
Created: 19/May/2006
Inputs: cmd - The command string including parameters
Outputs: -
Returns: TRUE if the command was launched successfully
FALSE otherwise
Purpose: Execute a command which should launch a long-running process
********************************************************************************************/
BOOL CamLaunchProcess::Execute(const wxString& cmd)
{
m_ReturnCode = 0; // Assume success until we find otherwise
// Make sure redirection happens
Redirect();
TRACEUSER("Phil", _T("Executing %s\n"), (LPCTSTR) cmd);
m_pid = wxExecute(cmd, wxEXEC_ASYNC, this);
if (m_pid==0)
{
// Couldn't even create a process for the command!
m_bDead = true;
return FALSE;
}
// We're now running
m_bDead = false;
m_bConnected = true;
// Give the command 100 milliseconds to return an error condition or die...
// After that we will either use the return code it passed back to OnTerminate
// or assume it is running successfully...
MonotonicTime graceperiod;
while (!m_bDead && m_ReturnCode==0 && !graceperiod.Elapsed(100))
{
ProcessStdErr(); // Process any output on stderr
wxMilliSleep(1);
wxYield();
}
TRACEUSER("Phil", _T("Exiting with %d\n"), m_ReturnCode);
return (m_ReturnCode==0);
}
示例2: min
INT32 PathProcessorStrokeAirbrush::GetNumSteps(View *pView, INT32 LineWidth)
{
if(pView == NULL)
return 1;
// Find out how many millipoints 1 pixel is
const INT32 spw = pView->GetScaledPixelWidth().MakeLong();
const INT32 sph = pView->GetScaledPixelHeight().MakeLong();
const MILLIPOINT OnePixel = min(spw, sph);
TRACEUSER( "Richard", _T("1 pixel = %d\n"), OnePixel);
if (OnePixel <= 0)
return(1);
// Now work out how many steps to render. The fewer steps, the faster we go, but this
// trades off against quality. Because we start in the centre and increase in both
// directions, we need to divide line width by the size of 2 pixels to get a step per pixel.
// However, 3 is used because it means each ring of the airbrush is 1.5 pixels wider than the
// last, which, with anti-aliasing, gives a very smooth effect. Going up to 4 makes each one
// 2 pixels, and you can begin to see tree-ring effects in the airbrush.
INT32 NumSteps = (INT32)(LineWidth / (OnePixel * 3));
// Limit it to a sensible range
if(NumSteps < 1)
NumSteps = 1;
if(NumSteps > MaxAirbrushSteps)
NumSteps = MaxAirbrushSteps;
TRACEUSER( "Richard", _T("NumSteps = %d\n"), NumSteps);
return NumSteps;
}
示例3: TestErrorStuff
void TestErrorStuff()
{
test1(0);
test1(1);
test1(2);
test1(3);
test1(4);
InformError();
test2(0);
test2(1);
test2(2);
test2(3);
test2(4);
InformError();
ERROR3("simple");
ERROR3IF( TRUE, "simple" );
ERROR3_PF( ("doc is %lx", 0x123456) );
ERROR3IF_PF( TRUE, ("doc %s is %lx", "blobdoc", 0x123456) );
TRACEUSER( "Andy", _T("simple trace\n"));
TRACEUSER( "Andy", "complex %d %s trace", 42, _T("blobby\n") );
}
示例4: TRACEUSER
BOOL RIFFFile::SkipToListEnd(UINT32 LevelNumber)
{
RIFFFileLevel *Level;
RIFFFileLevel *Next;
TRACEUSER( "Ben", _T("SkipToListEnd called to level %d\n"), LevelNumber);
Level = (RIFFFileLevel *)Levels.FindItem(LevelNumber - 1);
// - 1 because level 0 doesn't have an entry as
// it's the root level of the file
ERROR2IF(Level == 0, FALSE, "Couldn't find given level to jump to in list");
// seek to the end of the level
if(File->seek(Level->End).bad())
{
TRACEUSER( "Ben", _T("RIFFFile: file error when seeking to end of level\n"));
RIFFFILE_RETURNERR;
}
// update the location
Location = Level->End;
// update the level we're at
CurrentLevel = LevelNumber - 1;
// remove the last few entries from the list, including this one
while(Level != 0)
{
Next = (RIFFFileLevel *)Levels.GetNext(Level);
delete Levels.RemoveItem(Level);
Level = Next;
}
return TRUE;
}
示例5: CheckFractalBitmap
BOOL GlobalFractalList::AddFractal(FillGeometryAttribute* NewFractal)
{
CachedFractal* ExistingFrac = CheckFractalBitmap(NewFractal);
if (ExistingFrac != NULL)
{
ExistingFrac->IncUsageCount();
return FALSE;
}
CachedFractal* Fractal = new CachedFractal();
if (Fractal == NULL)
return FALSE;
TRACEUSER( "Mike", _T("Adding Cached Fractal @ %x\n"),Fractal);
Fractal->SetCachedFractal(NewFractal);
Fractal->IncUsageCount();
AddTail((ListItem*)Fractal);
if (this != GetApplication()->GetGlobalFractalList())
Fractal->MakeFakeFractal();
TRACEUSER( "Mike", _T("Cached Fractal Count = %d\n"),GetFractalCacheCount());
TRACEUSER( "Mike", _T("Cached Fractal Size = %d\n"),GetFractalCacheSize());
return(TRUE);
}
示例6: DeInitUserHelp
BOOL DeInitUserHelp()
{
PORTNOTETRACE("help", "Help function unimplemented!");
#if !defined(EXCLUDE_FROM_XARALX)
// Tell the help engine we've finished using the help file(s).
// NB. KNWON BUG: this doesn't do the job on Windows NT, leaving the helpfiles open.
// As yet I have no idea why - it is as per the docs and works on Win32s & Chicago.
if (fHaveUsedHelp)
{
TRACEUSER( "Ollie", _T("Closing general helpfile\n"));
ShowHelp(HELP_QUIT, 0);
}
#ifdef STANDALONE
// Same if we ran the special helpfile.
if (fHaveUsedSpecHelp)
{
TRACEUSER( "Ollie", _T("Closing special helpfile\n"));
RunOilHelp(achzSpecPath, HELP_QUIT, 0);
}
#endif
// Remove our F1 message hook.
return hF1Hook == NULL || ::UnhookWindowsHookEx(hF1Hook);
#else
return TRUE;
#endif
}
示例7: TRACEUSER
BOOL PointersTab::CommitSection()
{
TRACEUSER( "Neville", _T("commit PointersTab section\n"));
ERROR2IF(pPrefsDlg == NULL,FALSE,"PointersTab::CommitSection called with no dialog pointer");
BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_POINTERS)); // The pointers page identifier
if (!ok)
return TRUE; // Talk to page failed to return now
// Section = Pointers
// Ok has been pressed so take the values from this section of the dialog box
BOOL Valid=FALSE; // Flag for validity of value
// BOOL State=FALSE; // Flag for state of button/switch
BOOL SetOk=TRUE; // Preference value set ok
// Middle button removed for now as nothing seems to use it.
// 0, 1 or 2 indicating Left Middle or Right mouse button
ButtonFunction LeftButton = (ButtonFunction)pPrefsDlg->GetSelectedValueIndex(_R(IDC_OPTS_LEFTBUTTON));
// ButtonFunction MiddleButton = (ButtonFunction)pPrefsDlg->GetSelectedValueIndex(_R(IDC_OPTS_MIDDLEBUTTON));
ButtonFunction RightButton = (ButtonFunction)pPrefsDlg->GetSelectedValueIndex(_R(IDC_OPTS_RIGHTBUTTON));
ClickModifiers::SetButtonFunc(0, LeftButton);
// ClickModifiers::SetButtonFunc(1, MiddleButton);
ClickModifiers::SetButtonFunc(2, RightButton);
// All units work off the selected document and so we must do nothing if there is no
// selected document. Check our clas variable to see if this is true or not.
// Units should have been set up by the caller.
if (pDocument == NULL || pSpread == NULL)
return (TRUE);
// Now the magnetic radii
INT32 LineRadius = 0;
INT32 PointRadius = 0;
LineRadius = pPrefsDlg->GetUnitGadgetValue(_R(IDC_OPTS_LINERADIUS), CurrentPageUnits,
0, INT_MAX, _R(IDE_OPTS_INVALIDLINERAD), &Valid);
TRACEUSER( "Neville", _T("commit LineRadius distance='%d' Valid ='%d'\n"),LineRadius, Valid);
if (Valid)
{
SetOk = Camelot.SetPrefValue(TEXT("Magnetic Options"), TEXT("Line Radius"), &LineRadius);
ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_EDIT));
}
else
return FALSE; // Magnetic line radius incorrect, user has been warned already
PointRadius = pPrefsDlg->GetUnitGadgetValue(_R(IDC_OPTS_POINTRADIUS), CurrentPageUnits,
0, INT_MAX, _R(IDE_OPTS_INVALIDPOINTRAD), &Valid);
TRACEUSER( "Neville", _T("commit PointRadius distance='%d' Valid ='%d'\n"),PointRadius, Valid);
if (Valid)
{
SetOk = Camelot.SetPrefValue(TEXT("Magnetic Options"), TEXT("Point Radius"), &PointRadius);
ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_EDIT));
}
else
return FALSE; // Magnetic point radius incorrect, user has been warned already
return TRUE;
}
示例8: TRACEUSER
TunedMemory::~TunedMemory()
{
if (AvailableRAM!=TotalRAM)
{
TRACEUSER( "Rik", wxT("At Exit the Available Ram did not equal the Total Ram in TunedMemory\n") );
TRACEUSER( "Rik", wxT("TotalRAM = %ld, Available=%ld\n"), TotalRAM, AvailableRAM );
}
}
示例9: TRACEUSER
XPFCapability* PluginOILFilter::CreateColourNode(xmlNodePtr pNode)
{
XPFCapability* pCap = NULL;
wxString strName = CXMLUtils::ConvertToWXString(pNode->name);
if (strName == _T("#text") || xmlNodeIsText(pNode))
{
wxString str = CXMLUtils::ConvertToWXString(xmlNodeGetContent(pNode));
TRACEUSER("Phil", _T("CreateColourNode ignoring text %s\n"), (LPCTSTR)str);
return(NULL);
}
XPFConvertType AsType = XPFCONVTYPE_UNKNOWN;
BOOL bOK = GetConvertAsType(pNode, &AsType);
if (!bOK)
{
TRACEUSER("Phil", _T("CreateColourNode GetConvertAsType failed\n"));
return NULL;
}
if (strName == _T("Colour"))
{
pCap = new XPFCColour(AsType);
}
else
{
ERROR1(NULL, _R(IDE_XPF_BADXML_UNEXPECTED_COLOURTYPE));
}
xmlNodePtr pChild;
pChild = pNode->children;
XPFCapability* pLast = NULL;
while (pChild)
{
XPFCapability* pCapNode = CreateColourNode(pChild);
if (pCapNode)
{
// If we have a node then add it to the list
// If we do not have a node already then set m_pObjects
if (pLast)
{
pLast->SetNext(pCapNode);
}
else
{
pCap->SetChild(pCapNode);
}
pLast = pCapNode;
}
pChild = pChild->next;
}
return(pCap);
}
示例10: TRACEUSER
BOOL ScaleTab::InitSection()
{
TRACEUSER( "Neville", _T("ScaleTab::InitSection\n"));
ERROR2IF(pPrefsDlg == NULL,FALSE,"ScaleTab::InitSection called with no dialog pointer");
// BOOL ReadOk = FALSE; // Flag to say whether the preference value was read ok
// Make sure the information field displaying the name of the current document
// is correct.
String_256 DocumentName(_R(IDT_OPTS_SCALING_INFO));
DocumentName += *GetDocumentName();
pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_INFO), DocumentName);
// Section = Scale settings
DocView* pSelectedView = DocView::GetSelected();
// This may now be a valid state so must not error
//ERROR3IF(pSelectedView == NULL,"ScaleTab::InitSection Where's the current view eh?");
if (pSelectedView != NULL)
{
Spread* pSpread = pSelectedView->GetFirstSelectedSpread();
// If no selected spread then use the visible spread
if (pSpread == NULL)
pSpread = pSelectedView->GetVisibleSpread();
// If no selected spread then use the first spread
// Of course, this should not be here but above routines seem to return
// null a bit too often for my liking
if (pSpread == NULL)
{
TRACEUSER( "Neville", _T("ScaleTab::InitSection BODGE! using 1st spread\n"));
Document* pSelectedDoc = Document::GetSelected();
if (pSelectedDoc !=NULL )
pSpread = pSelectedDoc->FindFirstSpread();
}
// Go and get a pointer to the scaling values
if (pSpread != NULL)
{
pDimScale = pSpread->GetPtrDimScale();
if (pDimScale != NULL)
{
// And now show the initial state of the controls given this
// scaling
ShowScaleDetails();
}
}
}
else
{
// If no current view then ensure section is greyed
GreySection();
}
return TRUE;
}
示例11: TRACEUSER
void OpChangeLineAttribOpDesc::OnSelectionChange(OpDescControlMsg* pSelChangedMsg, List*)
{
// Get the relevant fields.
DialogOp* pDlg = pSelChangedMsg->pDlgOp;
CGadgetID idSetGadgetID = pSelChangedMsg->SetGadgetID;
// Try to get the text entered (or selected) within the combo.
BOOL fValid;
String_256 strEntered = pDlg->GetStringGadgetValue(idSetGadgetID, &fValid, -1);
if (!fValid)
{
TRACEUSER( "JustinF", _T("Invalid text in OpChangeLineAttribOpDesc::OnSelectionChange\n"));
Beep();
SetCurrentSelectedAttrib();
return;
}
INT32 nItemIndex;
// Compare the string to each item that was placed in the combo list.
for (nItemIndex = 0; ; nItemIndex++)
{
// Ask the derived class to provide the string at the given index position.
UINT32 nTxtID = GetItemStringID(nItemIndex);
// If there are no more strings then simply reset the combo to the current value.
// The user has entered junk!
if (nTxtID == 0)
{
// This will "recalc" the current value and set it.
Beep();
SetCurrentSelectedAttrib();
return;
}
// Compare the two strings. If they match then break out now.
if (strEntered == String_256(nTxtID)) break;
}
// Obtain the index selected in the combo and pass to the derived class, which will
// create the appropriate attribute.
NodeAttribute* pAttr = GetNewAttrib(nItemIndex);
if (pAttr == NULL)
{
TRACEUSER( "JustinF", _T("Out of memory in OpChangeLineAttribOpDesc")
"::OnSelectionChange\n");
return;
}
// Pass it to the attribute manager.
AttributeManager::AttributeSelected(pAttr);
// Update all list-boxes. Note we must do this even if we have just set a new
// attribute, as a SelChanging message will not be always be broadcast.
SetCurrentSelectedAttrib();
}
示例12: ERROR2
BOOL RIFFFile::GetChunkData(ADDR Block, INT32 BSize)
{
// first of all, check to see if the caller has been a little bit silly
if(ObjType != RIFFOBJECTTYPE_CHUNK)
{
Error = TRUE; // only chunks have getable data
ERROR2(FALSE, "RIFFFile::GetChunkData called for a non-chunk object\n");
}
if(BSize < ObjSize)
{
Error = TRUE; // wrong size...
ERROR2(FALSE, "RIFFFile::GetChunkData called with a block which is just *too* small\n");
}
// has the data already been got for this object?
if(GotData)
{
// yep, go back and get it again
TRACEUSER( "Ben", _T("Chunk data asked for more than once\n"));
if(File->seek(ObjLocation).bad())
RIFFFILE_RETURNERR;
Location = ObjLocation;
}
// and get that data!
if(File->read(Block, ObjSize).bad())
{
TRACEUSER( "Ben", _T("RIFFFile: file error when reading chunk data\n"));
RIFFFILE_RETURNERR;
}
// ensure alignment is maintained within the file
if(ObjSize != AlignedObjectSize)
{
// read a byte to align this to the correct position
BYTE junk;
if(File->read(&junk, sizeof(junk)).bad())
RIFFFILE_RETURNERR;
}
// update locations
Location += AlignedObjectSize;
// and set an essential flag!
GotData = TRUE;
return TRUE;
}
示例13: strSearchFilename
void CTemplateManager::GetTemplateList( CTemplateList* pList, const String_256& strTemplatePath, bool fLocal )
{
// Don't bother with any of this is directory is invalid
if( !wxDir::Exists( (PCTSTR)strTemplatePath ) )
return;
//Now search that path for templates
//Start by setting the leaf name to *.xar
String_256 strSearchFilename( _R(IDS_NEWTEMPLATES_DEFAULTTEMPLATEEXTENSION) );
// Get the default entry names
String_256 strPathOfDrawingTemplate = CTemplateManager::GetDefaultDrawingTemplate().GetPath(FALSE);
strPathOfDrawingTemplate.SwapChar( _T('_'), _T(' ') );
String_256 strPathOfAnimationTemplate = CTemplateManager::GetDefaultAnimationTemplate().GetPath(FALSE);
strPathOfAnimationTemplate.SwapChar( _T('_'), _T(' ') );
String_256 strPathOfFile;
TRACEUSER( "jlh92", _T("DefPath = %s, %s\n"), PCTSTR(strPathOfDrawingTemplate),
PCTSTR(strPathOfAnimationTemplate) );
// Build system template path
PathName pathTemplates( strTemplatePath );
pathTemplates.SetFileNameAndType( strSearchFilename );
PathName pathOfFile( pathTemplates );
String_256 strTemplates = pathTemplates.GetPath( FALSE );
//And search the path for xar files that are
//NOT the default animation or drawing templates
String_256 strNameOfFile;
if( FileUtil::StartFindingFiles( &strTemplates ) )
{
while( FileUtil::FindNextFile( &strNameOfFile ) )
{
pathOfFile.SetFileNameAndType( strNameOfFile );
strPathOfFile = pathOfFile.GetFileName(TRUE);
if( 0 != strPathOfFile.CompareTo( strPathOfDrawingTemplate, FALSE ) &&
0 != strPathOfFile.CompareTo( strPathOfAnimationTemplate, FALSE ) )
{
(*pList)[strPathOfFile] = fLocal;
TRACEUSER( "jlh92", _T("Curr = %s\n"), PCTSTR(strPathOfFile) );
}
}
FileUtil::StopFindingFiles();
}
// Don't allow any errors set while searching to propagate outside this scope
Error::ClearError();
}
示例14: HelpUser
BOOL HelpUser(const DialogOp& DlgOp)
{
// Work out which page within the dialog is visible, if appropriate. We begin by
// assuming this isn't relevant.
UINT32 nPageResID = 0;
if (DlgOp.IsKindOf(TABBED_DIALOG_CLASS))
{
// Work out which is the active (top-most) page within the tabbed dialog.
wxWindow* pWnd = (wxWindow*) DlgOp.WindowID;
if (pWnd != NULL)
{
// We got the window handle, get its MFC CWnd analogue.
wxBookCtrlBase* pSheet = DialogManager::GetBookControl( pWnd );
if (pSheet != NULL)
{
// Ask it for the resource ID of its currently active page.
nPageResID = (UINT32) pSheet->GetCurrentPage()->GetId();
}
#ifdef _DEBUG
else
{
TRACEUSER( "Ollie", _T("Null OurPropSheet pointer in HelpUser\n"));
}
#endif
}
#ifdef _DEBUG
else
{
TRACEUSER( "Ollie", _T("Null DialogOp window handle in HelpUser\n"));
}
#endif
}
// Get the run-time class name etc of the dialog.
LPCTSTR lpcszDialogClass = DlgOp.GetRuntimeClass()->m_lpszClassName;
// Look-up the class name/page ID in our list of help topics. If we can't find it
// then we return a failure code.
DWORD dwHelpIndex = LookupDialogTopic(lpcszDialogClass, nPageResID);
if (dwHelpIndex == 0)
{
TRACEUSER( "Ollie", _T("Can't find help topic for %s dialog (page ID %lu)\n"),
(LPTSTR) lpcszDialogClass, (UINT32) nPageResID);
return FALSE;
}
// Show this topic in the help system and return a success code.
return ShowHelp(HELP_CONTEXT, dwHelpIndex);
}
示例15: sCommand
BOOL PluginOILFilter::DoExport(CCLexFile* pXarFile, PathName* pPath)
{
// Here we should just need to wait for the process started in GetExportFile
// to finish
// Check stderr for errors and progress
// However for now we will instead
// Run the plugin with the following options
// -e -g -f <filename> -x <xmlfilename>
// The xmlfilename is a path to a user and filter specific file
// e.g. ~/.XaraLX/filtername.xml
// Check stderr for errors
wxString sCommand(m_DoExport);
sCommand.Replace(_T("%OUT%"), (LPCTSTR)pPath->GetPath());
sCommand.Replace(_T("%XML%"), m_XMLFile.GetFullPath());
TRACEUSER("Gerry", _T("Running '%s'"), sCommand.c_str());
CCDiskFile TempFile(CCFILE_DEFAULTSIZE, FALSE, FALSE);
if (!TempFile.open(m_TempXarFile, ios::in | ios::binary))
{
// report an error here
return FALSE;
}
// Create a process with the TempFile as the stdin
PluginFilterProcess* pTheProc = new PluginFilterProcess((PluginNativeFilter*)Parent, &TempFile, NULL);
INT32 code = pTheProc->Execute(sCommand);
TRACEUSER("Gerry", _T("Execute returned %d"), code);
TempFile.close();
if (code != 0)
{
TRACEUSER("Gerry", _T("Execution of '%s' failed (%d)"), sCommand.c_str(), code);
// Extract error and report it
pTheProc->ReportError();
delete pTheProc;
return(FALSE);
}
pTheProc->ReportWarning();
delete pTheProc;
return(TRUE);
}