#ifdef _AFXDLL
Enable3dControls() // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic() // Call this when linking to MFC statically
#endif
CPreviewDialogDlg dlg
m_pMainWnd = &dlg
int nResponse = dlg.DoModal()
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we EXIT the
// application, rather than start the application s message pump.
return FALSE
}
Ink Blotting
One method for escaping from a maze is via ‘ink-blotting’. In this method your starting square
is marked with the number ‘1’. All free, valid squares north, south, east and west around the
number ‘1‘ are marked with a number ‘2’. In the next step, all free, valid squares around the two
are marked with a ‘3’ and the process is repeated iteratively until :
The EXIT is found (a free square other than the starting position is reached on the very edge
of the maze), or,
No more free squares are available, and hence no EXIT is possible.
linux下用C語(yǔ)言寫的聊天程序!/*BUG and NOTE:
Not join protect to Shared Memory Segments,example Semaphore Arrays.
Not check the parameters validity.
When transmit may be error.
If the client program no right EXIT,others cannot know,the service program shouldbe check the client program whether exist timing.
The program when EXIT(), it do not delete the Shared Memory Segments,you maybe use atEXIT() but the program have some processes.
When one process is EXIT(),others is continue.
The service program s action is few.
And so on. */
看n2實(shí)例 #Create a simulator object
set ns [new Simulator]
#Define different colors for data flows
#$ns color 1 Blue
#$ns color 2 Red
#Open the nam trace file
set nf [open out-1.nam w]
$ns namtrace-all $nf
set f0 [open out0.tr w]
set f1 [open out1.tr w]
#Define a finish procedure
proc finish {} {
global ns nf
$ns flush-trace
#Close the trace file
close $nf
#Execute nam on the trace file
EXIT 0
}
#Create four nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
#Create links between the nodes
$ns duplex-link $n0 $n2 1Mb 10ms
RunExp.m:
-Changed script into a function.
-Coded to accept the numberofRuns as an Argument.
-Added code for automatic EXIT from Matlab and Shutdown of WindowsPC.