<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - need help regarding how to print to console I tried.................. - Comments</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried</link>
 <description>Comments for &quot;need help regarding how to print to console I tried..................&quot;</description>
 <language>en</language>
<item>
 <title>Re: how to find if instance of a class is prsnt</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comment-40937</link>
 <description>&lt;p&gt;Thanx  Niel for your help&lt;br /&gt;
    I was able to print to console with the following code&lt;br /&gt;
   ------------------------------------------------------------------------&lt;br /&gt;
   in &quot;.h file&quot;-&gt;&lt;br /&gt;
----------------------------------&lt;br /&gt;
      #include &lt; e32base.h&gt;&lt;br /&gt;
     #include &lt; e32cons.h&gt;&lt;/p&gt;

&lt;p&gt;    in the &quot;cpp file&quot;&lt;br /&gt;
-----------------------------------&lt;br /&gt;
                                                               _LIT(KFileStorePresent,&quot;FileStore Present\n\n&quot;);&lt;br /&gt;
                                                               _LIT(KNoFileStore,&quot;FileStore Not Present\n\n&quot;); &lt;br /&gt;
                                                               CConsoleBase *console;&lt;br /&gt;
			if(ETrue)&lt;br /&gt;
				{&lt;br /&gt;
				console=Console::NewL(KFileStorePresent,TSize        &lt;br /&gt;
                                                                                                      (KConsFullScreen,KConsFullScreen));&lt;br /&gt;
			                     CleanupStack::PushL(console);&lt;br /&gt;
				console-&gt;Printf(KFileStorePresent);&lt;br /&gt;
				}&lt;br /&gt;
			else&lt;br /&gt;
				{&lt;br /&gt;
				console=Console::NewL(KNoFileStore,TSize&lt;br /&gt;
                                                                                                      (KConsFullScreen,KConsFullScreen));&lt;br /&gt;
			                     CleanupStack::PushL(console);&lt;br /&gt;
				console-&gt;Printf(KNoFileStore);&lt;br /&gt;
				}&lt;br /&gt;
		                  console-&gt;Getch();&lt;br /&gt;
		                 CleanupStack::PopAndDestroy();&lt;/p&gt;

&lt;p&gt;There is no need of&lt;br /&gt;
               LOCAL_C void MainL(void);&lt;/p&gt;

&lt;p&gt;                GLDEF_C TInt E32Main();&lt;br /&gt;
  &lt;br /&gt;
                          methods.&lt;br /&gt;
           in fact including them gives errors.&lt;/p&gt;

&lt;p&gt;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&lt;/p&gt;

&lt;p&gt;          But I again have problems&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;/p&gt;

&lt;p&gt;                         Ttest3FileManager iFileStore;&lt;br /&gt;
                          if(iFileStore)    //this causes error&lt;br /&gt;
                              {&lt;br /&gt;
                                ------&lt;br /&gt;
                               --------&lt;br /&gt;
                              }&lt;br /&gt;
         &lt;/p&gt;

&lt;p&gt;     So, how to chek if instance of a class is present or not?????????????&lt;/p&gt;</description>
 <pubDate>Mon, 29 Sep 2008 15:15:12 +0200</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">comment 40937 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: need help ..................</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comment-40974</link>
 <description>&lt;p&gt;Ok, &lt;br /&gt;
       Mr.rb runner ,    I read your postings again&lt;br /&gt;
                    and remembered&lt;br /&gt;
           &quot;such testing can be used with pointer variables only.&quot;&lt;br /&gt;
      &lt;br /&gt;
        I got my error.&lt;/p&gt;

&lt;p&gt;       Ttest3FileManager iFileStore;&lt;/p&gt;

&lt;p&gt;      If I declare it as &lt;/p&gt;

&lt;p&gt;              Ttest3FileManager* iFileStore;&lt;/p&gt;

&lt;p&gt;     the if statement runs.&lt;/p&gt;

&lt;p&gt;         I have also got another error in the file where I am storing data.&lt;/p&gt;

&lt;p&gt;          The file is stored with multiple names like......................&lt;br /&gt;
           settings.txt&lt;br /&gt;
           settings.txtsettings.txt&lt;br /&gt;
          ..........................................................................&lt;br /&gt;
         &lt;/p&gt;

&lt;p&gt;         I ve found the cause of this also,&lt;br /&gt;
                    I used the code&lt;/p&gt;

&lt;p&gt;                     _LIT(KSettingsFile, &quot;settings.txt&quot;);&lt;/p&gt;

&lt;p&gt;                     void Ctest3AppUi::CreateDialog()&lt;br /&gt;
	{&lt;br /&gt;
	User::LeaveIfError(iEikonEnv-&gt;FsSession().CreatePrivatePath(EDriveC));&lt;br /&gt;
	User::LeaveIfError(iEikonEnv-&gt;FsSession().SetSessionToPrivate(EDriveC));&lt;br /&gt;
	&lt;br /&gt;
	iSettingsFile.Append(KSettingsFile);&lt;br /&gt;
	&lt;br /&gt;
	InternalizeKSettingsFileToTtest3FileManagerL();&lt;br /&gt;
	&lt;br /&gt;
	if(Ctest3dialog::RunDlgLD(this,iFileStore))&lt;br /&gt;
		{&lt;br /&gt;
		ExternalizeKSettingsFileToTtest3FileManagerL();&lt;br /&gt;
		};&lt;br /&gt;
		&lt;br /&gt;
	}&lt;br /&gt;
                  &lt;/p&gt;

&lt;p&gt;        Now I incuded another 2 lines&lt;/p&gt;

&lt;p&gt;                     _LIT(KNULL,&quot;&quot;);&lt;br /&gt;
                  iSettingsFile=KNULL;&lt;/p&gt;

&lt;p&gt;and the new code is like this............................&lt;/p&gt;

&lt;p&gt; _LIT(KNULL,&quot;&quot;);&lt;br /&gt;
 _LIT(KSettingsFile, &quot;settings.txt&quot;);&lt;/p&gt;

&lt;p&gt;void Ctest3AppUi::CreateDialog()&lt;br /&gt;
	{&lt;br /&gt;
	User::LeaveIfError(iEikonEnv-&gt;FsSession().CreatePrivatePath(EDriveC));&lt;br /&gt;
	User::LeaveIfError(iEikonEnv-&gt;FsSession().SetSessionToPrivate(EDriveC));&lt;br /&gt;
	&lt;br /&gt;
	iSettingsFile.Append(KSettingsFile);&lt;br /&gt;
	&lt;br /&gt;
	InternalizeKSettingsFileToTtest3FileManagerL();&lt;br /&gt;
	&lt;br /&gt;
	if(Ctest3dialog::RunDlgLD(this,iFileStore))&lt;br /&gt;
		{&lt;br /&gt;
		ExternalizeKSettingsFileToTtest3FileManagerL();&lt;br /&gt;
		};&lt;br /&gt;
		iSettingsFile=KNULL;&lt;br /&gt;
	}&lt;/p&gt;

&lt;p&gt;          &lt;/p&gt;

&lt;p&gt;      Now i get only one file named &quot;settings.txt&quot;&lt;/p&gt;

&lt;p&gt;     Now I am trying with the previous approach.......................&lt;br /&gt;
     Think   it should work........&lt;br /&gt;
      Thanks to every one&lt;/p&gt;</description>
 <pubDate>Mon, 29 Sep 2008 15:12:09 +0200</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">comment 40974 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: need help ..................</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comment-40998</link>
 <description>&lt;p&gt;the previous approach is working!!!!!!!!!!!!!&lt;br /&gt;
   and this approach is better because it requires less streams and files&lt;br /&gt;
        AND SO LESS MEMORY&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Fri, 24 Aug 2007 12:43:53 +0200</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">comment 40998 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: need help..................</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comment-40971</link>
 <description>&lt;p&gt;Thanx to Mr. rbrunner for your suggestions::&lt;/p&gt;

&lt;p&gt;                          I have changed the previous approach of writing to same stream from 2 different places.&lt;br /&gt;
                          Now I am using 2 different streams.&lt;br /&gt;
                          The code now works fine.........&lt;/p&gt;

&lt;p&gt;                          &lt;/p&gt;

&lt;p&gt;                        In the previous case, I got erors on the linethat I have commented &lt;br /&gt;
                                  &lt;/p&gt;

&lt;p&gt;                                              Ttest3FileManager iFileStore;&lt;br /&gt;
                                              if(iFileStore) //.............................................................this causes compiler error&lt;br /&gt;
                                                  {&lt;br /&gt;
                                                     ------&lt;br /&gt;
                                                    --------&lt;br /&gt;
                                                  }&lt;/p&gt;

&lt;p&gt;                       I found it strange to be getting errors there!!!!!!!!&lt;br /&gt;
                        The code ran fine when I replaced &quot;iFileStore&quot; with &quot;ETrue&quot;&lt;br /&gt;
                          Then I thought that there must be some special usage with &quot;TClasses&quot;&lt;/p&gt;

&lt;p&gt;                     ANY WAY I  HAVE CHANGED MY APPROACH   ALTOGETHER AND NOW CODE RUNS FINE!!!&lt;/p&gt;

&lt;p&gt;                        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&lt;br /&gt;
                        X         SPECIAL THANX TO        MR BUTTINGTON        FOR HIS COMMENTS!!!!!!!!!!!!!!!!!!!!!!!!!!!!             X&lt;br /&gt;
                       XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&lt;/p&gt;</description>
 <pubDate>Fri, 24 Aug 2007 07:10:54 +0200</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">comment 40971 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: need help regarding how to print to console I tried</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comment-40969</link>
 <description>&lt;p&gt;&quot;On two occasions I have been asked (by members of Parliament!): &#039;Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?&quot; I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question&quot;.&lt;/p&gt;

&lt;p&gt;Charles Babbage&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
 <pubDate>Fri, 24 Aug 2007 03:05:23 +0200</pubDate>
 <dc:creator>Mr. Buttington F. Phucque Lewis</dc:creator>
 <guid isPermaLink="false">comment 40969 at http://www.newlc.com</guid>
</item>
<item>
 <title>Objects</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comment-40959</link>
 <description>&lt;p&gt;No idea what you are talking about.&lt;/p&gt;

&lt;p&gt;Probably you should tell more about your problem, and also show some parts of your code. If you say &quot;it does not work in the other&quot;, well, what happens?&lt;/p&gt;

&lt;p&gt;If you have a pointer variable it is NULL if there is no object allocated and not NULL if the variable holds a pointer to an allocated object. But I am pretty sure that you know this already, and that you have some other problem, I just don&#039;t know what it is.&lt;/p&gt;

&lt;p&gt;It might also help to be more precise when using the word &quot;class&quot;. You say &quot;the class holding the data&quot;. Sorry, a class cannot hold data. An instance of a class, i.e. an object can hold data, but not the class itself...&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Thu, 23 Aug 2007 13:39:56 +0200</pubDate>
 <dc:creator>rbrunner</dc:creator>
 <guid isPermaLink="false">comment 40959 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: need ...............................</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comment-40955</link>
 <description>&lt;p&gt;I do not want to free any objects,&lt;br /&gt;
              I want to write members of a class into stream from 2 different places in the program. It works good at one point but does not work in the other.&lt;br /&gt;
             So, I am Checking if the class holding the data to be stored is still active.&lt;/p&gt;

&lt;p&gt;     So, the point is just to check if the instance of  the class is present??&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Thu, 23 Aug 2007 12:07:29 +0200</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">comment 40955 at http://www.newlc.com</guid>
</item>
<item>
 <title>Objects</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comment-40954</link>
 <description>&lt;p&gt;No, I am pretty sure that the Symbian framework does not offer some general mechanism to free objects, e.g. a pool that keeps all your objects and that you can query &quot;Which objects are still there that I allocated?&quot;&lt;/p&gt;

&lt;p&gt;You have to keep track of each and every object that you allocate yourself and make sure that you free it accordingly. But I think you will see that this is not as hard as it may first sound &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;/p&gt;</description>
 <pubDate>Thu, 23 Aug 2007 11:51:25 +0200</pubDate>
 <dc:creator>rbrunner</dc:creator>
 <guid isPermaLink="false">comment 40954 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: need ...............................</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comment-40953</link>
 <description>&lt;p&gt;&lt;br /&gt;
   Yes you have got it right.&lt;br /&gt;
    But is there no other way of testing it programatically???????&lt;/p&gt;</description>
 <pubDate>Thu, 23 Aug 2007 11:45:54 +0200</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">comment 40953 at http://www.newlc.com</guid>
</item>
<item>
 <title>Objects</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comment-40952</link>
 <description>&lt;p&gt;I am afraid I don&#039;t understand your question. How can a class be &quot;running&quot; or &quot;alive&quot;?&lt;/p&gt;

&lt;p&gt;You mean how to know whether you still have instances/objects of a certain class allocated in your program that you need to free before terminating the program? If yes: Well, you have to keep track yourself about the objects in your program...&lt;/p&gt;</description>
 <pubDate>Thu, 23 Aug 2007 11:39:24 +0200</pubDate>
 <dc:creator>rbrunner</dc:creator>
 <guid isPermaLink="false">comment 40952 at http://www.newlc.com</guid>
</item>
<item>
 <title>how to find if instance of a class is present</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comment-40948</link>
 <description>&lt;p&gt;  Sorry,&lt;br /&gt;
       I meant to find out&lt;br /&gt;
                if instance of a general class is still running i.e. a class is still alive in the program?????????????&lt;br /&gt;
       &lt;/p&gt;</description>
 <pubDate>Thu, 23 Aug 2007 11:23:58 +0200</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">comment 40948 at http://www.newlc.com</guid>
</item>
<item>
 <title>Check for object present in store</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comment-40939</link>
 <description>&lt;p&gt;&lt;div class=&quot;bb-quote&quot;&gt;&lt;blockquote class=&quot;bb-quote-body&quot;&gt;So, how to chek if instance of a class is present or not?????????????&lt;/blockquote&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Do you mean that you want to look into the filestore and check whether a certain object is present or not? If yes, I don&#039;t know of any other way than writing additional information into the store when creating it.&lt;/p&gt;

&lt;p&gt;Meaning: If a certain object can be present or missing, do not only write the object itself into the store, but write an additional, separate boolean *before* the object that basically says &quot;Object present?&quot;. Reading then becomes trivial: Read the boolean, if it is false, stop, if it is true, continue to read the object.&lt;/p&gt;</description>
 <pubDate>Thu, 23 Aug 2007 10:41:46 +0200</pubDate>
 <dc:creator>rbrunner</dc:creator>
 <guid isPermaLink="false">comment 40939 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: need help regarding how to print to console I tried.........</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comment-40932</link>
 <description>&lt;p&gt;you need to construct console for that . Below is a rough example(note: I havent tested it though)&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;#include &amp;lt;e32base.h&amp;gt;&lt;br /&gt;#include &amp;lt;e32cons.h&amp;gt;&lt;br /&gt;&lt;br /&gt;LOCAL_C void MainL(void);&lt;br /&gt;&lt;br /&gt;GLDEF_C TInt E32Main()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CTrapCleanup* cleanup=CTrapCleanup::New();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRAPD(error,MainL());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete cleanup;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;_LIT(KHello,&amp;quot;Hello&amp;quot;);&lt;br /&gt;LOCAL_C void MainL(void)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CConsoleBase *console=Console::NewL(KHello,TSize(KConsFullScreen,KConsFullScreen));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CleanupStack::PushL(console);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; console-&amp;gt;Printf(KHello);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; console-&amp;gt;Getch();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CleanupStack::PopAndDestroy();&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Try to implement a similar thing for your code so that you might get the grasp of it faster.&lt;/p&gt;

&lt;p&gt;Hope it helps&lt;br /&gt;
Good Luck and Cheers&lt;br /&gt;
Neil&lt;/p&gt;</description>
 <pubDate>Thu, 23 Aug 2007 08:42:25 +0200</pubDate>
 <dc:creator>Symbian_Neil</dc:creator>
 <guid isPermaLink="false">comment 40932 at http://www.newlc.com</guid>
</item>
<item>
 <title>need help regarding how to print to console I tried..................</title>
 <link>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried</link>
 <description>&lt;p&gt;I tried the following code.......&lt;/p&gt;

&lt;p&gt;         Ttest3FileManager iFileStore;&lt;/p&gt;

&lt;p&gt;       _LIT(KFileStorePresent,&quot;FileStore Present\n\n&quot;);&lt;br /&gt;
        _LIT(KNoFileStore,&quot;FileStore Not Present\n\n&quot;); &lt;br /&gt;
 &lt;/p&gt;

&lt;p&gt;            if(iFileStore)&lt;br /&gt;
				{&lt;br /&gt;
				console-&gt;Printf(KFileStorePresent);&lt;br /&gt;
			    console-&gt;Getch();&lt;br /&gt;
				}&lt;br /&gt;
			else&lt;br /&gt;
				{&lt;br /&gt;
				console-&gt;Printf(KNoFileStore);&lt;br /&gt;
			    console-&gt;Getch();&lt;br /&gt;
				}&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/en/forum/need-help-regarding-how-print-console-i-tried#comments</comments>
 <category domain="http://www.newlc.com/en/forums/symbian-c">Symbian C++</category>
 <pubDate>Thu, 23 Aug 2007 08:22:06 +0200</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">18725 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
