共用方式為


CDumpContext::operator <<

CDumpContext&operator<<(constCObject*pOb);
throw(CFileException);

CDumpContext&operator<<(constCObject&ob);
throw(CFileException);

CDumpContext&operator<<(LPCTSTRlpsz**);**
throw(CFileException);

CDumpContext&operator<<(constvoid*lp);
throw(CFileException);

CDumpContext&operator<<(BYTEby**);**
throw(CFileException);

CDumpContext&operator<<(WORDw**);**
throw(CFileException);

CDumpContext&operator<<(DWORDdw**);**
throw(CFileException);

CDumpContext&operator<<(intn**);**
throw(CFileException);

CDumpContext&operator<<(doubled**);**
throw(CFileException);

CDumpContext&operator<<(floatf**);**
throw(CFileException);

CDumpContext&operator<<(LONGl**);**
throw(CFileException);

CDumpContext&operator<<(UINTu**);**
throw(CFileException);

CDumpContext&operator<<(LPCWSTRlpsz**);**
throw(CFileException);

CDumpContext&operator<<(LPCSTRlpsz**);**
throw(CFileException);

Return Value

A CDumpContext reference. Using the return value, you can write multiple insertions on a single line of source code.

Remarks

Outputs the specified data to the dump context.

The insertion operator is overloaded for CObject pointers as well as for most primitive types. A pointer to character results in a dump of string contents; a pointer to void results in a hexadecimal dump of the address only.

If you use the IMPLEMENT_DYNAMIC or IMPLEMENT_SERIAL macro in the implementation of your class, then the insertion operator, through CObject::Dump, will print the name of your CObject-derived class. Otherwise, it will print CObject. If you override the Dump function of the class, then you can provide a more meaningful output of the object’s contents instead of a hexadecimal dump.

Example

//example for CDumpContext::operator <<
extern CObList li;
CString s = "test";
int i = 7;
long lo = 1000000000L;
afxDump << "list=" << &li << "string="
        << s << "int=" << i << "long=" << lo << "\n";

CDumpContext OverviewClass MembersHierarchy Chart