Skip to content

Commit a664524

Browse files
authored
Update MFC Diagnostic Services
1 parent f5f7c05 commit a664524

File tree

1 file changed

+56
-56
lines changed

1 file changed

+56
-56
lines changed

docs/mfc/reference/diagnostic-services.md

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Suppresses compiler warnings for the use of deprecated MFC functions.
7676

7777
### Syntax
7878

79-
```
79+
```cpp
8080
_AFX_SECURE_NO_WARNINGS
8181
```
8282

@@ -104,7 +104,7 @@ Call this function to cause a break (at the location of the call to `AfxDebugBre
104104
### Syntax
105105
106106
```cpp
107-
void AfxDebugBreak( );
107+
void AfxDebugBreak();
108108
```
109109

110110
### Remarks
@@ -119,13 +119,13 @@ void AfxDebugBreak( );
119119

120120
Evaluates its argument.
121121

122-
```
122+
```cpp
123123
ASSERT(booleanExpression)
124124
```
125125
126126
### Parameters
127127
128-
*booleanExpression*<br/>
128+
*booleanExpression*\
129129
Specifies an expression (including pointer values) that evaluates to nonzero or 0.
130130
131131
### Remarks
@@ -155,16 +155,16 @@ In the Release version of MFC, ASSERT does not evaluate the expression and thus
155155
156156
This macro asserts that the object pointed to is an object of the specified class, or is an object of a class derived from the specified class.
157157
158-
```
158+
```cpp
159159
ASSERT_KINDOF(classname, pobject)
160160
```
161161

162162
### Parameters
163163

164-
*classname*<br/>
164+
*classname*\
165165
The name of a `CObject`-derived class.
166166

167-
*pobject*<br/>
167+
*pobject*\
168168
A pointer to a class object.
169169

170170
### Remarks
@@ -190,13 +190,13 @@ This function works only for classes declared with the [DECLARE_DYNAMIC](run-tim
190190

191191
Use to test your assumptions about the validity of an object's internal state.
192192

193-
```
193+
```cpp
194194
ASSERT_VALID(pObject)
195195
```
196196
197197
### Parameters
198198
199-
*pObject*<br/>
199+
*pObject*\
200200
Specifies an object of a class derived from `CObject` that has an overriding version of the `AssertValid` member function.
201201
202202
### Remarks
@@ -222,8 +222,8 @@ For more information and examples, see [Debugging MFC Applications](/visualstudi
222222
223223
Assists in finding memory leaks.
224224
225-
```
226-
#define new DEBUG_NEW
225+
```cpp
226+
#define new DEBUG_NEW
227227
```
228228

229229
### Remarks
@@ -249,7 +249,7 @@ Once you insert this directive, the preprocessor will insert DEBUG_NEW wherever
249249

250250
In debug mode (when the **_DEBUG** symbol is defined), DEBUG_ONLY evaluates its argument.
251251

252-
```
252+
```cpp
253253
DEBUG_ONLY(expression)
254254
```
255255
@@ -273,14 +273,14 @@ Use to validate data correctness.
273273
274274
### Syntax
275275
276-
```
277-
ENSURE( booleanExpression )
278-
ENSURE_VALID( booleanExpression )
276+
```cpp
277+
ENSURE(booleanExpression)
278+
ENSURE_VALID(booleanExpression)
279279
```
280280

281281
### Parameters
282282

283-
*booleanExpression*<br/>
283+
*booleanExpression*\
284284
Specifies a boolean expression to be tested.
285285

286286
### Remarks
@@ -305,7 +305,7 @@ Expands to the name of the file that is being compiled.
305305

306306
### Syntax
307307

308-
```
308+
```cpp
309309
THIS_FILE
310310
```
311311

@@ -333,9 +333,9 @@ static char THIS_FILE[] = __FILE__;
333333

334334
Sends the specified string to the debugger of the current application.
335335

336-
```
336+
```cpp
337337
TRACE(exp)
338-
TRACE(DWORD category, UINT level, LPCSTR lpszFormat, ...)
338+
TRACE(DWORD category, UINT level, LPCSTR lpszFormat, ...)
339339
```
340340
341341
### Remarks
@@ -354,13 +354,13 @@ For more information, see [Debugging MFC Applications](/visualstudio/debugger/mf
354354
355355
In the Debug version of MFC, evaluates its argument.
356356
357-
```
357+
```cpp
358358
VERIFY(booleanExpression)
359359
```
360360

361361
### Parameters
362362

363-
*booleanExpression*<br/>
363+
*booleanExpression*\
364364
Specifies an expression (including pointer values) that evaluates to nonzero or 0.
365365

366366
### Remarks
@@ -387,8 +387,8 @@ In the Release version of MFC, VERIFY evaluates the expression but does not prin
387387

388388
Provides basic object-dumping capability in your application.
389389

390-
```
391-
CDumpContext afxDump;
390+
```cpp
391+
CDumpContext afxDump;
392392
```
393393

394394
### Remarks
@@ -419,7 +419,7 @@ void AfxDump(const CObject* pOb);
419419
420420
### Parameters
421421
422-
*pOb*<br/>
422+
*pOb*\
423423
A pointer to an object of a class derived from `CObject`.
424424
425425
### Remarks
@@ -436,8 +436,8 @@ Your program code should not call `AfxDump`, but should instead call the `Dump`
436436
437437
This variable is accessible from a debugger or your program and allows you to tune allocation diagnostics.
438438
439-
```
440-
int afxMemDF;
439+
```cpp
440+
int afxMemDF;
441441
```
442442

443443
### Remarks
@@ -489,8 +489,8 @@ This function can be used to check the return values of calls to OLE functions i
489489
490490
This function validates the free memory pool and prints error messages as required.
491491
492-
```
493-
BOOL AfxCheckMemory();
492+
```cpp
493+
BOOL AfxCheckMemory();
494494
```
495495

496496
### Return Value
@@ -532,7 +532,7 @@ void AfxDump(const CObject* pOb);
532532
533533
### Parameters
534534
535-
*pOb*<br/>
535+
*pOb*\
536536
A pointer to an object of a class derived from `CObject`.
537537
538538
### Remarks
@@ -555,7 +555,7 @@ void AFXAPI AfxDumpStack(DWORD dwTarget = AFX_STACK_DUMP_TARGET_DEFAULT);
555555

556556
### Parameters
557557

558-
*dwTarget*<br/>
558+
*dwTarget*\
559559
Indicates the target of the dump output. Possible values, which can be combined using the bitwise-OR (**`|`**) operator, are as follows:
560560

561561
- AFX_STACK_DUMP_TARGET_TRACE Sends output by means of the [TRACE](#trace) macro. The TRACE macro generates output in debug builds only; it generates no output in release builds. Also, TRACE can be redirected to other targets besides the debugger.
@@ -625,13 +625,13 @@ To use this function successfully:
625625

626626
Enables and disables the memory leak dump in the AFX_DEBUG_STATE destructor.
627627

628-
```
628+
```cpp
629629
BOOL AFXAPI AfxEnableMemoryLeakDump(BOOL bDump);
630630
```
631631
632632
### Parameters
633633
634-
*bDump*<br/>
634+
*bDump*\
635635
[in] TRUE indicates the memory leak dump is enabled; FALSE indicates the memory leak dump is disabled.
636636
637637
### Return Value
@@ -655,13 +655,13 @@ If your application loads another library before the MFC library, some memory al
655655
656656
Diagnostic memory tracking is normally enabled in the Debug version of MFC.
657657
658-
```
658+
```cpp
659659
BOOL AfxEnableMemoryTracking(BOOL bTrack);
660660
```
661661

662662
### Parameters
663663

664-
*bTrack*<br/>
664+
*bTrack*\
665665
Setting this value to TRUE turns on memory tracking; FALSE turns it off.
666666

667667
### Return Value
@@ -689,7 +689,7 @@ For more information on `AfxEnableMemoryTracking`, see [Debugging MFC Applicatio
689689

690690
Tests a memory address to make sure it represents a currently active memory block that was allocated by the diagnostic version of **`new`**.
691691

692-
```
692+
```cpp
693693
BOOL AfxIsMemoryBlock(
694694
const void* p,
695695
UINT nBytes,
@@ -698,13 +698,13 @@ BOOL AfxIsMemoryBlock(
698698
699699
### Parameters
700700
701-
*p*<br/>
701+
*p*\
702702
Points to the block of memory to be tested.
703703
704-
*nBytes*<br/>
704+
*nBytes*\
705705
Contains the length of the memory block in bytes.
706706
707-
*plRequestNumber*<br/>
707+
*plRequestNumber*\
708708
Points to a **`long`** integer that will be filled in with the memory block's allocation sequence number, or zero if it does not represent a currently active memory block.
709709
710710
### Return Value
@@ -727,7 +727,7 @@ It also checks the specified size against the original allocated size. If the fu
727727
728728
Tests any memory address to ensure that it is contained entirely within the program's memory space.
729729
730-
```
730+
```cpp
731731
BOOL AfxIsValidAddress(
732732
const void* lp,
733733
UINT nBytes,
@@ -736,13 +736,13 @@ BOOL AfxIsValidAddress(
736736

737737
### Parameters
738738

739-
*lp*<br/>
739+
*lp*\
740740
Points to the memory address to be tested.
741741

742-
*nBytes*<br/>
742+
*nBytes*\
743743
Contains the number of bytes of memory to be tested.
744744

745-
*bReadWrite*<br/>
745+
*bReadWrite*\
746746
Specifies whether the memory is both for reading and writing (TRUE) or just reading (FALSE).
747747

748748
### Return Value
@@ -767,18 +767,18 @@ The address is not restricted to blocks allocated by **`new`**.
767767

768768
Use this function to determine whether a pointer to a string is valid.
769769

770-
```
771-
BOOL AfxIsValidString(
770+
```cpp
771+
BOOL AfxIsValidString(
772772
LPCSTR lpsz,
773773
int nLength = -1);
774774
```
775775
776776
### Parameters
777777
778-
*lpsz*<br/>
778+
*lpsz*\
779779
The pointer to test.
780780
781-
*nLength*<br/>
781+
*nLength*\
782782
Specifies the length of the string to be tested, in bytes. A value of -1 indicates that the string will be null-terminated.
783783
784784
### Return Value
@@ -799,13 +799,13 @@ In non-debug builds, nonzero if *lpsz* is not NULL; otherwise 0.
799799
800800
Sets a hook that enables calling of the specified function before each memory block is allocated.
801801
802-
```
802+
```cpp
803803
AFX_ALLOC_HOOK AfxSetAllocHook(AFX_ALLOC_HOOK pfnAllocHook);
804804
```
805805

806806
### Parameters
807807

808-
*pfnAllocHook*<br/>
808+
*pfnAllocHook*\
809809
Specifies the name of the function to call. See the Remarks for the prototype of an allocation function.
810810

811811
### Return Value
@@ -818,13 +818,13 @@ The Microsoft Foundation Class Library debug-memory allocator can call a user-de
818818

819819
**BOOL AFXAPI AllocHook( size_t** `nSize`**, BOOL** `bObject`**, LONG** `lRequestNumber` **);**
820820

821-
*nSize*<br/>
821+
*nSize*\
822822
The size of the proposed memory allocation.
823823

824-
*bObject*<br/>
824+
*bObject*\
825825
TRUE if the allocation is for a `CObject`-derived object; otherwise FALSE.
826826

827-
*lRequestNumber*<br/>
827+
*lRequestNumber*\
828828
The memory allocation's sequence number.
829829

830830
Note that the AFXAPI calling convention implies that the callee must remove the parameters from the stack.
@@ -846,10 +846,10 @@ AFXAPI AfxDoForAllClasses(
846846
847847
### Parameters
848848
849-
*pfn*<br/>
849+
*pfn*\
850850
Points to an iteration function to be called for each class. The function arguments are a pointer to a `CRuntimeClass` object and a void pointer to extra data that the caller supplies to the function.
851851
852-
*pContext*<br/>
852+
*pContext*\
853853
Points to optional data that the caller can supply to the iteration function. This pointer can be NULL.
854854
855855
### Remarks
@@ -881,10 +881,10 @@ void AfxDoForAllObjects(
881881

882882
### Parameters
883883

884-
*pfn*<br/>
884+
*pfn*\
885885
Points to an iteration function to execute for each object. The function arguments are a pointer to a `CObject` and a void pointer to extra data that the caller supplies to the function.
886886

887-
*pContext*<br/>
887+
*pContext*\
888888
Points to optional data that the caller can supply to the iteration function. This pointer can be NULL.
889889

890890
### Remarks
@@ -902,5 +902,5 @@ Stack, global, or embedded objects are not enumerated. The pointer passed to `Af
902902

903903
## See also
904904

905-
[Macros and Globals](mfc-macros-and-globals.md)<br/>
905+
[Macros and Globals](mfc-macros-and-globals.md)\
906906
[CObject::Dump](cobject-class.md#dump)

0 commit comments

Comments
 (0)