本文整理匯總了C++中GetApplication函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetApplication函數的具體用法?C++ GetApplication怎麽用?C++ GetApplication使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetApplication函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: BackupObject
// create a new paint brush
void TOleDocWindow::CMPBrush( RTMessage )
{
BackupObject();
bObjectLoaded = FALSE;
lstrcpy( lpszObjectName, GetNextObjectName() );
ret = OleCreate( "StdFileEditing",
(LPOLECLIENT)pOwlClient,
"PBRUSH",
lhClientDoc,
GetApplication()->Name,
&lpObject,
olerender_draw,
0 );
// Creating an Ole Object is a asynchronous operation. An
// interesting experiment is to use TDW to step into
// WaitOleNotBusy (which the following wait macro takes you
// to) and look at the user screen between message
// dispatching. You should see pbrush gradually paint
// itself as it processes the messages which which Ole
// generates for it. In general, if a Ole Server does not
// behave properly when creating an object, a likely cause is a
// problem with the message dispatch loop.
wait( ret , lpObject );
// OleSetHostNames sets the name in the server app. If this
// was not called, pbrush would display a string with a bunch
// of % sings in it.
ret = OleSetHostNames( lpObject, GetApplication()->Name, lpszObjectName );
wait( ret , lpObject );
}
示例2: GetApplication
void GuiControl::CloseTooltip()
{
if(GetApplication()->GetTooltipOwner()==this)
{
GetApplication()->CloseTooltip();
}
}
示例3: GetApplication
BOOL ColourDragInformation::Init()
{
// Setup preference for drag transparency
if (GetApplication()->DeclareSection(_T("Dragging"), 1))
GetApplication()->DeclarePref( NULL, _T("ColourDragTransparency"), &DragTransparency, 0, 100);
return TRUE;
}
示例4: GetApplication
BOOL ClickModifiers::DeclarePrefs()
{
GetApplication()->DeclareSection( wxT("Mouse"), 5);
GetApplication()->DeclarePref( wxT("Mouse"), wxT("Left Button"), (INT32*)&LeftButtonFunction);
GetApplication()->DeclarePref( wxT("Mouse"), wxT("Middle Button"), (INT32*)&MiddleButtonFunction);
GetApplication()->DeclarePref( wxT("Mouse"), wxT("Right Button"), (INT32*)&RightButtonFunction);
return TRUE;
}
示例5: run_chain
void run_chain(int nChainNumber) {
int inst = inst_ok(INST_LOC_CHAINS, nChainNumber + 1);
if (inst != 0) {
char szMessage[255];
sprintf(szMessage, "|#2Chain %s is in use on instance %d", chains[nChainNumber].description, inst);
if (!(chains[nChainNumber].ansir & ansir_multi_user)) {
strcat(szMessage, "Try again later.\r\n");
GetSession()->bout << szMessage;
return;
} else {
strcat(szMessage, "Care to join in? ");
GetSession()->bout << szMessage;
if (!yesno()) {
return;
}
}
}
write_inst(INST_LOC_CHAINS, static_cast< unsigned short >(nChainNumber + 1), INST_FLAGS_NONE);
if (GetApplication()->HasConfigFlag(OP_FLAGS_CHAIN_REG) && chains_reg) {
chains_reg[nChainNumber].usage++;
WFile regFile(syscfg.datadir, CHAINS_REG);
if (regFile.Open(WFile::modeReadWrite | WFile::modeBinary | WFile::modeCreateFile | WFile::modeTruncate,
WFile::shareUnknown, WFile::permReadWrite)) {
regFile.Write(chains_reg, GetSession()->GetNumberOfChains() * sizeof(chainregrec));
}
}
char szComSpeed[ 11 ];
sprintf(szComSpeed, "%d", (com_speed == 1) ? 115200 : com_speed);
char szComPortNum[ 11 ];
sprintf(szComPortNum, "%d", syscfgovr.primaryport);
char szModemSpeed[ 11 ];
sprintf(szModemSpeed, "%d", modem_speed);
const std::string chainCmdLine = stuff_in(chains[nChainNumber].filename, create_chain_file(), szComSpeed, szComPortNum,
szModemSpeed, "");
sysoplogf("!Ran \"%s\"", chains[nChainNumber].description);
GetSession()->GetCurrentUser()->SetNumChainsRun(GetSession()->GetCurrentUser()->GetNumChainsRun() + 1);
unsigned short flags = 0;
if (!(chains[nChainNumber].ansir & ansir_no_DOS)) {
flags |= EFLAG_COMIO;
}
if (chains[nChainNumber].ansir & ansir_no_pause) {
flags |= EFLAG_NOPAUSE;
}
if (chains[nChainNumber].ansir & ansir_emulate_fossil) {
flags |= EFLAG_FOSSIL;
}
ExecuteExternalProgram(chainCmdLine, flags);
write_inst(INST_LOC_CHAINS, 0, INST_FLAGS_NONE);
GetApplication()->UpdateTopScreen();
}
示例6: CPhidgetInterfaceKit_setRatiometric
void WidgetsInterfaceKit::OnWtRatiometricStateChanged(Wt::WCheckBox* checkbox)
{
bool ratiometric = checkbox->isChecked();
CPhidgetInterfaceKit_setRatiometric(m_phidget->GetNativeHandle(), ratiometric ? PTRUE : PFALSE);
::GetApplicationManager()->OnWtRatiometricChanged(GetApplication(), GetSerial(), ratiometric);
UpdateSensorFunctionDropdowns(ratiometric);
GetApplication()->triggerUpdate();
}
示例7: GetApplication
void RTSPProtocol::GetStats(Variant &info, uint32_t namespaceId) {
BaseProtocol::GetStats(info, namespaceId);
info["streams"].IsArray(true);
Variant si;
if (GetApplication() != NULL) {
StreamsManager *pStreamsManager = GetApplication()->GetStreamsManager();
map<uint32_t, BaseStream*> streams = pStreamsManager->FindByProtocolId(GetId());
FOR_MAP(streams, uint32_t, BaseStream *, i) {
si.Reset();
MAP_VAL(i)->GetStats(si, namespaceId);
info["streams"].PushToArray(si);
}
示例8: GetApplication
void SelectionState::DeselectAll(BOOL RenderBlobs)
{
// Find the selected objects in the tree;
SelRange* Selected = GetApplication()->FindSelection();
ERROR3IF( Selected==NULL, "Selection object is null in DeselectAll()");
// Get the selected spread
Spread* pSpread = Document::GetSelectedSpread();
ERROR3IF(pSpread == NULL,"NULL selected spread");
// Make sure that we have a spread and a selection
if (pSpread == NULL || Selected == NULL)
return;
// Find first selected node
#if !defined(EXCLUDE_FROM_RALPH)
Node* pFirstSelectedNode = Selected->FindFirst();
// If there is a selection, EOR blobs off, deselect nodes, and inform everybody
if (pFirstSelectedNode != NULL && RenderBlobs)
{
// Go though and render all the EOR blobs off the screen
// Find the Blob Manager
BlobManager* BlobMgr = GetApplication()->GetBlobManager();
ENSURE( BlobMgr!=NULL, "Blob Manager unexpectedly not there.");
// Render all the blobs
BlobMgr->RenderOff(NULL, pFirstSelectedNode->FindParentSpread());
Tool* pTool = Tool::GetCurrent();
// Get the tool to remove all its blobs before we deselect the nodes.
// Only do this if the current tool dosent update itself on sel changed messages
if (pSpread!=NULL && pTool!=NULL && !pTool->AreToolBlobsRenderedOnSelection())
pTool->RenderToolBlobs(pSpread,NULL);
}
#endif
DeselectAll(pSpread->FindFirstChild());
// Selection cache is no longer valid, so update and tell everyone that it has changed
// *Note*, This used to be 'Selected->Update(TRUE)', but I (Will) removed the TRUE, so
// that a message is NOT broadcast. This should only be called from an operation,
// and the op will send a message when it ends.
Selected->Update();
}
示例9: TBaseDemoWindow
/* Initialize the bitblt demo window and allocate bitmaps */
TBitBltWindow::TBitBltWindow( PTWindowsObject AParent, LPSTR ATitle ) :
TBaseDemoWindow( AParent, ATitle )
{
Background = LoadBitmap(GetApplication()->hInstance, MAKEINTRESOURCE(BackgroundID));
Ship = LoadBitmap(GetApplication()->hInstance, MAKEINTRESOURCE(ShipID));
MonoShip = LoadBitmap(GetApplication()->hInstance, MAKEINTRESOURCE(MonoShipID));
ScratchBitmap = 0;
StretchedBkgnd = 0;
OldX = 0;
OldY = 0;
X = 0;
Y = 0;
Delta = 5;
CurClick = 1;
};
示例10: GetApplication
void LiveEffectsTool::OnMouseMove(DocCoord Coord, Spread* pSpread, ClickModifiers mods)
{
// Stub out this function if the tool isn't wanted
#ifndef NO_ADVANCED_TOOLS
// We are interested in any selected paths that the cursor is over
// we will also be needing the current docview
SelRange* Selected = GetApplication()->FindSelection();
Node* pNode = Selected->FindFirst();
// Check to see if the selection is on the same spread as the mouse
if (pNode!=NULL)
{
// Get the spread and return if it is different from the one with the cursor
Spread* pNodeSpread = pNode->FindParentSpread();
if (pNodeSpread!=pSpread)
return;
}
// Find the Blob manager, so we can find out how big a rect to use
BlobManager* pBlobMgr = GetApplication()->GetBlobManager();
if (pBlobMgr==NULL)
return;
// Find the Rect round the mouse pos that counts as a hit
DocRect BlobRect;
pBlobMgr->GetBlobRect(Coord, &BlobRect);
// Work out the square of the distance that we will count as 'close' to the line
INT32 Range = BlobRect.Width() / 2;
Range *= Range;
// // loop through the selection
// while (pNode!=NULL)
// {
// // Now find the next selected node
// pNode = Selected->FindNext(pNode);
// }
// We did not find anything good, so set the cursor to the normal one
ChangeCursor(pNormalCursor);
// And set the status bar text
StatusMsg.Load(_R(IDS_LIVEEFFECTSTART), Tool::GetModuleID(GetID()));
GetApplication()->UpdateStatusBarText(&StatusMsg);
#endif // NO_ADVANCED_TOOLS
}
示例11: Karim_MacDonald
/********************************************************************************************
> static OpState OpRemoveClipView::GetState(String_256* pstrDescription, OpDescriptor* pOpDesc)
Author: Karim_MacDonald (Xara Group Ltd) <[email protected]>
Created: 01 February 2000
Inputs: pstrDescription
pOpDesc
Outputs:
Returns:
Purpose:
Errors:
See also:
********************************************************************************************/
OpState OpRemoveClipView::GetState(String_256* pstrDescription, OpDescriptor* pOpDesc)
{
// default is an unticked, ungreyed, *NOT* on-menu state.
OpState OpSt;
OpSt.RemoveFromMenu = TRUE;
// obtain the app's current selection.
// we want to treat bevels/contours etc. as atomic objects.
Range Sel(*(GetApplication()->FindSelection()));
RangeControl rc = Sel.GetRangeControlFlags();
rc.PromoteToParent = TRUE;
Sel.Range::SetRangeControl(rc);
// we only show ourself if the selection consists of one lone NodeClipViewController.
Node* pNode = Sel.FindFirst();
if (pNode != NULL && pNode->IsANodeClipViewController())
{
if (Sel.FindNext(pNode) == NULL)
{
OpSt.RemoveFromMenu = FALSE;
// if it's selected inside, we gray ourself and give a reason.
if (Sel.ContainsSelectInside())
{
OpSt.Greyed = TRUE;
*pstrDescription = String_256(_R(IDS_GREY_WHEN_SELECT_INSIDE));
}
}
}
return OpSt;
}
示例12: GetApplication
BOOL NodeSimpleShape::IsNearControlHandle(DocCoord Coord, INT32* CoordNum)
{
#if !defined(EXCLUDE_FROM_RALPH)
// Find the blob manager
BlobManager* pBlobMgr = GetApplication()->GetBlobManager();
if (pBlobMgr==NULL)
return FALSE;
// Find out about the size of a blob
DocRect BlobRect;
pBlobMgr->GetBlobRect(Coord, &BlobRect);
// Check to see if it is near any of the blobs
for (INT32 i=0; i<4; i++)
{
// Check for collision with the control points
if (BlobRect.ContainsCoord(Parallel[i]))
{
// Tell them which control point it waas over
*CoordNum = i;
// we have used that click up, so tell the world
return TRUE;
}
}
#endif
// was not over any of the control points
return FALSE;
}
示例13: PORTNOTETRACE
BOOL NodeSimpleShape::OnClick( DocCoord PointerPos, ClickType Click, ClickModifiers ClickMods,
Spread* pSpread )
{
PORTNOTETRACE("other","NodeSimpleShape::OnClick - do nothing");
#if !defined(EXCLUDE_FROM_RALPH)
// we only handle the click if we can confirm that object blobs are being displayed.
BlobManager* pBlobMgr = GetApplication()->GetBlobManager();
if (pBlobMgr == NULL)
return FALSE;
if (!pBlobMgr->GetCurrentInterest().Object)
return FALSE;
INT32 ClickCorner;
if (IsNearControlHandle(PointerPos, &ClickCorner))
{
// The click was over a control point, so start the drag and tell it the opposite corner
if (Click==CLICKTYPE_DRAG)
HandleBlobDrag(Parallel[ClickCorner], pSpread, (ClickCorner+2)%4 );
// we have used that click up, so tell the world
return TRUE;
}
#endif
// did not use the click
return FALSE;
}
示例14: _declspec
_declspec(nothrow) void ExcelControllerImpl08::SetScreenUpdating(bool bEnabled)
{
try
{
if(IsResponding())
{
Excel::_ApplicationPtr spApplication = GetApplication();
if (spApplication == 0)
return;
LCID lcid;
if (spApplication->ActiveWorkbook != 0)
lcid = LocaleHelper::GetLocaleIDForInstalledExcel(spApplication->ActiveWorkbook);
else
lcid = LocaleHelper::GetLocaleIDForInstalledExcel(spApplication);
spApplication->ScreenUpdating[lcid] = bEnabled ? VARIANT_TRUE : VARIANT_FALSE;
}
}
catch(const Workshare::Exception&)
{
//ignore
}
catch(...)
{
ProcessUnhandledException();
}
}
示例15: GetApplication
void TSysInfoWindow::GetSysInformation( void )
{
DWORD SysFlags;
char tempstr[ 31 ];
WORD ArgList[ 2 ];
WORD Ver;
DWORD Available;
HINSTANCE hInstance = GetApplication()->hInstance;
SysFlags = GetWinFlags();
ArgList[ 0 ] = GetModuleUsage( hInstance );
wvsprintf( (LPSTR) TransferRecord.InstanceNumber, (LPSTR) "%d", (LPSTR) ArgList );
Ver = GetVersion();
ArgList[0] = (WORD) LOBYTE(LOWORD( Ver ));
ArgList[1] = (WORD) HIBYTE(LOWORD( Ver ));
wvsprintf( (LPSTR) TransferRecord.WindowsVersion, (LPSTR) "%d.%d", (LPSTR) ArgList );
if ( SysFlags & WF_ENHANCED )
LoadString( hInstance, ID_ENHANCED, tempstr, sizeof( tempstr ) );
else if ( SysFlags & WF_STANDARD )
LoadString( hInstance, ID_STANDARD, tempstr, sizeof( tempstr ) );
else if ( SysFlags & WF_PMODE )
LoadString( hInstance, ID_REAL, tempstr, sizeof( tempstr ) );
else
LoadString( hInstance, ID_UNKNOWN, tempstr, sizeof( tempstr ) );
strcpy( TransferRecord.OperationMode, tempstr );
if ( SysFlags & WF_CPU086 )
LoadString( hInstance, ID_CPU8086, tempstr, sizeof( tempstr ) );
else if ( SysFlags & WF_CPU186 )
LoadString( hInstance, ID_CPU80186, tempstr, sizeof( tempstr ) );
else if ( SysFlags & WF_CPU286 )
LoadString( hInstance, ID_CPU80286, tempstr, sizeof( tempstr ) );
else if ( SysFlags & WF_CPU386 )
LoadString( hInstance, ID_CPU80386, tempstr, sizeof( tempstr ) );
else if ( SysFlags & WF_CPU486 )
LoadString( hInstance, ID_CPU80486, tempstr, sizeof( tempstr ) );
else
LoadString( hInstance, ID_UNKNOWN, tempstr, sizeof( tempstr ) );
strcpy( TransferRecord.CPUType, tempstr );
if ( SysFlags & WF_80x87 )
LoadString( hInstance, ID_YES, tempstr, sizeof( tempstr ) );
else
LoadString( hInstance, ID_NO, tempstr, sizeof( tempstr ) );
strcpy( TransferRecord.CoProcessor, tempstr );
Available = GetFreeSpace( 0 ) / 1024;
ArgList[0] = LOWORD( Available );
ArgList[1] = HIWORD( Available );
wvsprintf( (LPSTR) TransferRecord.Global, (LPSTR) "%lu", (LPSTR) ArgList );
ArgList[0] = _osmajor;
ArgList[1] = _osminor;
wvsprintf( (LPSTR) TransferRecord.VersionDos, (LPSTR) "%d.%d", (LPSTR) ArgList );
TransferBuffer = (LPSTR) &TransferRecord;
}