| 代码: |
#include #include #include void trace(const char* aMsg) { FILE* file = fopen("c:\debug.log", "a+"); fwrite(aMsg, sizeof(char), strlen(aMsg), file); fclose(file); } void trace(const TDesC& aMsg) { FILE* file = fopen("c:\debug.log", "a+"); fwrite(aMsg.Ptr(), sizeof(int), aMsg.Length(), file); fclose(file); } |
| 代码: |
SYSTEMINCLUDE epoc32includelibc LIBRARY estlib.lib |
| 代码: |
CloseSTDLIB(); |
| 代码: |
#include public: void println(const TDesC& aMsg); private: CConsoleBase* iConsole; |
| 代码: |
void CMyView::println(const TDesC& aMsg) { iConsole->Printf(aMsg); } void CMyView::ConstructL(const TRect& aRect) { iConsole = Console::NewL(_L("MyConsole"), TSize(KConsFullScreen, KConsFullScreen)); ... } void CMyView::~CMyView() { ... delete iConsole; } |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10294527/viewspace-126388/ ,如需转载,请注明出处,否则将追究法律责任。