00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00023 #include "publishpe.h"
00024
00025 LOCAL_D CConsoleBase* console;
00026
00027 void DoExampleL()
00028 {
00029 console->Printf(KTxtPEPublish);
00030 RProperty myProperty;
00031
00032
00033 User::LeaveIfError(RProperty::Define(KMyPropertyCat, KMyPropertyName,RProperty::EInt,KAllowAllPolicy,KAllowAllPolicy));
00034 User::LeaveIfError(myProperty.Attach(KMyPropertyCat,KMyPropertyName,EOwnerThread));
00035
00036
00037 TInt value;
00038
00039
00040 for(TInt ix = 0; ix <= KMax ; ix += 20)
00041 {
00042 User::After(KTimeInterval);
00043
00044
00045
00046 value = Math::Random();
00047 console->Printf(KTxtInt,value);
00048 User::LeaveIfError(myProperty.Set(value));
00049 }
00050
00051
00052 myProperty.Close();
00053
00054
00055 User::LeaveIfError(RProperty::Delete(KMyPropertyCat,KMyPropertyName));
00056 }
00057
00058 GLDEF_C TInt E32Main()
00059 {
00060 __UHEAP_MARK;
00061 CTrapCleanup* cleanup = CTrapCleanup::New();
00062
00063 TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize(KConsFullScreen,KConsFullScreen)));
00064 if (createError)
00065 return createError;
00066
00067 TRAPD(mainError, DoExampleL());
00068 if (mainError)
00069 console->Printf(KTextFailed, mainError);
00070 console->Printf(KTextPressAnyKey);
00071 console->Getch();
00072
00073 delete console;
00074 delete cleanup;
00075 __UHEAP_MARKEND;
00076 return KErrNone;
00077 }