<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1940111982610564587</id><updated>2012-02-02T08:23:24.603+06:00</updated><category term='C++'/><category term='Porting'/><category term='OO Design'/><category term='Technical'/><category term='Console App'/><category term='S60 3rd'/><category term='S60 2nd'/><category term='Symbian'/><title type='text'>মুখোশে মেফিস্টোফিলিস</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>45</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-5461933527070420915</id><published>2011-05-26T01:23:00.003+06:00</published><updated>2011-05-26T01:40:43.354+06:00</updated><title type='text'>boost c++ library for mac OS X</title><content type='html'>Just tried out boost c++ library with eclipse c++ for mac OS X. The procedure is as follows:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have used this boost library for mac OS X.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. &lt;a href="https://docs.google.com/leaf?id=0B9BzFgqRLt2VNjIwY2E4MzUtZDM3OS00ZmU0LTkzOTEtOGM1YmRmMzE4MzY1&amp;amp;hl=en_US&amp;amp;authkey=CPzV_PUM"&gt;Download&lt;/a&gt; the library.&lt;/div&gt;&lt;div&gt;2. unpack it. &lt;/div&gt;&lt;div&gt;3. run sudo ./bootstrap.sh&lt;/div&gt;&lt;div&gt;4. run sudo ./bjam architecture=x86 address-model=32_64 &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;please note the command options. For the latest gcc (4.2.1) you need to explicitly state the address-model. Otherwise you will get linker error while trying to use any binary libraries of boost.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5. In Eclipse, go to project --&amp;gt; properties --&amp;gt; C/C++ build --&amp;gt;Settings &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;a) In Mac OS X C++ Linker --&amp;gt; Libraries --&amp;gt; Libraries(-l) add the library names without the prefix "lib" and suffix ".dy.lib" . So, if you are using libboost_system.dy.lib then add "boost_system".&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;b) In Mac OS X C++ Linker --&amp;gt; Libraries --&amp;gt; Library Search Path (-L)  add the boost c++ installation library folder (e.g. "add /usr/local/boost_1_46_1/lib") .&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;6. Go to project--&amp;gt;Properties--&amp;gt; C/C++ build--&amp;gt;Settings --&amp;gt; GCC C++ Compiler--&amp;gt;Directories--&amp;gt;Include Paths (-I) and add the boost c++ installation folder there.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then compile and run a code using boost c++ binary library.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-5461933527070420915?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/5461933527070420915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=5461933527070420915' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/5461933527070420915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/5461933527070420915'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2011/05/boost-c-library-for-mac-os-x.html' title='boost c++ library for mac OS X'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-7101934902886210620</id><published>2011-05-19T08:09:00.001+06:00</published><updated>2011-05-19T08:10:58.528+06:00</updated><title type='text'>A very small but good tutorial on thread safety in C++</title><content type='html'>&lt;a href="https://cwiki.apache.org/qpid/cpptips.html"&gt;Here it is&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-7101934902886210620?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/7101934902886210620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=7101934902886210620' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/7101934902886210620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/7101934902886210620'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2011/05/very-small-but-good-tutorial-on-thread.html' title='A very small but good tutorial on thread safety in C++'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-5149467295184127958</id><published>2011-01-06T23:33:00.006+06:00</published><updated>2011-01-07T00:02:00.774+06:00</updated><title type='text'>Elegance of STL</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_WYKEhPq_evM/TSYDcCkugzI/AAAAAAAABLo/UQVKG7yWXCI/s1600/01.06.2011.1.png"&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_WYKEhPq_evM/TSYDNC1QaYI/AAAAAAAABLg/ftW3SKIIg0E/s1600/01.06.2011.1.png"&gt;&lt;/a&gt;What could be a simple example as an answer to the question "Why anyone should use STL?" I think the answer should be given in a comparative way. Lets say, someone asks you to &lt;div&gt;"take some unknown number integers as input. Then shuffle the integers and then print those back as output".&lt;div&gt;Without using STL , the whole thing would be messy (kindof). You will have to take the integers from standard input until &lt;b&gt;&lt;i&gt;eof&lt;/i&gt;&lt;/b&gt; is reached, then you will have to manually write a shuffle function to shuffle them and then you will have to print those back to the output. Someone with a little C++ experience can discern how many lines of code he has to write. But with STL, the same thing can be done in pretty elegant and clean way.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Take a std::istream_iterator&lt;int&gt; (cin) which iterates on inputs taken from cin&lt;/int&gt;&lt;/div&gt;&lt;div&gt;2. take a vector&lt;int&gt; where you will have to copy all the integers from cin iterator&lt;/int&gt;&lt;/div&gt;&lt;div&gt;3. Copy the whole input stream iterated values into the vector using std::copy();&lt;/div&gt;&lt;div&gt;4. use std::random_shuffle() function to shuffle them&lt;/div&gt;&lt;div&gt;5. copy the vector with shuffled numbers back to ostream_iterator&lt;int&gt; (cout) where those will be printed out with given delimiter.&lt;/int&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The code looks like this :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;i&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-style: normal; color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_WYKEhPq_evM/TSYDcCkugzI/AAAAAAAABLo/UQVKG7yWXCI/s400/01.06.2011.1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5559134570297590578" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 193px; " /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: normal; color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: normal; color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-5149467295184127958?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/5149467295184127958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=5149467295184127958' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/5149467295184127958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/5149467295184127958'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2011/01/elegance-of-stl.html' title='Elegance of STL'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_WYKEhPq_evM/TSYDcCkugzI/AAAAAAAABLo/UQVKG7yWXCI/s72-c/01.06.2011.1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-6187752665106773726</id><published>2011-01-05T09:07:00.003+06:00</published><updated>2011-01-05T09:24:15.815+06:00</updated><title type='text'>Boost C++ . 01.05.2011</title><content type='html'>I am using Boost C++ 1_35_0 with VS 2008 (vs9). Here are some quick starting comments.&lt;br /&gt;&lt;br /&gt;-&gt; you wont have to build boost libraries unless you are using a legacy IDE or commadn line tools. If you are using VS9, it is pretty straight forward. There are two kinds of libraries in boost:&lt;br /&gt;&lt;br /&gt;        1. Header only libraries (all the code is inline, and put into the header (.hpp) file). So, merely including the .hpp file into your code is enough. For this you have to follow the standard include directory adding process (go to &lt;em style="font-weight: bold;"&gt;Configuration Properties&lt;/em&gt;&lt;span style="font-weight: bold;"&gt; &gt; &lt;/span&gt;&lt;em style="font-weight: bold;"&gt;C/C++&lt;/em&gt;&lt;span style="font-weight: bold;"&gt; &gt; &lt;/span&gt;&lt;em style="font-weight: bold;"&gt;General&lt;/em&gt;&lt;span style="font-weight: bold;"&gt; &gt; &lt;/span&gt;&lt;em style="font-weight: bold;"&gt;Additional Include Directories&lt;/em&gt; put the boost directory address in the field )&lt;br /&gt;&lt;br /&gt;        2. There are some libraries for which are binaries (i.e boost.regex). If you want to use any of those, just follow the standard library adding procedure in VS9 ( the boost\lib full directory path either in &lt;em style="font-weight: bold;"&gt;Configuration Properties&lt;/em&gt;&lt;span style="font-weight: bold;"&gt; &gt; &lt;/span&gt;&lt;em style="font-weight: bold;"&gt;Linker&lt;/em&gt;&lt;span style="font-weight: bold;"&gt; &gt; &lt;/span&gt;&lt;em style="font-weight: bold;"&gt;Additional Library Directories&lt;/em&gt;&lt;span style="font-weight: bold;"&gt;, &lt;/span&gt;or in &lt;em style="font-weight: bold;"&gt;Configuration Properties&lt;/em&gt;&lt;span style="font-weight: bold;"&gt; &gt; &lt;/span&gt;&lt;em style="font-weight: bold;"&gt;C/C++&lt;/em&gt;&lt;span style="font-weight: bold;"&gt; &gt; &lt;/span&gt;&lt;em style="font-weight: bold;"&gt;General&lt;/em&gt;&lt;span style="font-weight: bold;"&gt; &gt; &lt;/span&gt;&lt;em style="font-weight: bold;"&gt;Additional Include Directories, &lt;/em&gt;&lt;em&gt;&lt;span style="font-style: italic;"&gt;both worked for me &lt;/span&gt;&lt;/em&gt; ).&lt;br /&gt;&lt;br /&gt;But if you are going any other way around (if you want to build the boost source instead of installing the boost binaries, or if you are using an earlier visual studio IDE), then you have to do some housekeeping work(see 5.2 and 5.3 from &lt;a href="http://www.boost.org/doc/libs/1_45_0/more/getting_started/windows.html"&gt;here&lt;/a&gt;). Further if you want to use boost libraries on unix systems then you have to follow &lt;a href="http://www.boost.org/doc/libs/1_45_0/more/getting_started/unix-variants.html"&gt;these&lt;/a&gt; rules.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-6187752665106773726?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/6187752665106773726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=6187752665106773726' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6187752665106773726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6187752665106773726'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2011/01/boost-c-01052011.html' title='Boost C++ . 01.05.2011'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-8254750120080929584</id><published>2011-01-04T09:42:00.004+06:00</published><updated>2011-01-05T01:40:34.094+06:00</updated><title type='text'>Nokia QT</title><content type='html'>I have just started using the QT creator for building applications in QT for Nokia. As a first step, I am not using any wizard kind of stuff which provides initial framework code. Just one thing I have noted this far - the folder where you are are putting your project files in, should not contain any special characters(I ran into problem with space). Other than that, building a project is really easy:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;New Project-&gt; Other Project-&gt; Empty QT Project&lt;/div&gt;&lt;div&gt;Add a .c++ file to it, add your simple code. and then run the makefile for the project. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-8254750120080929584?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/8254750120080929584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=8254750120080929584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/8254750120080929584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/8254750120080929584'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2011/01/nokia-qt.html' title='Nokia QT'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-209279261998586909</id><published>2010-10-21T05:20:00.005+06:00</published><updated>2010-10-21T05:32:00.658+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Detect memory leaks in debug mode in VC++ 2005</title><content type='html'>The main tutorial is &lt;a href="http://msdn.microsoft.com/en-us/library/e5ewb1h3(VS.80).aspx"&gt;here&lt;/a&gt;. However, I have tried it out, so one can just follow the following steps&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. In Project-&gt; Properties-&gt; Configuration Properties-&gt; C/C++ -&gt; Preprocessor -&gt; PreProcesor Definitions , append the two lines  &lt;i&gt;_DEBUG;_CRTDBG_MAP_ALLOC&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2.Include the libraries &lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;i&gt; #include stdlib.h&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt; #include crtdbg.h&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. Add the following lines at the beginning of you program. These will enable showing the file name and line number of the memory leak.&lt;/div&gt;&lt;div&gt;&lt;i&gt;#ifdef _DEBUG&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;#define new DEBUG_NEW&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;#endif&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4. Add the following line at the beginning of main function :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF);&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. This system will detect memory leak in the code that is in another file. &lt;/div&gt;&lt;div&gt;2. Do not use the &lt;span class="Apple-style-span" style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px; "&gt;_CrtDumpMemoryLeaks(); &lt;/span&gt;function. Because this function wont be able to detect the destruction of automatic variables which are done just before the program exits. Doing just the above 4 steps will be enough.  &lt;span class="Apple-style-span" style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px; "&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-209279261998586909?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/209279261998586909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=209279261998586909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/209279261998586909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/209279261998586909'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2010/10/detect-memory-leaks-in-debug-mode-in-vc.html' title='Detect memory leaks in debug mode in VC++ 2005'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-829166050134961997</id><published>2010-06-19T03:00:00.006+06:00</published><updated>2010-10-19T23:08:22.202+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OO Design'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>OO design &amp; C++ buzzwords - 3</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Czafar%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5Czafar%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5Czafar%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} a:link, span.MsoHyperlink 	{mso-style-priority:99; 	color:blue; 	mso-themecolor:hyperlink; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{mso-style-noshow:yes; 	mso-style-priority:99; 	color:purple; 	mso-themecolor:followedhyperlink; 	text-decoration:underline; 	text-underline:single;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page WordSection1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.WordSection1 	{page:WordSection1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;16.RTTI&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               RTTI means run-time type identification. It is a form of dynamic type checking or dynamic typing. Dynamic type checking is specially discouraged because with dynamic type checking code is used to find code which creates extensibility problems later on.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               Dynamic type checking can be done in a number of ways. We will present two of the ways.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               1. Using explicit class identifiers to check whether a class is of a specific type.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               2. Using dynamic_cast to identify whether an object referred by the base class reference actually is an object of a particular subtype. The dynamic cast is a compiler provided infrastructure to downcast an object by its pointer. (This means getting the derived class object from the base class pointer or reference pointing to that object.) RTTI.cpp&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;Note that upcasting is always automatic; we don’t have to use any explicit casting mechanism to impose upcasting. But downcasting is not.&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;17.Static type checking / Static Typing&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;Static typing means when  the compiler statically checks the object to determine whether the function being called on the object is a valid statement or not&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;Class CBase{&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;Public:&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               Void f();&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;};&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;Int main()&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;Cbase x;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;x.f(); // here compiler does the static type checking&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;18.Down casting&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;Casting a Base class reference or pointer to a derived class reference or a pointer. There are two ways to do that : either by using old c-style cast (RTTI.cpp), or by using dynamic_cast(Downcast.cpp). The program that uses the downcasting infrastructure of the mentioned kind is subject to error and non-extensible. Addition of new type generates a ripple effect which needs updating of a lot of code.&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;19.Dynamic Typing/Dynamic Type Checking&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;This is what happens when a base class reference is used to call the appropriate derived class virtual function.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color:black;"&gt;C++ compiler automatically does that for the developer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color:black;"&gt;However, programmers can go around this OO feature and deploy their own dynamic type checking scheme as mentioned in the FAQ 16.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;20.Places where dynamic type checking is necessary&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;There are some cases where dynamic/runtime  type checking (explicitly downcasting,, capability query etc) is necessary. One example case is that when objects are de-serialized from persistent storage. So, when we have to construct an object from its serialized form, we have to do dynamic type checking.&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;21.Alternative to downcasting&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;Using virtual functions to call appropriate version of the function.&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;22.Dynamic_cast&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;Dynamic cast is a newer version of old C-Style cast. So, in broad sense it means that the dynamic casting casts the value of object x to its type T. Here T is normally a pointer or a reference of the same class. Dynamic casting is pretty much the same thing as the old-style casting. However, it provides some extra features, like returning NULL if the the value &lt;span style=""&gt; &lt;/span&gt;we are trying to cast to the type is not actually of the same type.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;So, dynamic casts return NULL if the conversion is not valid.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:10pt;"&gt;CMyClass* q = &lt;span style="color:blue;"&gt;dynamic_cast&lt;/span&gt;&lt;cmyclass*&gt;(aMyClass);&lt;o:p&gt;&lt;/o:p&gt;&lt;/cmyclass*&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:10pt;"&gt;CMyClass&amp;amp; q = &lt;span style="color:blue;"&gt;dynamic_cast&lt;/span&gt;&lt;cmyclass&amp;amp;&gt;(aMyClass);&lt;o:p&gt;&lt;/o:p&gt;&lt;/cmyclass&amp;amp;&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;23.Can a function be able to throw more than one exception and how &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color:black;"&gt;Yes it can. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color:black;"&gt;A function  can be able to throw more than one exception.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;color:blue;"&gt;void&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;"&gt; MyClassFunc() &lt;span style="color:blue;"&gt;throw&lt;/span&gt;(&lt;span style="color:blue;"&gt;int&lt;/span&gt;,&lt;span style="color:blue;"&gt;char&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;"&gt;&lt;span style=""&gt;      &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: 0.5in; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;color:blue;"&gt;int&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;"&gt; y = rand();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;"&gt;&lt;span style=""&gt;            &lt;/span&gt;cout&lt;&lt;y style="color: maroon;"&gt;"\n"&lt;/y&gt;&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: 0.5in; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;color:green;"&gt;if(y &lt;&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;color:green;"&gt;&lt;span style=""&gt;                  &lt;/span&gt;throw 10;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;color:green;"&gt;&lt;span style=""&gt;            &lt;/span&gt;if(y &gt; 1000)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:10pt;color:green;"&gt;&lt;span style=""&gt;                  &lt;/span&gt;throw 'a';&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:10pt;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;24.Explicit specialization of templates &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="line-height: 115%;"&gt;it can also be called overloaded templates&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="line-height: 115%;"&gt;Templates can be used to handle special cases. The term used for this is called explicit specialization. &lt;span style=""&gt;                     &lt;/span&gt;&lt;span style=""&gt;                                                                                                                                                                                &lt;/span&gt;When we write code using class templates, we actually generalize on the type or the class on which that template will work. For example, if we write a code which does a sorting on the array of objects that will be passed at runtime, same code and algorithm is used for all of the compatible types (int,float, string, or any user defined one) that can be passed to that template. But we might want to implement a special case, i.e. for a particular type of object (say for double), we might want the internal data structure or the algorithm of the template to be special. That’s where we can use the explicit specialization of class templates &lt;span style=""&gt; &lt;/span&gt;to be used. Note that explicit specialization of function templates is not possible (To be more specific, syntactically, explicit specialization of function templates can be written, but does not make any sense semantically).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;"&gt;For reference, please look at the code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;"&gt;Please note that when implementing the explicit specialization of class templates, we have to omit the template&lt;&gt; from the beginning of the function definition. Otherwise will result in compiler error.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="line-height: 115%;font-size:9pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;25.Function Templates&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;Function templates are just cookie cutters for a generation of functions which can take any type or objects of class to work on.&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;color:blue;"&gt;template&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;"&gt;&lt;&lt;span style="color:blue;"&gt;class&lt;/span&gt; A, &lt;span style="color:blue;"&gt;class&lt;/span&gt; B&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; MyTemplateFunction(A aObj, B aAnotherObject)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;"&gt;&lt;span style=""&gt;      &lt;/span&gt;cout&lt;&lt;aobj&gt;&lt;&lt;&lt;span style="color:maroon;"&gt;" "&lt;/span&gt;&lt;&lt;aanotherobject&gt;&lt;&lt;endl;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/endl;&gt;&lt;/aanotherobject&gt;&lt;/aobj&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10pt;"&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:10pt;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;26.Remote ownership&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;When a pointer or reference to an object(which is allocated in the heap) is assigned to the data member of another object, depending on the implementation, the ownership of that object remains to the original reference/pointer or the object in which that reference or pointer has been copied to. If the programmer makes a shallow copy (just assigning the reference/pointer to the member object), then the original reference/pointer retains the ownership of the object remotely. Otherwise, the ownership is transferred to the member reference/pointer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;Here is a simple code in which the ownership is retained by the original pointer remotely.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;27.Copy on Write Semantics &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               Copy on write semantics is the principle that one can have as many read-only copies of an object as he needs. It is only when he tries to modify the&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               data inside the object, is the objects data gets actually copied into the object.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               Copy on write semantics is used by the compiler to make an API memory efficient. So, if a developer is writing an API which is going to be hard on memory(means it is goiong to use a lot of memory),he should look forward to make use of the copy on write semantics.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               There is another reason behind the copy on write semantics. That  is refenrece counting.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               C++ copy on write semantics suggests that the member objects are not copied when copy constructor or assignment operator is called. The actual values are written only when then copied or assigned object is actually tried to be modified somewhere.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               So, in the copy constructor or assignmnet operator we just update the reference count but dont copy the original data. If any mutator function is called&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               where the user is going to modify on the copied object , then we actually copy the contents of the data.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               Source &lt;a href="http://www.c2.com/cgi/wiki?CopyOnWrite"&gt;http://www.c2.com/cgi/wiki?CopyOnWrite&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;28. Final Class or Leaf Class DONE&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               Final class or leaf class is the class which cannot anymore be inherited. There is no "final" keyword in C++ which can be used to&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               mark a class as a final class. This can be done in two ways. Either by properly commenting on the code. Or by enforcing the compiler to do it.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               The way we can enforce a compiler to make a class final is - we can declare all the constructors of that class as private and provide static&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               create() fucntion (just as we have done in the names constructor idiom example) so that a class cannot derived from this class. If the constructor&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               of the class is private then the compiler prevents any other class from inheriting that class.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               We should also make the protected: member data private.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               And the class which we want to make final should not declare any new virtual functions.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height: 115%;font-size:14pt;color:red;"&gt;29. Final Member Function &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               Final member fuinctions are the functions which cannnot be overriden anymore. It means that the function was a virtual one in the base class but in the derived class it does not remain virutal anymore so that any class which derives from this class cannot override the function.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:black;"&gt;               There is no final keyword that we can use before the function declaration. We can enforce the compiler to make a function final.we can declare all the virtual functions that the class inherits from the base class non-virtual . That is we eliminate the virtual keyword from the declaration of the function.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;span style="font-style: italic; "&gt;&lt;span class="Apple-style-span" &gt;&lt;span class="Apple-style-span" &gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;b&gt;30.Hiding Rule&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;color:black;"&gt;The C++ hiding rule – if not know in advance and done accidentally or inadvertently, can confuse programmers. So, it is better to know about the hiding rule in advance.&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;color:black;"&gt;The C++ hiding rule is&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;color:black;"&gt;               An entity in the inner scope hides the entity with the same name in the outer scope&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;color:black;"&gt;An example of this can be&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;color:black;"&gt;               A function in the derived class can hide the same function on the base class&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;color:black;"&gt;Redefining a virtual function in the derived class which has the same name as the function in the base class but different signature in the derived class, hides the function in the base class&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;color:black;"&gt;Redefining a non-virtual function in the derived class where a function with the same name (but with different signature) already exists in the base class, can hide the function in the base class.&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;color:black;"&gt;As a result of this hiding rule imposed by the C++ compiler, the following confusion arises :&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;color:black;"&gt;Normally dynamic binding depends on the type of the object, not on the type of the reference used to refer that object. But if compiler imposes the hiding rule, then the dynamic binding (or a normal function call) will depend on the type of the reference, not on the type of the actual object being referred.&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;color:black;"&gt;The above statement can be examined by the HidingRule.cpp code included.&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;color:black;"&gt;So, what to do with the C++ hiding rule? Avoid causing the occurrence of hiding rule; and if the hiding rule cannot be avoided, use the following workaround.&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"&gt;&lt;br /&gt;&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-829166050134961997?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/829166050134961997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=829166050134961997' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/829166050134961997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/829166050134961997'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2010/06/oo-design-c-buzzwords-3.html' title='OO design &amp; C++ buzzwords - 3'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-3774246130406054879</id><published>2010-06-11T23:41:00.010+06:00</published><updated>2010-06-19T03:01:05.321+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OO Design'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>OO design &amp; C++ buzzwords - 2</title><content type='html'>&lt;span style="color: rgb(255, 0, 0);font-size:130%;" &gt;&lt;span style="font-weight: bold;"&gt;11.    Covariant return type [1]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Covariant return type is a C++ language feature that makes us free of all the hassles that comes with downcasting. First we give an example of what kind of hassles that we have o take in case of downcasting.&lt;br /&gt;From the code we can see that the clone function makes a copy of the object and returns it in an “upcasted” state (so, if we call the CloneMe() function from a subclass CDerived, we will have to receive  it in a CBase* and then downcast it again to get a CDerived) .&lt;br /&gt;This kind of downcasting actually can complicate things. Firstly, we have to use dynamic_cast&lt;&gt; to downcast it again to its actual type (CDerived*) from what is returned (CBase*). Secondly, we have to check it again to see whether downcast was successful or not (if CDerived is not the actual object it was cloned from?? Maybe the CloneMe was called from CDerived2 which also derives from CBase and we are trying to cast it to CDerived? In this situation, dynamic_cast&lt;&gt; will return NULL. )&lt;br /&gt;So, to relieve us, C++ has a language feature which is called Covariant return type. In that thing we can just return a CDerived* instead of a CBase* in the virtual CloneMe() function. And also we can upcast it to CBase* without any problem. The compiler does that for us.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(255, 0, 0);"&gt;12.    Maximal Munch rule&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Look at the code of MaximalMunch.cpp . The decleration of "vector&lt;vector&gt;&lt;int&gt;&gt;" will give errors in some compilers that it cannot recognize the statement construct. This is due to the absence of  a space in the underscored position (vector&lt;vector&gt;&lt;int&gt;_&gt;). This is because , the compilers tokenizer parses it to become a different operator (&gt;&gt; operator) so, the whole statement does not make any sense to the compiler.&lt;br /&gt;So, the important thing to remember is to put a space simply to make the compiler stop complaining.&lt;br /&gt;For more see &lt;a href="http://en.wikipedia.org/wiki/Maximal_munch."&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(255, 0, 0);"&gt;13.    Zombie objects  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Zombie objects are created if no facilities are provided to throw and catch exception from constructor and if any exception occurs in the middle of the construction process. This situation creates the objects which are halfway alive.&lt;br /&gt;Zombie objects are also created when the language does not provide support exception handling mechanism in the constructor or the language at all.&lt;br /&gt;So, in the case the exception handling mechanism is not provided with the constructors, each object has to be checked to see whether it is in its zombie state or not .&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(255, 0, 0);"&gt;14.    Resource deallocation primitives&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;It simply means the overloads of operator delete, closing file stopping semaphores etc.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span size="4"&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(255, 0, 0);"&gt;15.    Named Constructor Idiom&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Named constructor idiom is needed for the situations where one has to have two overloaded constructors but the both the constructors take the same number and types of parameters. It is the internal processing of the parameters to create the object that differs. For Example&lt;br /&gt;CPoint(float aX, float aY);  //rectangular coordinate system&lt;br /&gt;CPoint(float aRadius, float aTheta); // polar coordinates system&lt;br /&gt;In the situation, the overloaded constructor will not work. So, we have to use the named constructor idiom.&lt;br /&gt;How the named constructor Idiom works? The code shows you how to do that.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.lwithers.me.uk/articles/covariant.html%5C"&gt;Source1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/int&gt;&lt;/vector&gt;&lt;/int&gt;&lt;/vector&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-3774246130406054879?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/3774246130406054879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=3774246130406054879' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/3774246130406054879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/3774246130406054879'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2010/06/oo-design-c-buzzwords-2.html' title='OO design &amp; C++ buzzwords - 2'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-6225939782464388165</id><published>2010-06-11T06:08:00.015+06:00</published><updated>2010-06-11T06:18:16.248+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OO Design'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>OO design &amp; C++ buzzwords</title><content type='html'>Here are some C++ important buzzwords that are worth knowing and worth looking into. The buzzwords are kind of mixed in the sense that some are basic and more regularly used and other are kind of advanced and not that much regularly used. So, I am not going to keep any kind of order in that sense. The second thing is – the description and explanation are not directly copied from the source. I have put down my own understanding about each term. The readers are open to leave comments if they find anything which is not properly defined or which does not seem to fit.&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;span style="color: rgb(255, 0, 0);"&gt;1. Virtual Destructor&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Virtual destructor is a necessary thing when there is the possibility that a derived class object is deleted via a base class pointer. And when that is done, when the destructor is called, the base class does not know a damn about which class the object is originally and so, the corresponding destructor of that class is never called. This can introduce serious error because the derived class might have some resource to de-allocate. This can be shown by the following example.&lt;br /&gt;The code is attached at VirtualDestructor.cpp&lt;br /&gt;The output of the above code is&lt;br /&gt;”Inside CBase Destructor”&lt;br /&gt;Here, we can see that the derived class destructor is not called at all. To remove this problem, we need to declare the base class destructor as virtual. So, instead of writing the destructor as&lt;br /&gt;~CBase1() throw()&lt;br /&gt;{&lt;br /&gt;cout&lt;&lt;"Inside CBase Destructor \n";  }  we will write as follows virtual ~CBase1() throw()  {   cout&lt;&lt;"Inside CBase Destructor \n";  }  This removes the problem.  The output then becomes Inside CDerived Destructor Inside CBase Destructor  The actual rule of when to declare the base class destructor as virtual is not trivial. But the rule of thumb (without hurting performance), we can say that, whenever a class has a virtual function (so, that class is likely to be derived in future), the destructor should be virtual. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;2. Pure virtual destructor&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Pure virtual destructor is the only class member function that has to be defined even after it is declared as pure virtual.&lt;br /&gt;class CMyClass1{&lt;br /&gt;public:&lt;br /&gt;CMyClass1() throw();&lt;br /&gt;virtual ~CMyClass1() = 0;&lt;br /&gt;private:&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;CMyClass1::CMyClass1() throw(){&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;CMyClass1::~CMyClass1(){&lt;br /&gt;}&lt;br /&gt;So, why would someone need a pure virtual destructor? The argument is that, there is no reason why there cannot be a pure virtual destructor. As destructor is just a function like any other member function in a class, that is why there can be a pure virtual destructor just like any other functions. Apart from that there is no special reason why we need a pure virtual destructor. Some people say that we can make the destructor pure virtual so that we can turn a normal class into an ABC. But that is not a strong enough reasoning.&lt;br /&gt;The special thing about pure virtual destructor is that we have to put a definition of the function even if it is pure virtual destructor. This is because the destructor must be defined for all classes as destructor are always called when objects are destroyed.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;3. Inline virtual member function&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;A compiler can actually inline a member function which is declared as inline in the case when the compiler can statically resolve the actual type of the object which is called on that function.  So, a virtual function can only be inclined when the object that is used to call it is a pointer or reference (because that case the type of the object must be resolved dynamically). So, only in the case when the compiler can resolve the type of the object statically, only then the compiler can keep an inline function as inline. Otherwise it won’t happen.&lt;br /&gt;So, a very useful rule of thumb when declaring the functions as inline is to think whether it is going to be accessed by an object or a pointer or a reference to an object.&lt;br /&gt;Here an important thing to remember,  a compiler has the ,liberty to ignore the inline specifier  even if the object can be resolved  at compile time. So, we cannot say that the places where a virtual inline function is called via an object (the type of which the compiler can resolve statically)  will always be inlined . But the reverse is always true (if an inline virtual function is called via a pointer or reference, that function calling part cannot be inlined because the compiler cannot resolve  the type of the object at compile time).&lt;br /&gt;N.B. A short note on what happens when an inline function is called. The compiler puts the inline member function code directly in that place removing the function call and thus removing some unnecessary stack operations made during a function call.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;4. Virtual Constructor idiom&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;So, what to virtual constructors do? They can construct the actual object in the class hierarchy without knowing the actual type of the object during construction. The concept of virtual constructor comes into life when you are trying to construct an object of a class which you don’t know of (Which derived class). Like the following piece of code.&lt;br /&gt;Class CBase{};&lt;br /&gt;Class CDerived: public CBase{};&lt;br /&gt;&lt;br /&gt;int main(){&lt;br /&gt;CBase *f  =  new CDerived();&lt;br /&gt;CBase* f2 = aObj.Clone();  // here f2 does not actually know that aObj is a CDerived&lt;br /&gt;//Object           }&lt;br /&gt;So, how can we do it? We can do it using the virtual constructor idiom. The code is in VirtualConstructor.cpp.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;5. Constructor initialization list&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;It is the best way to initialize the member variables of an object. It is always better to use the constructor initialization list rather than manually creating values to the member variables. It works in the following way:&lt;br /&gt;class CPerson{&lt;br /&gt;public:&lt;br /&gt;CPerson(string&amp;amp; aName) throw(bad_alloc);&lt;br /&gt;private:&lt;br /&gt;string iName;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;CPerson::CPerson(string&amp;amp; aName) throw(bad_alloc)&lt;br /&gt;:iName(aName)&lt;br /&gt;{}&lt;br /&gt;In the above example, instead of manually initializing the string variable in the constructor body, we just use the initilization list.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;6. Virtual friends&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;The following code can be used as a virtual friend&lt;br /&gt;VirtualFriend.cpp&lt;br /&gt;Using the above style, we can get a virtual friend function – which depending on the runtime type of the object, calls the appropriate function in the class hierarchy.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;7. Initialization order dependency&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;The initialization order dependency means , no matter how the member objects are ordered in the initialiers list, the initialization will occur in the same order in which the  members are declared In the class declaration. An example will help to understand the issue. InitializationOrder.cpp&lt;br /&gt;From the code, if we run it, we will see that the member objects are written in the opposite order on the CMyClass constructor initilizers list that the way in which they are declared in CMyClass. But  during construction, the copy constructor of the two classes ( during the execution of the initialiers list in CMyClass constructor) ,are called in the same order in which they are declared in the class, not by the order in which they are declared in the initializes list.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);font-size:130%;" &gt;8. Argument screening&lt;/span&gt;&lt;br /&gt;It is nothing actually. Argument screening means the sanity checking of the parameters of a constructor. In that case when argument screening is needed, the code for screening becomes too much and then we cannot initialize the argument using constructor initialization list.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-size:130%;" &gt;&lt;span style="font-weight: bold;"&gt;9. The {…} initializer syntax &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;This is actually nothing compared to how intimidating it sounds.  It is actually the array initialization syntax. Take a look at the code InitializerSyntax.cpp&lt;br /&gt;In the above example we can see that the first element of the array is handed an already constructed object. So, it explicitly calls the copy constructor.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;font-size:130%;" &gt;10. The overloaded parenthesis operator [operator ()] &lt;/span&gt;&lt;br /&gt;The overloaded parenthesis operator can take as many parameters as one would like to pass into the operator function.&lt;br /&gt;Just look at the following code OverloadedParenthesis.cpp&lt;br /&gt;In the above code, the () operator has been overloaded thrice to do three kind of things. The one returning the reference to double is used to set the value;&lt;br /&gt;The one returning the const double is used to get the value of the array element.&lt;br /&gt;And the last one with no parameters is used to reset the array inside the object.&lt;br /&gt;But we have to remember one thing that I have said in an earlier post. Do not do anything for the sake of doing it. The whole idea of operator overloading is to ease the user of the class and make him comfortable by providing all the common an intuitive usage of the operator . In the above example the three overloaded operators and their functionality is not intuitive. The only scenario in which this overloaded parenthesis operator can be intuitive and appropriately useful is the matrix class.That is because we cannot define overloaded double subscript operator Matrix[][] ,, but we can use something like Matrix(x,y); Which looks pretty much same as the subscripted version.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/FAQs-2nd-Marshall-P-Cline/dp/0201309831/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1276201501&amp;amp;sr=8-1"&gt;Source1&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.parashift.com/c++-faq-lite/"&gt;Source2&lt;/a&gt;&lt;br /&gt;&lt;embed src="http://www.box.net//static/flash/box_explorer.swf?widget_hash=uqtvzsexzn&amp;amp;v=1&amp;amp;cl=0" wmode="transparent" type="application/x-shockwave-flash" width="460" height="200"&gt;&lt;/embed&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-6225939782464388165?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/6225939782464388165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=6225939782464388165' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6225939782464388165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6225939782464388165'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2010/06/oo-design-c-buzzwords.html' title='OO design &amp; C++ buzzwords'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-106722350120684289</id><published>2010-05-03T00:58:00.034+06:00</published><updated>2010-05-03T09:21:08.778+06:00</updated><title type='text'>Stream and Store in Symbian C++ -1</title><content type='html'>ow to use the overloaded Stream Operator in Symbian&lt;br /&gt;&lt;br /&gt;In C++, we can overlaod the istream and ostream operators ("&lt;&lt;" and "&gt;&gt;") for writing to any kind of stream (standard IO, files stores etc).&lt;br /&gt;&lt;br /&gt;In Symbian there is a similar group of classes for stream input and output. The base classes are RReadStream and RWriteStream.&lt;br /&gt;&lt;br /&gt;To get the same effect of the overloaded stream operators in Symbian OS, we have to implement the following two functions:&lt;br /&gt;&lt;br /&gt;void ExternalizeL(RWriteStream&amp;amp; aStream) const;&lt;br /&gt;void InternalizeL(RReadStream&amp;amp; aStream);&lt;br /&gt;&lt;br /&gt;As the names suggest, the ExternalizeL function is for writing to a stream and the InternalizeL function is for reading from a stream.&lt;br /&gt;&lt;br /&gt;So, if we want to overload the stream operators for any class , we have to implements these to functions in that class.&lt;br /&gt;&lt;br /&gt;So, the class looks like this :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;#ifndef TESTCLASS_H&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;#define TESTCLASS_H&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;e32std.h&gt;&lt;e32base.h&gt;&lt;s32file.h&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;class CTestClass : public CBase&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;   {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;&lt;br /&gt;public:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt; &lt;br /&gt;~CTestClass();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt; &lt;br /&gt;static CTestClass* NewL();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;&lt;br /&gt;static CTestClass* NewLC();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;    void ExternalizeL(RWriteStream&amp;amp; aStream) const;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;  &lt;br /&gt;void InternalizeL(RReadStream&amp;amp; aStream);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;private:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt; &lt;br /&gt;CTestClass();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt; &lt;br /&gt;void ConstructL();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt; &lt;br /&gt;TInt16 a;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt; &lt;br /&gt;TInt16 c;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;  &lt;br /&gt;};&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;&lt;br /&gt;#endif&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and the class definition is :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;void CTestClass::ExternalizeL(RWriteStream&amp;amp; aStream) const&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt; &lt;br /&gt;//aStream.WriteInt16L(this-&gt;a);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt; &lt;br /&gt;//aStream.WriteInt16L(this-&gt;c);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt; &lt;br /&gt;aStream &lt;&lt; mytestclass =" CTestClass::NewL();"&gt;ExternalizeL(); would do the same thing&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;     &lt;br /&gt;CleanupStack::PopAndDestroy();&lt;/span&gt;&lt;br /&gt;   &lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;     &lt;br /&gt;writer.CommitL();&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;&lt;br /&gt;writer.Pop();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;     &lt;br /&gt;writer.Release();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt;     &lt;br /&gt;CleanupStack::PopAndDestroy();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(153, 153, 0);"&gt; &lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is how we can use it:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;void CASDTestAppUi::WriteToStream()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;   {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       RFs fs;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       RFileWriteStream writer;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       fs.Connect();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       CleanupClosePushL(fs);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       writer.PushL();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       if(writer.Create(fs,_L("c:\\zafar1.txt"),EFileRead|EFileWrite) == KErrAlreadyExists)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;           writer.Open(fs,_L("c:\\zafar1.txt"),EFileRead|EFileWrite);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;         &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       CTestClass* myTestClass = CTestClass::NewL();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       CleanupStack::PushL(myTestClass);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       writer &lt;&lt; *myTestClass;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       CleanupStack::PopAndDestroy();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       writer.CommitL();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       writer.Pop();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       writer.Release();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;       CleanupStack::PopAndDestroy();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-style: italic;"&gt;&lt;br /&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;N.B: Common mistakes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;As we have taken a pointer to CTestClass variable, forgetting to add the dereferencing operator will result in STORE-Stream 9 panic.&lt;/li&gt;&lt;li&gt;We could use CleanupReleasePushL(writer); in place of  writer.PushL(); &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Here, how the stream operator can be overloaded for writing to a file is shown. We can use other RReadStream and RWriteStream subclasses to overload the stream operators for writing  user defined class objects to different kinds of streams and stores.&lt;/s32file.h&gt;&lt;/e32base.h&gt;&lt;/e32std.h&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-106722350120684289?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/106722350120684289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=106722350120684289' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/106722350120684289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/106722350120684289'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2010/05/stream-and-store-in-symbian-c.html' title='Stream and Store in Symbian C++ -1'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-7327486514821800305</id><published>2010-04-16T20:49:00.005+06:00</published><updated>2010-04-16T20:54:04.222+06:00</updated><title type='text'>*** missing operator in Symbian</title><content type='html'>2 years in the buisiness and still I stumble upon fairly easy things.... I was building a peoject in carbide and it gave an error called "*** missing operator" .., I tried to find out what was happening. Eventually I got two threads which actually describes the problem&lt;br /&gt;&lt;br /&gt;http://dev.eclipse.org/newslists/news.eclipse.tools.cdt/msg06739.html&lt;br /&gt;&lt;br /&gt;http://www.forum.nokia.com/forum/showthread.php?t=129440&lt;br /&gt;&lt;br /&gt;Actually the project was built in Windows XP. In windows 7 (when I tried to build it again) , it replaced the tab in the icon_scalable_dc.mk file and replaced those with a bunch of spaces; that is why it was not getting that error.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-7327486514821800305?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/7327486514821800305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=7327486514821800305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/7327486514821800305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/7327486514821800305'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2010/04/missing-operator-in-symbian.html' title='*** missing operator in Symbian'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-561552830942323830</id><published>2009-10-20T12:19:00.011+06:00</published><updated>2009-10-20T12:33:13.566+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Periodic task without using Active Objects</title><content type='html'>Sometimes you may want to call a function or do some task in regular interval without extending the class from CActive (i.e. You may want to show a informationNote on map - just like google maps does ;-)) . In that Situation it would be appropriate to a CPeriodic Object. Usage is trivial -&lt;br /&gt;In the header file add:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;      CPeriodic* iTimer;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Use two functions which should look like following&lt;br /&gt;&lt;br /&gt;/*Use this function whenever you have to start the time*/&lt;br /&gt;&lt;span style="font-style: italic;"&gt;void StartTimerL(TInt aStart, TInt aInterval)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    {&lt;br /&gt;   if(iTimer)&lt;br /&gt;  {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;        delete iTimer;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        iTimer = NULL;&lt;/span&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    iTimer = CPeriodic::NewL(EPriorityLow);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    iTimer-&gt;Start(aStart, aInterval, TCallBack(TimerCallback, this));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;/*This function will be called after the specified interval*/&lt;br /&gt;&lt;span style="font-style: italic;"&gt;TInt TimerCallback(TAny* aThis)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    {&lt;/span&gt;&lt;br /&gt; // Do whatever you have to do locally or you may call the following function&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   static_cast&lt;&gt;(aThis)-&gt;GlobalNoteProcessTimerEvent();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   return 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;  &lt;/span&gt;  }&lt;br /&gt;&lt;br /&gt;/*Use this function to stop the timer*/&lt;br /&gt;void CancelTimer()&lt;br /&gt;{&lt;br /&gt;  iTimer-&gt;Cancel();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Thats it!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-561552830942323830?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/561552830942323830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=561552830942323830' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/561552830942323830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/561552830942323830'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2009/10/periodic-task-without-using-active.html' title='Periodic task without using Active Objects'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-6691030628032566779</id><published>2009-10-08T10:39:00.004+06:00</published><updated>2009-10-08T10:46:01.946+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><title type='text'>Transparent Animated GIF</title><content type='html'>I was trying to show an animated GIF over the maps as a blip to indicate user's position on the map. But I could not show a gif with transparent background. The gif background was shown to be white although the gif uimage had a transparent background. Then I changed a few lines of the &lt;a href="http://wiki.forum.nokia.com/index.php/Showing_GIF_animations"&gt;tutorial&lt;/a&gt; and then it worked. The lines I have changed is as follows :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;void CGifAnimatorContainer::Draw(const TRect&amp;amp; aRect) const&lt;br /&gt;    {&lt;br /&gt;        CWindowGc&amp;amp; gc = SystemGc();&lt;br /&gt;        if(iIsVisible)&lt;br /&gt;        {&lt;br /&gt;            if(iGif_Reader)&lt;br /&gt;            {&lt;br /&gt;                if(iGif_Reader-&gt;Bitmap() &amp;amp;&amp;amp; iGif_Reader-&gt;BitmapImg() &amp;amp;&amp;amp; iGif_Reader-&gt;BitmapMsk())&lt;br /&gt;                {&lt;br /&gt;                    if(iGif_Reader-&gt;Bitmap()-&gt;Handle() &amp;amp;&amp;amp; iGif_Reader-&gt;BitmapImg()-&gt;Handle() &amp;amp;&amp;amp; iGif_Reader-&gt;BitmapMsk()-&gt;Handle())&lt;br /&gt;                    {&lt;br /&gt;                        TSize gifSize =  TSize(iGif_Reader-&gt;Bitmap()-&gt;SizeInPixels());&lt;br /&gt;                        TSize screenSize = TSize(aRect.Size());&lt;br /&gt;                        TRect tempRect = TRect(TPoint((screenSize.iWidth - gifSize.iWidth)/2 ,(screenSize.iHeight - gifSize.iHeight)/2),gifSize);&lt;br /&gt;                        gc.DrawBitmapMasked(tempRect,iGif_Reader-&gt;BitmapImg(),&lt;br /&gt;                            TRect(0, 0, iGif_Reader-&gt;BitmapImg()-&gt;SizeInPixels().iWidth, iGif_Reader-&gt;BitmapImg()-&gt;SizeInPixels().iHeight),&lt;br /&gt;                            iGif_Reader-&gt;BitmapMsk(), EFalse);&lt;br /&gt;                        //gc.DrawBitmapMasked&lt;br /&gt;                    }&lt;br /&gt;                }   &lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;       &lt;br /&gt;    }&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Just replace the original function with mine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-6691030628032566779?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/6691030628032566779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=6691030628032566779' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6691030628032566779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6691030628032566779'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2009/10/transparent-animated-gif.html' title='Transparent Animated GIF'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-4686074962333875540</id><published>2009-05-27T00:35:00.003+06:00</published><updated>2009-05-27T00:53:07.570+06:00</updated><title type='text'>Performance tips for Symbian Developers</title><content type='html'>Have you seen it? If not, take a quick look:&lt;br /&gt;&lt;embed src="http://www.box.net/static/flash/box_explorer.swf?widget_hash=rhsdvss8yu&amp;amp;v=0&amp;amp;cl=0" width="460" height="230" wmode="transparent" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-4686074962333875540?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/4686074962333875540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=4686074962333875540' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/4686074962333875540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/4686074962333875540'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2009/05/performance-tips-for-symbian-developers.html' title='Performance tips for Symbian Developers'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-7642020320397451266</id><published>2009-04-08T13:44:00.002+06:00</published><updated>2009-04-08T13:54:07.422+06:00</updated><title type='text'>Specifying default installation drive in .pkg file</title><content type='html'>in the .pkg file , if we want to select the installation drive (Phone memory or Memory Card)at runtime , we put a "!" instead of the drive letter. If we dont want to show the drive selection dialog during installation, we can specify the drive letter in which we want to install out exe instead of the "!" letter. Like this:&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;"C:\S60\devices\S60_3rd_FP2_SDK\epoc32\data\z\resource\apps\MyApp.rsc"-"&lt;span style="color: rgb(255, 102, 102);"&gt;C&lt;/span&gt;:\resource\apps\MyApp.rsc"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But in Visual Studio 2005 , this solution does not work if we build the .SIS file using the VS2005 IDE. So, to make this thing work we have to go to the "sis" folder under the project folder and run the following command:&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;makesis MyApp.pkg&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then this thing will work. So, what we need to do when we are using  the VS2005 as development environment is to rebuild the solution and then run the above stated command. Building the SIS file using the IDE wont work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-7642020320397451266?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/7642020320397451266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=7642020320397451266' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/7642020320397451266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/7642020320397451266'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2009/04/specifying-default-installation-drive.html' title='Specifying default installation drive in .pkg file'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-2294216352848063176</id><published>2009-02-17T01:06:00.027+06:00</published><updated>2009-02-18T11:19:17.163+06:00</updated><title type='text'>leaves and traps..... (II)</title><content type='html'>&lt;span style="font-weight: bold; font-style: italic; color: rgb(153, 51, 0);"&gt;How to work with leaves&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We assume that a function has previously allocated memory on the heap and this memory is pointed to by a local pointer variable. Now,if a leave occurs within that function then ,that pointer will be destroyed by the Leave (As Leave unwinds the stack frame upto the TRAP macro). Lets see,&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_WYKEhPq_evM/SZuYDK5Xr3I/AAAAAAAAASg/WhH4sil5I0Y/s1600-h/Leave1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 54px;" src="http://1.bp.blogspot.com/_WYKEhPq_evM/SZuYDK5Xr3I/AAAAAAAAASg/WhH4sil5I0Y/s320/Leave1.png" alt="" id="BLOGGER_PHOTO_ID_5304000166390902642" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Eventually the memory pointed to by "test" variable is unallocated and will result in a memory leak.&lt;br /&gt;How to prevent this?&lt;br /&gt;&lt;br /&gt;If we have to use any local variable which point to heap objects, we must push the variable to the CleanupStack before calling any function that may leave.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(102, 0, 0);"&gt;Important Note:&lt;/span&gt;&lt;br /&gt;1. Member variables are leave-safe&lt;br /&gt;2.Neither a constructor nor a destructor should contain code that may&lt;br /&gt;leave, since doing so would potentially leak memory.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(102, 0, 0);"&gt;Leaves Vs Panics&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. Leaves occur in exceptional conditions (Out of memory or Out of disk conditions). Leaves should be handled properly to continue the normal flow of execution. Leaves do not terminate the normal flow of execution. On the other hand, Panics cannot be caught and handled.&lt;br /&gt;&lt;br /&gt;2. Leaves occur at program runtime due to exception situation. Panics , on the other hand occur at the development time. If they occur at runtime, they cannot be fixed. So, the cause pf panics should be searched and fixed at development period.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-2294216352848063176?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/2294216352848063176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=2294216352848063176' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/2294216352848063176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/2294216352848063176'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2009/02/leave-and-trap-ii.html' title='leaves and traps..... (II)'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_WYKEhPq_evM/SZuYDK5Xr3I/AAAAAAAAASg/WhH4sil5I0Y/s72-c/Leave1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-5513772313318368164</id><published>2009-02-17T00:35:00.052+06:00</published><updated>2009-02-17T01:06:32.580+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Leaves and traps  (I)</title><content type='html'>&lt;div style="text-align: justify;"&gt;How funny this should sound to a Symbian C++ programmer? Till now, I do not have a clear idea on Leave and Trap mechanism of Symbian OS. Anyways, better let than never!! Here are some informations that I found essential to know about Leave - Trap mechanism of Symbian C++.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(153, 0, 0);"&gt;BASICS&lt;/span&gt;&lt;br /&gt;           1. Standard C++ exception handling mechanism adds substantially to the size of compiled code and RAM overheads (irrespective of whether the exceptions are thrown or not). That is why Symbian OS introduced the Leave - Trap mechanism. Before Symbian OS version 9 , the standars C++ exception handling were disabled in compilers so that any call to try catch or throw would result in a compilation error.But in Symbian OS 9, the standars C++ is supported (Hurrah!!!!).&lt;br /&gt;     &lt;br /&gt;            2. The Leave - Trap mechanism is an alternative to standard C++ exception and conventional error checking. In other words, Leave- Trap constitutes to lightweight error handling of Symbian OS.&lt;br /&gt;&lt;br /&gt;            3.  a "leave" (i.e. &lt;span style="font-style: italic;"&gt;User::Leave() &lt;/span&gt;or &lt;span style="font-style: italic;"&gt;User::LeaveifError()&lt;/span&gt;) suspends the code execution at the point where the leave occurs and resumes the execution at the point where the "leave" is "Trap"ped. The trap harness in Symbian is actually a "TRAP" macro. The "leave" sets the stack pointer to the context of the "TRAP" and jumps to that location.&lt;br /&gt;&lt;br /&gt;           4. User::Leave() or User::LeaveIfError() ---- Throw&lt;br /&gt;              TRAP ------------------------------------- try + catch&lt;br /&gt;&lt;br /&gt;           5. Critical Information on Leave:&lt;br /&gt;    Unlike C++ throw, a Leave will simply deallocate objects on the stack - it does not call the descriptor of that object. So, if a stack object owns a resource which must be deallocated or released as a part of destruction, that resource is not released if a leave occurs. That is why we have a class naming convention of Symbian OS which clearly states which kinds of classes can be instantiated and used safely on the stack (T classes). So, only a stack based T class will be cleaned up correctly if a Leave occurs (because there is nothing of an object of T class in any place other than stack).&lt;br /&gt;&lt;br /&gt;6.R classes may also be created on the stack, but they must be made ‘‘leave safe’’, if used in functions that may leave, by using the cleanup stack.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(153, 51, 0);"&gt;new(ELeave)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. The overloaded new operator which takes ELeave as a parameter guarantees that the pointer return value will be valid if a Leave is not occured in the constructor. Use of this overload allows the pointer to be used without further test that the allcation was successful(The allocation would leave if it were not successful).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-5513772313318368164?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/5513772313318368164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=5513772313318368164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/5513772313318368164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/5513772313318368164'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2009/02/leaves-and-traps-i.html' title='Leaves and traps  (I)'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-6134595466269238256</id><published>2009-01-25T17:13:00.023+06:00</published><updated>2009-01-25T17:40:00.092+06:00</updated><title type='text'>Giving Shadowed or Custom Background to CEikEdwin</title><content type='html'>If we look at the flash lite editbox, we will observe a shadowed background in the text boxes.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_WYKEhPq_evM/SXxLniKQWoI/AAAAAAAAAR4/4M1AEBwF8Gc/s1600-h/address_input1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 194px; height: 320px;" src="http://1.bp.blogspot.com/_WYKEhPq_evM/SXxLniKQWoI/AAAAAAAAAR4/4M1AEBwF8Gc/s320/address_input1.jpg" alt="" id="BLOGGER_PHOTO_ID_5295190404437662338" border="0" /&gt;&lt;/a&gt;How can we give the shadow on the textbox background like this? Flash lite application runs on Symbian phones, so they must have done some kind of tricks using Symbian. In my application, I was required to do the same thing. There is a way to put custom drawed background on the CEikEdwin. I dont know if it is the way that flashlite used to show shadow on TextBox background, but it surely works.&lt;br /&gt;&lt;br /&gt;  The things is , you have to implement MFormCustomDraw interface. Just take a Class which looks like&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#include &lt;e32std.h&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#include&lt;frmtlay.h&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;class CMyCustomDraw : public MFormCustomDraw&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;public: // Constructors and destructor&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    virtual void DrawBackground(const TParam &amp;amp;aParam, const TRgb &amp;amp;aBackground, TRect &amp;amp;aDrawn) const;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    virtual void DrawLineGraphics(const TParam &amp;amp;aParam, const TLineInfo &amp;amp;aLineInfo) const;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;};&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The MFormCustomDraw has two some virtual functions (Drawbackground() and DrawLineGraphics()). We have to implement these two functions (Or preferrably only the first one) in order to get a custom shadow on the  CEikEdwin background.&lt;br /&gt;So, we have to just write the implementation of DrawBackground() function. The implementation is straight forward - you have the graphics Conrtext (aParam.iGc), you have the CEikEdwin Background Rectangle (aParam.iDrawRect), so you have everything. So, just put your code in&lt;br /&gt;CMyCustomDraw::DrawBackground(const TParam &amp;amp;aParam, const TRgb &amp;amp;aBackground, TRect &amp;amp;aDrawn) const{} function.&lt;br /&gt;&lt;br /&gt;Now, how do we use it with our CEikEdwin.  Lets say, you have a CEikEdwin in your container.So, you create your CEikEdwin in the natural way and after constructing you write,&lt;br /&gt;&lt;br /&gt;CMyCustomDraw* iCustomDraw = new (ELeave) CMyCustomDraw();&lt;br /&gt;and iTextField-&gt;TextLayout()-&gt;SetCustomDraw(iCustomDraw);&lt;br /&gt;&lt;br /&gt;and not only that. In the containers draw function, you have to set it everytime.&lt;br /&gt;iTextField-&gt;TextLayout()-&gt;SetCustomDraw(iCustomDraw);&lt;br /&gt;&lt;br /&gt;This is how we do it !!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-6134595466269238256?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/6134595466269238256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=6134595466269238256' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6134595466269238256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6134595466269238256'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2009/01/giving-shadowed-or-custom-background-to.html' title='Giving Shadowed or Custom Background to CEikEdwin'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_WYKEhPq_evM/SXxLniKQWoI/AAAAAAAAAR4/4M1AEBwF8Gc/s72-c/address_input1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-2720759353750609784</id><published>2009-01-13T12:42:00.006+06:00</published><updated>2009-01-13T12:53:42.985+06:00</updated><title type='text'>How to get the Screen Size Anywhere in a GUI application</title><content type='html'>Just a simple line of code to access the Application related data from any file.&lt;br /&gt;If you want to access the application rectangle or screen size then -&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;CEikonEnv::Static()-&gt;EikAppUi()-&gt;ApplicationRect().Size().iWidth&lt;/span&gt;&lt;br /&gt;and you have to include -&lt;br /&gt;&lt;span style="font-style: italic;"&gt;eikenv.h&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;eikappui.h&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-2720759353750609784?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/2720759353750609784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=2720759353750609784' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/2720759353750609784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/2720759353750609784'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2009/01/how-to-get-screen-size-anywhere-in-gui.html' title='How to get the Screen Size Anywhere in a GUI application'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-1942912755171600705</id><published>2008-11-03T10:56:00.000+06:00</published><updated>2008-11-07T11:20:57.008+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><category scheme='http://www.blogger.com/atom/ns#' term='Console App'/><title type='text'>Developing a console Application That works in Background - 2</title><content type='html'>Specifically what I did to achieve the above 4 requirements is most important to document. &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;For requirement 1,&lt;/span&gt; we have to do &lt;a href="http://pritorius.blogspot.com/2008/08/symbian-console-exe-auto-run-after.html"&gt;this&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;For requirement 2,&lt;/span&gt;we have to create a console exe program. The usefulness of such programs is that it works in background. So, one cannot view the program as a task in running application viewer.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;For requirement 3&lt;/span&gt;, we have to install an active scheduler in the ConsoleApp.cpp file (where the function &lt;span style="font-style:italic;"&gt;E32Main()&lt;/span&gt; resides). We can put the following 3 lines of code in the E32Main() function :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;        &lt;span style="font-style:italic;"&gt;CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();&lt;br /&gt; CleanupStack::PushL(scheduler);&lt;br /&gt; CActiveScheduler::Install(scheduler);&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        This active scheduler is what the program will work taking the help of.Then after initializing the appropriate classes, we have to start the active scheduler. Let me give a specific example: &lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_WYKEhPq_evM/SQ6LKn5gc1I/AAAAAAAAAKU/UeSQ6mRUkI8/s1600-h/1.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 190px;" src="http://3.bp.blogspot.com/_WYKEhPq_evM/SQ6LKn5gc1I/AAAAAAAAAKU/UeSQ6mRUkI8/s320/1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5264298029067826002" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;     And then in the DoStartL() function - &lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_WYKEhPq_evM/SQ6OF8CUNNI/AAAAAAAAAKc/64fsc3FSYhQ/s1600-h/2.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 142px;" src="http://4.bp.blogspot.com/_WYKEhPq_evM/SQ6OF8CUNNI/AAAAAAAAAKc/64fsc3FSYhQ/s320/2.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5264301247109018834" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now, if any class (i.e CCallStatusNotifier or CImageDownloader in my example) is an active object type class then we can add the active object to active scheduler like this:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;span style="font-weight:bold;"&gt;void CCallStatusNotifier::ConstructL()&lt;br /&gt;{&lt;br /&gt; CActiveScheduler::Add(this);&lt;br /&gt;}&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And then you will be able to use that active scheduler like normal active scheduler&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-1942912755171600705?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/1942912755171600705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=1942912755171600705' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/1942912755171600705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/1942912755171600705'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/11/developing-console-application-that.html' title='Developing a console Application That works in Background - 2'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_WYKEhPq_evM/SQ6LKn5gc1I/AAAAAAAAAKU/UeSQ6mRUkI8/s72-c/1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-8659715435608098819</id><published>2008-08-31T11:48:00.000+06:00</published><updated>2008-08-31T11:53:44.051+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='Console App'/><title type='text'>Symbian Console Exe auto run after isntalling</title><content type='html'>I have written a console exe which I need to start just after installing. This is very easy to do as they say . Just put FR,RI in the .pkg after the application name:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;"C:\Symbian\9.2\S60_3rd_FP1\epoc32\release\gcce\urel\consoleapp.exe"-"!:\sys\bin\consoleapp.exe",FR,RI&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But even after doing this the application was not working in the device. After getting screwed for several hours and trying some unearthly things, I resorted to a friend for help. He said that self signing wont work. I have to go to make it &lt;a href="http://www.symbiansigned.com"&gt;Symbian Signed&lt;/a&gt;. Bummer...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-8659715435608098819?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/8659715435608098819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=8659715435608098819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/8659715435608098819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/8659715435608098819'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/08/symbian-console-exe-auto-run-after.html' title='Symbian Console Exe auto run after isntalling'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-8600682928719580663</id><published>2008-08-10T17:45:00.001+06:00</published><updated>2008-10-24T18:24:42.829+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><title type='text'>Developing a console Application That works in Background - 1</title><content type='html'>May be this kinda short-ass article has been written many times before. But I am sort of a dumb-truck and I cannot remember things for long. That is why I am writing this for myself.&lt;br /&gt;&lt;br /&gt;My requirement is : I want to build an application that :&lt;br /&gt;&lt;br /&gt;1. Will Auto start right after installing.&lt;br /&gt;2. Will be a console application - so it will work on background.&lt;br /&gt;3. It will periodically do something (for now - it will write some files).&lt;br /&gt;4. May be it will have to restart whenever the device is restarted.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          To create an Application that fulfills the above stated requirements isnt that hard if one has sufficient amount of experience with Symbian. Like, for requirement &lt;span style="font-weight:bold;"&gt;No.2&lt;/span&gt; - we can build a console Application that does not have a UI. The console Application skeleton that VS2005 creates for us have some things related to colsole which waits for user input in a command prompt like thing. Only if we scrape off all those codes , we can then have a true background Application that does not show up in the task managers running tasks and which does not have any kind of GUI either.&lt;br /&gt;         &lt;br /&gt;         Now, for requirement &lt;span style="font-weight:bold;"&gt;No.1&lt;/span&gt;  we have to write FR(FileRun) and RI(RunInstall) in the .pkg file. Here is a sample line :&lt;br /&gt;"C:\Symbian\9.1\S60_3rd\epoc32\release\gcce\urel\consoleapp.exe"-"!:\sys\bin\consoleapp.exe, FR,RI. This will make the application auto run right after installing. (Important thing: You have to make it symbian signed if you want to use it on device.Self signing does not work for FR,RI options - as far as I know!!)&lt;br /&gt;&lt;br /&gt;        For requirement &lt;span style="font-weight:bold;"&gt;No.4&lt;/span&gt; one has to look at &lt;a href="http://www.newlc.com/autostart-your-application-phone-boot"&gt;this&lt;/a&gt; , although this is for S60 2nd edition devices. They say that one has to use at least two of the four APIs described in the article. I was building the App for Symbian S60 3rd edition (init release) phones. So, I did not need the "SonyEricsson AutoStarter API".&lt;br /&gt;          &lt;br /&gt;        For requirement No.3 , we have to set up an activescheduler so that we can install an active object. And after constructing the active object and adding it to the scheduler, we have to start the scheduler(Because active scheduler needs at least one active object waiting on it when it is started.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-8600682928719580663?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/8600682928719580663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=8600682928719580663' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/8600682928719580663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/8600682928719580663'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/08/developing-console-application-that.html' title='Developing a console Application That works in Background - 1'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-9219479691844056287</id><published>2008-07-30T13:25:00.000+06:00</published><updated>2008-07-30T13:29:13.332+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Porting'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><title type='text'>Porting from 2nd Edition to Third Edition - 3</title><content type='html'>We were trying to use the bluetooth API for S60 3rd edition(Initial Release) SDK. But, whenever we tried to discover devices , the app crashed giving the User -Exec 3 error . But in 2nd edition, this app were working fine. Then we discovered that we need to add LocalServices capability to make this work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-9219479691844056287?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/9219479691844056287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=9219479691844056287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/9219479691844056287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/9219479691844056287'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/07/porting-from-2nd-edition-to-third_2794.html' title='Porting from 2nd Edition to Third Edition - 3'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-6617250450771324693</id><published>2008-07-30T13:12:00.000+06:00</published><updated>2008-07-30T13:25:39.676+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Porting'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><title type='text'>Porting from 2nd Edition to Third Edition - 2</title><content type='html'>We have finally made a .SIS build for Nokia N73 and uploaded it to the phone . Whenever we tried to run the app , it showed a bizarre error called &lt;span style="font-weight:bold;"&gt;"Menu System Error(-1)"&lt;/span&gt; . Now, many has got the same error while porting from 2nd edition to 3rd edition, as there were quite a few posts and individual threads about this error in &lt;a href="http://newlc.com"&gt;NewLC&lt;/a&gt; and &lt;a href="http://discussion.forum.nokia.com"&gt;Nokia Discussion Forum&lt;/a&gt;. The error is grotesque because the execution did not even come to E32Main() function. So, we were not being able to debug this thing. In many of the discussions, they were telling about the resource file (.rss), registration file (_reg.rss) problems. We tried all of those fixes and still we were getting that error. Then the solution came magically when one of the team member thought out of the box and checked to see what happens if we eliminate the .gif file that we were using. And it worked like a charm. The problem is that, the AppUi class had a reference to a class which used a .gif file for busy screen animation. And the .gif file was included in the .pkg file. What (probably!!!) happens is that when the application is invoked, it tries to load the .gif file from the specified location, but for some reasons , it does not find it (That is why it gets KErrNotFound (-1) ).We have tried to install the .gif file in many other places but still not being able to fix that problem. The problem still occurs whenever we include the .gif file in the .pkg file.Lets see if we can find the solution of this problem...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-6617250450771324693?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/6617250450771324693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=6617250450771324693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6617250450771324693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6617250450771324693'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/07/porting-from-2nd-edition-to-third_30.html' title='Porting from 2nd Edition to Third Edition - 2'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-3082163085052722034</id><published>2008-07-28T11:08:00.001+06:00</published><updated>2008-07-30T13:30:34.363+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><title type='text'>Symbian 3rd Edition : Displaying Error Code on Device</title><content type='html'>In Symbian S60 3rd edition , to display error codes on emulator, we have to put a file Called "ErrRd" (without extension) in the "\Epoc32\winscw\c\resource" folder . This same file can be used to display error codes on device too. we have to just use a .sis file provided by the forum nokia . This .SIS file can be downloaded from &lt;a href="http://wiki.forum.nokia.com/index.php/TSS000254_-_How_can_I_get_extended_information_in_error_messages%3F"&gt;here&lt;/a&gt;. The .SIS file is self signed , so we dont have to worry about signing it before installing. The "ErrRd" file is then installed in the "c:\resource\" folder of the device. After installing the .SIS file , you can see the extended panic code in the device so that you can get a feel of what's going wrong. Hope this helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-3082163085052722034?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/3082163085052722034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=3082163085052722034' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/3082163085052722034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/3082163085052722034'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/07/symbian-3rd-edition-displaying-error.html' title='Symbian 3rd Edition : Displaying Error Code on Device'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-9057561350698405952</id><published>2008-07-22T15:51:00.000+06:00</published><updated>2008-07-30T13:31:45.534+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><title type='text'>Symbian 3rd Edition .SIS file signing</title><content type='html'>We are working on a Symbian Project. Till a couple of weeks ago, we were developing it on the Symbian S60 2nd Edition platform. But now, we have to port it for later OS'es like Symbian 9.1 and 9.2 . Now, apparently these platforms API's have more access to OS core than the previous OS'es like 8.0x or 8.1x. So, now we have to &lt;a href="https://www.symbiansigned.com/app/page/public/openSignedOnline.do"&gt;sign&lt;/a&gt; a .SIS file with the IME number of the mobile phone on which we want to install and run it. The .SIS file that is created for out project is 940 KB (!!!) and at 90% of the time we fail to upload the file. So, we had to use the self-signing process. its very good for development and debugging phase.&lt;br /&gt;  The whole procedure is simple &lt;br /&gt;  &lt;span style="font-weight:bold;"&gt;makekeys -cert -password "urPassWord" -len 512 -dname "CN=WW CO=BD" keyfile.key certfile.cer&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  here 512 is the length of the key that is created by which we have to sign the program. It should be at least 512 (I tried for like 10 because , at the time of creating the key the program asks for random mouse clicks and the more the len the &lt;br /&gt;more there are mouse clicks :-( )&lt;br /&gt;  and CN = company name and CO = country code&lt;br /&gt;&lt;br /&gt;Then a .key file and a .cer file will be created. You can later sign all your test .SIS files using these two files as long as the certificate files does not expire.&lt;br /&gt;Then all you have to do is : run the following command :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;signsis MyFile.sis MyFile.sis certfile.cer keyfile.key "urPassWord"&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then the .SIS file will be signed. At the time of installing, it will give some warning messages, but it will get installed and you will be relieved of the signing process.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-9057561350698405952?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/9057561350698405952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=9057561350698405952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/9057561350698405952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/9057561350698405952'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/07/symbian-3rd-edition-sis-file-signing.html' title='Symbian 3rd Edition .SIS file signing'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-4028189108729899922</id><published>2008-07-20T00:06:00.000+06:00</published><updated>2008-07-30T13:37:25.936+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><title type='text'>Porting from 2nd Edition to Third Edition  - 1</title><content type='html'>We are now porting a Symbian S60 2nd edition to 3rd edition. before starting to actually port, we had several speculations as how much pain the porting process is gonna give us.However, it turned out to be quite different from  what we anticipated. The first step was to successfully &lt;a href="http://pritorius.blogspot.com/2008/07/symbian-s60-3rd-edition-installation.html"&gt;install the 3rd edition SDK's and carbide for VS2005&lt;/a&gt; so that everything works fine. This step caused some travail. Anyways, we succeeded to install and run an application both with 3rd edition and 3rd edition fp2 sdk. The device signing is a thoroughly painful thing until we find a work around of this. &lt;br /&gt;&lt;br /&gt;  The reason behind such circumlocutions is a little bit subtle here. I thought porting will be tough because of two special API's that we have used in our project : bluetooth connectivity and http connectivity. But, it turned out that the porting process caused us pain from totally different aspect : from C++ programming construct aspect. i will try to mention the places and situation where I have encountered error when porting from 2nd Edition to third edition. Its not too much technical (I assume, of course - the symbian team has full fledged documentation of what places can get error when porting from 2nd to 3rd ), its just some sharing experience.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-4028189108729899922?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/4028189108729899922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=4028189108729899922' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/4028189108729899922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/4028189108729899922'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/07/porting-from-2nd-edition-to-third.html' title='Porting from 2nd Edition to Third Edition  - 1'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-9160619558219065945</id><published>2008-07-18T08:57:00.000+06:00</published><updated>2008-07-30T13:32:17.442+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><title type='text'>Symbian S60 3rd edition Installation</title><content type='html'>Here is just a cursory installation procedure of symbian s60 3rd edition sdk for VS2005.&lt;br /&gt;    1. Download and install ActivePerl-5.6.1.633-MSWin32-x86.msi (other versions wont work for symbian s60 3rd edition - at least I couldn't)&lt;br /&gt;    2. Download and install Symbian S60 3rd edition SDK from forum nokia&lt;br /&gt;                                            &lt;span style="font-weight:bold;"&gt;(S60-SDK-0548-3.0-f.3.215f.zip)&lt;/span&gt;&lt;br /&gt;    3. Download and instll S60 3rd edition fp2 sdk &lt;br /&gt;                          &lt;span style="font-weight:bold;"&gt; S60-3.2-SDK-f.inc3.2130_S603rdEdition.zip&lt;/span&gt;&lt;br /&gt;    4. Download and install Carbide for Vs 3.0.1&lt;br /&gt;&lt;br /&gt;You will be immediately able to use the Symbian s60 3rd edition SDk. But probably the S60 3rd edition fp2 sdk will be disabled for VS2005. To enable it go &lt;a href="http://wiki.forum.nokia.com/index.php/S60_3rd_Edition_SDK_FP2_-_Workarounds_and_Updates"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;   Then you will be able to use both SDK in vs2005.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-9160619558219065945?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/9160619558219065945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=9160619558219065945' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/9160619558219065945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/9160619558219065945'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/07/symbian-s60-3rd-edition-installation.html' title='Symbian S60 3rd edition Installation'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-5515133321230645775</id><published>2008-07-01T12:12:00.000+06:00</published><updated>2008-07-30T13:32:37.429+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><title type='text'>Changing Font of Rich Text Editor in Symbian</title><content type='html'>In CEikRichTextEditor, sometimes we may have to change the font, its size or color etc. Normally, the CEikRichTextEditor comes with its default font Attribute. If we use the default font then it looks like this :&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_WYKEhPq_evM/SGnOinl44pI/AAAAAAAAAHk/yj3vTJTPzbo/s1600-h/Before.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_WYKEhPq_evM/SGnOinl44pI/AAAAAAAAAHk/yj3vTJTPzbo/s320/Before.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5217928737424204434" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To change its font color or font specification we have to do as follows:&lt;br /&gt;&lt;br /&gt;      &lt;span style="font-style:italic;"&gt;  _LIT(KFontSpec, "LatinPlain12");&lt;br /&gt; TFontSpec fontSpec(KFontSpec,20*6);&lt;br /&gt; CGraphicsDevice* screenDevice=iEikonEnv-&gt;ScreenDevice( );&lt;br /&gt; CFont* font;&lt;br /&gt; screenDevice-&gt;GetNearestFontInTwips(font,fontSpec);&lt;br /&gt; TCharFormat iCharFormat;&lt;br /&gt; iCharFormat.iFontSpec.iTypeface = fontSpec.iTypeface;&lt;br /&gt; iCharFormat.iFontSpec.iHeight = fontSpec.iHeight;&lt;br /&gt;&lt;br /&gt; TCharFormatMask iCharFormatMask;&lt;br /&gt; iCharFormatMask.SetAll();&lt;br /&gt;&lt;br /&gt; iEditBox-&gt;ApplyCharFormatL(iCharFormat,iCharFormatMask);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then the Rich Text Editor Looks like this:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_WYKEhPq_evM/SGnPGKRFLnI/AAAAAAAAAHs/no354XSuXH8/s1600-h/After.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_WYKEhPq_evM/SGnPGKRFLnI/AAAAAAAAAHs/no354XSuXH8/s320/After.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5217929348027592306" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Nothing apocalyptic in it. Just a bit of information which might be necessary.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-5515133321230645775?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/5515133321230645775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=5515133321230645775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/5515133321230645775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/5515133321230645775'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/06/changing-font-of-rich-text-editor-in.html' title='Changing Font of Rich Text Editor in Symbian'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_WYKEhPq_evM/SGnOinl44pI/AAAAAAAAAHk/yj3vTJTPzbo/s72-c/Before.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-6413996821473790988</id><published>2008-06-03T09:35:00.000+06:00</published><updated>2008-07-30T13:33:10.226+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><title type='text'>Drawing a Custom Control using CTimer</title><content type='html'>&lt;div style="text-align: center;"&gt;There are some occasions where one may need to use asynchronous timer event in container i.e. to create a ticker container which can afterwords be added to other containers as well. I am actually talking about a control that has timer events and which looks something like this.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;&lt;img src="http://bp1.blogger.com/_WYKEhPq_evM/SETKGN7TLfI/AAAAAAAAAHU/QZivlSy2CJU/s320/1.JPG" /&gt;  &lt;img src="http://bp1.blogger.com/_WYKEhPq_evM/SETLBN7TLgI/AAAAAAAAAHc/-1AfsLorqTQ/s320/2.JPG" /&gt;&lt;/div&gt;&lt;div&gt;Obviously it will have some other features of a standard CCoeControl&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;class like making it visible or not. These features automatically comes from the CCoeControl class . So, there is nothing top worry about that.So, I started out like this : I created a custom control class with an extra added feature , it also inherits the CActive class so that I can provide the animation things. So, the class looked like ,&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;class CTickerContainer : public CCoeControl, MCoeControlObserver,CActive&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;// Container class funvtions&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;//Other things&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;public: &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;void StartL(TTimeIntervalMicroSeconds32 aDelay);&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;private: &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;void RunL();&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;void DoCancel();&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;private:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;enum TTickerContainer State&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;    EUninitialized,&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;// Uninitialized&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;    EInitialized,&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;// Initalized&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;    EError&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;// Error condition&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;private:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;TInt    iState;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;RTimer&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;iTimer;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The red marked codes are from CActive class . So, What we do is we start the animation when the CTickerContainer is constructed and in the RunL() function , we provide the animation thing (That can be either drawing the text one character ahead each time or drawing a bitmap one pixel ahead , whatever soooths.) So, the RunL() function should look something like&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;void CTickerContainer::RunL()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;//Do the animation Things...&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;DrawNow();// This is called to reflect the animation on the container&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;iTimer.After(iStatus, 1000000);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;SetActive();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Works like a Charm!!! Then we can use this control in Other containers just as we use built in controls like CEikLabel or others. It worked too and ran on the emulator smoothly, no problem. But whenever I tried to build the ARM version so that I can take the installer on the&lt;/div&gt;&lt;div&gt;device and test this baby, I got an error : &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="border-collapse: collapse; color: rgb(153, 153, 0);   font-weight: bold; line-height: 19px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family:Verdana;font-size:12px;"&gt;"Request for method 'operator new' is ambiguous."&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;WTF? Then I found this &lt;a href="http://www.symbian.com/developer/techlib/v70docs/SDL_v7.0/doc_source/DevGuides/EssentialIdioms/MultipleInheritance.guide.html"&gt;link&lt;/a&gt; that explains everything. &lt;/div&gt;&lt;div&gt;Multiple inheritance is not supported in Symbian. Crap!! So, now a turn around has to be used to do the same thing. Obviously I cannot use CActive as a member variable because I cannot instantiate abstract class. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The solution to this problem is the CTimer class which if extended by another class can then be used as a class member variable. The extra things that we have to do is first to write a class that extends the CTimer class and write an observer interface which will be used to call the specific animation things of the container from the RunL() method of the CTimer extended class. So, the whole thing now looks like :&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;1. The CTimer extended class:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;class MTimerObserver; //This is the Observer mixin class&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;class CTimerDerived : public CTimer&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;    {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;    public: &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;        static CTimerDerived* NewL( const TInt aPriority,&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;                                    MTimerObserver&amp;amp;  aTimeOutObserver );&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;        static CTimerDerived* NewLC( const TInt aPriority,&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;                                     MTimerObserver&amp;amp; aTimeOutObserver );&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;        virtual ~ CTimerDerived();&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;void SetActive();&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;    protected: &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;        void RunL();&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;    private:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;        CTimerDerived( const TInt aPriority,&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;                       MTimerObserver&amp;amp; aTimeOutObserver );&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;        void ConstructL();&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;    private:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;        MTimerObserver&amp;amp; iTimeOutObserver;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;    };&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;The MTimerObserver mixin class looks like :&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;class MTimerObserver&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;public: &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;virtual void TimerExpired() = 0;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;So, The RunL() function now looks like :&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;void CTimeOutTimer::RunL()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;    {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;    if ( iStatus == KErrNone )&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;        {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;        iTimeOutObserver.&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; TimerExpired&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;    else{..............}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;And The Ticker Container looks like:&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;Class CTickerContainer : public CCoeControl, MCoeControlObserver,&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;MTimeOutNotifier&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;{&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;public:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;void TimerExpired()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;// Do the animation things&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;DrawNow();&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 0, 0);"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-6413996821473790988?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/6413996821473790988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=6413996821473790988' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6413996821473790988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6413996821473790988'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/06/drawing-custom-control-using-ctimer.html' title='Drawing a Custom Control using CTimer'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_WYKEhPq_evM/SETKGN7TLfI/AAAAAAAAAHU/QZivlSy2CJU/s72-c/1.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-2427328696776569557</id><published>2008-05-05T15:29:00.000+06:00</published><updated>2008-07-30T13:34:02.837+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><title type='text'>Buffer</title><content type='html'>Sometimes we need a buffer of which we do not know how much data would come in. So, in those cases , we cannot use simple HBufC of TBuf like buffers because these are of fixed sizes and aer not expandable at runtime. So, the simple solution is to use CBufFlat buffer. This is an expandable buffer. There is not much to show inside . Just simple construction , usage and some other stuffs.&lt;br /&gt;&lt;br /&gt;Construction :&lt;br /&gt;    &lt;span style="color: rgb(0, 0, 102); font-weight: bold;"&gt;CBufFlat* iBuf = CBufFlat::NewL(50); //Here 50 is the granularity or expansion                                                                                   //   size &lt;/span&gt;&lt;br /&gt;Inserting Data:&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);"&gt;    iBuf-&gt;InsertL(iCurrentInsertionPos,aData); // inserts the data at current offset &lt;/span&gt;&lt;br /&gt;Using the Data:&lt;br /&gt;       To use the data of this buffer, we have to first make this pointed to by a TPtr&lt;br /&gt;        &lt;span style="font-weight: bold; color: rgb(0, 0, 102);"&gt;TPtrC8 myPtr = iBuf-&gt;Ptr(0);&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;And then access the data via that pointer.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Destruction:&lt;br /&gt;    &lt;span style="font-weight: bold; color: rgb(0, 0, 102);"&gt;delete iBuf;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;and i&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);"&gt;Buf-&gt;Reset(); &lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;will simply reset the whole buffer and delete all data stored inside.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-2427328696776569557?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/2427328696776569557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=2427328696776569557' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/2427328696776569557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/2427328696776569557'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/05/buffer.html' title='Buffer'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-2873833807071194246</id><published>2008-03-03T13:39:00.000+06:00</published><updated>2008-07-30T13:34:29.332+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><title type='text'>Some subtle Symbian panics -  1</title><content type='html'>Symbian OS produces some panic codes during program exit. Most of the time , we can locate what has gone wrong by seeing only the code number - like User 11 or user130. These panics are very much deterministic. But every once in a while one may encounter some panic codes which are very much subtle, the description of that panic code does not describe anything. Like the CONE 8 error.So,&lt;br /&gt;&lt;br /&gt;Cone 8 error -&lt;br /&gt;you do this CFbsBitmap* bitmap = iEikonEnv-&gt;CreateBitmapL( KNavigationDemo,EMbmNavigation_newBack);&lt;br /&gt;&lt;br /&gt;but you dont delete it after working&lt;br /&gt;&lt;br /&gt;Cone 36 - You use a RTimer  by iTimer.CreateLocal();&lt;br /&gt;but you dont close it by iTimer.Close();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-2873833807071194246?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/2873833807071194246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=2873833807071194246' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/2873833807071194246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/2873833807071194246'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/03/some-subtle-symbian-panics-1.html' title='Some subtle Symbian panics -  1'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-2534022729715857994</id><published>2008-01-21T13:29:00.001+06:00</published><updated>2008-07-30T13:34:52.145+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><title type='text'>CEikEdwin character Deletion</title><content type='html'>The CEikEdwin component is nasty in the sense that many a times it gets a ETEXT 12 panic whenever one tries to delete characters from the written text. After grappling &lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;/span&gt; with this thing for some time , I have managed to write a code that does not get ETEXT panic if we delete characters from it from no matter what position.&lt;br /&gt;&lt;br /&gt;1. Create an entry for the textfield in the resource file&lt;br /&gt;   &lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;RESOURCE EDWIN r_addressinput_edwin&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;{             &lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;//flags = EAknEditorNumericInputMode;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;flags = EAknEditorFlagDefault;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;width = 10;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;lines= 1;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;maxlength =10;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;2.Construct the Textfield from the resource file:&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;        &lt;span style="font-size:85%;"&gt;TResourceReader reader;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;iCoeEnv-&gt;CreateResourceReaderLC( reader, R_ADDRESSINPUT_EDWIN );&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;iTextField1 = new ( ELeave ) CEikEdwin;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;iTextField1-&gt;SetContainerWindowL( *this );&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;iTextField1-&gt;ConstructFromResourceL( reader );&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;iTextField1-&gt;SetAknEditorInputMode(EAknEditorNumericInputMode|&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;EAknEditorTextInputMode);&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;CleanupStack::PopAndDestroy();  // Resource reader&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;3. Put the code inside the OfferkeyEventL() function of the corresponding container which holds the CEikEdwin Object&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    case EStdKeyBackspace:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;                {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;if(iTextField1-&gt;CursorPos() == 0)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    break;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;TInt cursorPos = iTextField1-&gt;CursorPos();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;if(iTextField1-&gt;CursorPos()  == iTextField1-&gt;TextLength())&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;iTextField1-&gt;InsertDeleteCharsL(iTextField1-&gt;TextLength()-1,_L(""),TCursorSelection&lt;br /&gt;(iTextField1-&gt;TextLength(), iTextField1-&gt;TextLength()-1));&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;else&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;iTextField1-&gt;InsertDeleteCharsL(cursorPos,_L(""),&lt;br /&gt;TCursorSelection(cursorPos,cursorPos-1));&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;                    iTextField1-&gt;SetCursorPosL(cursorPos-1,EFalse);&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;DrawNow();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;break;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It worked for me.... I guess it work  for others.&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-2534022729715857994?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/2534022729715857994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=2534022729715857994' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/2534022729715857994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/2534022729715857994'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2008/01/ceikedwin-character-deletion.html' title='CEikEdwin character Deletion'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-7516568567700408761</id><published>2007-12-18T09:28:00.000+06:00</published><updated>2008-07-30T13:35:14.171+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><title type='text'>Taking ScreenShot in Symbian</title><content type='html'>Here is an example of how to take ScreenShot and saving it to the file as .jpeg. With this, we can take ScreenShot of any other running program.&lt;br /&gt;1.Create blank bitmap:&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    iBitmap = new (ELeave)CFbsBitmap;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    iBitmap-&gt;Create( TSize(176,208),EColor16M );&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;2.Create a rectangle with size of whole Device Screen:&lt;br /&gt;    &lt;span style="font-weight: bold; font-style: italic;"&gt;iScreenRect = TRect(TPoint(0,0),TSize(176,208));&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;3. Copy Screen To this bitmap and save it into memory.&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    iScreenDevice-&gt;CopyScreenToBitmap(iBitmap,iScreenRect);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    TBuf&lt;50&gt; myBuf;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    myBuf.Append(KFileName);&lt;br /&gt;&lt;br /&gt;    myBuf.AppendNum(iCaptureCount);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    myBuf.Append(KExtension);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    iEncoder =         CImageEncoder::FileNewL(iFsSession,myBuf,&lt;br /&gt;                                                                                            CImageEncoder::EOptionAlwaysThread,&lt;br /&gt;                                                                                            KImageTypeJPGUid);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    myBuf.Delete(0,50);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    TRequestStatus status;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    iEncoder-&gt;Convert(&amp;amp;status,*iBitmap);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    SetActive();&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;The  conversion process is asynchronous. When it is completed, RunL() is called. Inside RunL()&lt;br /&gt;do whatever is needed if you want to take continuous screenshots.&lt;br /&gt;Indside RunL():&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    delete iEncoder;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    iEncoder = NULL;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;    iCaptureCount++;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;/span&gt;&lt;br /&gt;We can control continuous screenShot simply by using a timer.&lt;br /&gt;When We run the program , then we can send this screen Capturing program into background and then the screenshot of whatever that is in foreground will be taken. Elementaire!!!&lt;br /&gt; &lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-7516568567700408761?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/7516568567700408761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=7516568567700408761' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/7516568567700408761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/7516568567700408761'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2007/12/taking-screenshot-in-symbian.html' title='Taking ScreenShot in Symbian'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-5387371461353742987</id><published>2007-12-13T13:11:00.000+06:00</published><updated>2007-12-13T13:53:31.970+06:00</updated><title type='text'>Creating a transparent Shadow on Container</title><content type='html'>These Days I was working on creating a customized Context menu on Symbian.Unlike the default context menu that symbian OS provides , it has to  be drawn by hand. But, it can be constructed as a UI control, so that we can use common keyEvent Handler functions like OfferKeyEventL or HandleControlEventL .  So, first I made a context menu which looked like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_WYKEhPq_evM/R2DjlTSL9RI/AAAAAAAAAGk/VOrKX3yUhhI/s1600-h/before.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_WYKEhPq_evM/R2DjlTSL9RI/AAAAAAAAAGk/VOrKX3yUhhI/s320/before.bmp" alt="" id="BLOGGER_PHOTO_ID_5143361004428326162" border="0" /&gt;&lt;/a&gt;Here I gave a shadow effect on the context menu. But the shadow was covering the container below it. Then I found that symbian CGraphicsContext class provides a cool thing called TDrawMode. It is set by  CGraphicsContext::SetDrawMode(CGraphicsContext::TDrawMode). If we set it to EDrawModeAND then the effect is :&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_WYKEhPq_evM/R2Dk1DSL9SI/AAAAAAAAAGs/g8OnRI_9Ej8/s1600-h/after.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_WYKEhPq_evM/R2Dk1DSL9SI/AAAAAAAAAGs/g8OnRI_9Ej8/s320/after.bmp" alt="" id="BLOGGER_PHOTO_ID_5143362374522893602" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;KHUOL.......&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-5387371461353742987?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/5387371461353742987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=5387371461353742987' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/5387371461353742987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/5387371461353742987'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2007/12/creating-transparent-shadow-on.html' title='Creating a transparent Shadow on Container'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_WYKEhPq_evM/R2DjlTSL9RI/AAAAAAAAAGk/VOrKX3yUhhI/s72-c/before.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-6266053660492139075</id><published>2007-11-18T11:24:00.000+06:00</published><updated>2008-07-30T13:35:37.307+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><title type='text'>Sending Symbian Application to the Background</title><content type='html'>So simple, yet so hard to find. So, saving it into my blog for future reference.&lt;br /&gt;Suppose we want to send the application to the background when the Call Disconnect Button is pressed. To do that, we have to do the following:&lt;br /&gt;&lt;br /&gt;1. Add &lt;span style="color: rgb(153, 0, 0);"&gt;void&lt;/span&gt; &lt;span style="color: rgb(204, 0, 0);"&gt;HandleWsEventL(const TWsEvent&amp;amp; aEvent,CCoeControl* aDestination); &lt;span style="color: rgb(0, 0, 0);"&gt;function in our AppUi Class.&lt;br /&gt;2.Add the following lines in our AppUi ConstructL() function:&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;                RWindowGroup&amp;amp; groupWin = CCoeEnv::Static()-&gt;RootWin();      &lt;/span&gt; &lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;               iEndKey1 = groupWin.CaptureKeyUpAndDowns( EStdKeyNo, 0, 0 );&lt;/span&gt;&lt;br /&gt;               &lt;span style="color: rgb(204, 0, 0);"&gt;iEndKey2 = groupWin.CaptureKey( EKeyNo, 0, 0 );&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;3. Add the following lines in the AppUi destructor function:&lt;br /&gt;              &lt;span style="color: rgb(204, 0, 0);"&gt;                RWindowGroup&amp;amp; groupWin = CCoeEnv::Static()-&gt;RootWin(); &lt;/span&gt; &lt;span style="color: rgb(204, 0, 0);"&gt;                               groupWin.CancelCaptureKeyUpAndDowns( iEndKey1 );&lt;/span&gt;&lt;br /&gt;               &lt;span style="color: rgb(204, 0, 0);"&gt;groupWin.CancelCaptureKey( iEndKey2 );&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;4. Add the following lines in the &lt;span style="color: rgb(204, 0, 0);"&gt;HandleWsEvent &lt;span style="color: rgb(0, 0, 0);"&gt;function of our AppUi class :&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;                TInt key = aEvent.Key()-&gt;iScanCode;&lt;/span&gt; &lt;span style="color: rgb(204, 0, 0);"&gt;              &lt;br /&gt;if(EStdKeyNo == key &amp;amp;&amp;amp; aEvent.Type() == EEventKey)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;                {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;                    RWsSession fSession;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;                    User::LeaveIfError(fSession.Connect());&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;                    TApaTaskList taskList2(fSession);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;                    TApaTask task2 = taskList2.FindApp(TUid::Uid(0x04ca2be8)); //The app UID&lt;/span&gt; &lt;span style="color: rgb(204, 0, 0);"&gt;                    if(task2.Exists())&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;                    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;                        task2.SendToBackground();&lt;/span&gt; &lt;span style="color: rgb(204, 0, 0);"&gt;                  &lt;br /&gt;}&lt;br /&gt;&lt;/span&gt; &lt;span style="color: rgb(204, 0, 0);"&gt;fSession.Close();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;                }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;                else&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;                {&lt;br /&gt;&lt;/span&gt; &lt;span style="color: rgb(204, 0, 0);"&gt;CAknAppUi::HandleWsEventL(aEvent,aDestination);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;                }&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;This will send the Application to the background...&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-6266053660492139075?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/6266053660492139075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=6266053660492139075' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6266053660492139075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6266053660492139075'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2007/11/sending-application-to-background.html' title='Sending Symbian Application to the Background'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-397158072256731948</id><published>2007-10-25T15:29:00.000+06:00</published><updated>2008-07-30T13:35:59.060+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><title type='text'>Messaging Type Module in Symbian S60 -1</title><content type='html'>There is a very interesting thing in Symbian OS . This is called messaging type modules. This works as follows. Suppose, someone has developed an project for sharing of mobile pictures. It can be something like mobile &lt;a href="http://www.flickr.com/tools/mobile/"&gt;flickr&lt;/a&gt;. There is a software part for mobile (either J2me or Symbian) and there is a server part. Using the software from mobile, anyone can upload a picture to the server and also add title description, set rating etc. Using the same software, some other mobile user can log onto the server and browse the pictures uploaded by others. There are many software and applications now available in the market. For example, there is &lt;a href="http://www.livtv.co.za/LivTV/"&gt;LivTv&lt;/a&gt;. But there is a little user experience related issue here. A user has to use the software in order to upload a picture to the server. He has to run the software, take pictures from inside that software and then upload it to the server. He cannot just use the default camera application of the mobile phone , take a picture and the send it to the server. But, actually, he can if he uses Symbian phone.&lt;br /&gt;  Lets look at the following picture, although the picture is from the emulator &lt;br /&gt;of Symbian S60 2nd edition phones.&lt;br /&gt;     &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_WYKEhPq_evM/SIWN7NpP1dI/AAAAAAAAAIM/-pwcd6oRS0w/s1600-h/emu1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_WYKEhPq_evM/SIWN7NpP1dI/AAAAAAAAAIM/-pwcd6oRS0w/s320/emu1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5225738991047792082" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;     There is an option in the default camera application of the mobile phone, that is send . We can send the picture taken as MMS , via bluetooth , or via infrared. Here is the twist - we can also send to a custom server of our own. This is done via the MTM or messaging type modules of Symbian OS. This is really an interesting option. If we use this , we wont have to use the software just to upload a  picture to the server. &lt;br /&gt;    When we install the MTM software in the phone , we get another option in all or some selected modules of the phone - like in camera, in SMS , etc. The option is inside the "send" option like "via MyApp". Using this option , one can upload the &lt;br /&gt;data to his own server. The technical details are to be found &lt;a href="http://wiki.forum.nokia.com/index.php/Message_Type_Modules"&gt;here &lt;/a&gt;and &lt;a href="http://www.symbian.com/developer/techlib/v9.2docs/doc_source/guide/Messaging-subsystem-guide/MessagingGuide/MessagingGuide3/index.html#MessagingGuide3.toc"&gt;here&lt;/a&gt;&lt;br /&gt;   I wont go to the technical details, I will try to describe just how to configure the MTM example provided by the Symbian to make a simple MTM work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-397158072256731948?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/397158072256731948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=397158072256731948' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/397158072256731948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/397158072256731948'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2007/10/messaging-type-module-in-symbian-s60-1.html' title='Messaging Type Module in Symbian S60 -1'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_WYKEhPq_evM/SIWN7NpP1dI/AAAAAAAAAIM/-pwcd6oRS0w/s72-c/emu1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-1882521633470944583</id><published>2007-10-22T17:33:00.000+06:00</published><updated>2008-07-30T13:36:32.954+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><title type='text'>Writing a template class in Symbian C++</title><content type='html'>This is for the new born Symbian-Babies . This is the beginning of the beginning of Development in Symbian C++. Here, it will be shown how to write a template class in Symbian C++. Remember, this is an overly simplified example of writing template class.But with common C++ and Object Oriented Paradigm knowledge , anyone can extend to fulfill their purpose.&lt;br /&gt;The template class looks like this...&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_WYKEhPq_evM/Rx2SCFX7emI/AAAAAAAAAEk/z5Qroq4JtYk/s1600-h/Figure1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_WYKEhPq_evM/Rx2SCFX7emI/AAAAAAAAAEk/z5Qroq4JtYk/s320/Figure1.jpg" alt="" id="BLOGGER_PHOTO_ID_5124412515517430370" border="0"&gt;&lt;/a&gt;and to use the template class...&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_WYKEhPq_evM/Rx2SeVX7enI/AAAAAAAAAEs/ypAaD3K2t5w/s1600-h/Figure2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_WYKEhPq_evM/Rx2SeVX7enI/AAAAAAAAAEs/ypAaD3K2t5w/s320/Figure2.jpg" alt="" id="BLOGGER_PHOTO_ID_5124413000848734834" border="0"&gt;&lt;/a&gt;Just as a reminder, there is an issue regarding using the template class. Click &lt;a href="http://www.parashift.com/c++-faq-lite/templates.html#faq-35.12"&gt;here&lt;/a&gt; to check that.&lt;br /&gt;We can easily use a user defined class as a parameterized data type of the template class.&lt;br /&gt;Let a simple class be..&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_WYKEhPq_evM/Rx2XEVX7epI/AAAAAAAAAE4/CAWxORyi5x0/s1600-h/Figure3.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_WYKEhPq_evM/Rx2XEVX7epI/AAAAAAAAAE4/CAWxORyi5x0/s320/Figure3.jpg" alt="" id="BLOGGER_PHOTO_ID_5124418051730274962" border="0"&gt;&lt;/a&gt;The definition is also pretty simple... But just in case , we add here ...&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_WYKEhPq_evM/Rx20ylX7esI/AAAAAAAAAFI/g23-FaK_SWY/s1600-h/Figure4.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_WYKEhPq_evM/Rx20ylX7esI/AAAAAAAAAFI/g23-FaK_SWY/s320/Figure4.jpg" alt="" id="BLOGGER_PHOTO_ID_5124450732136430274" border="0"&gt;&lt;/a&gt;And to use the template class with the parameterized data  type as CSimpleClass...&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_WYKEhPq_evM/Rx21RFX7etI/AAAAAAAAAFQ/4qlMQviE3lo/s1600-h/Figure5.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_WYKEhPq_evM/Rx21RFX7etI/AAAAAAAAAFQ/4qlMQviE3lo/s320/Figure5.jpg" alt="" id="BLOGGER_PHOTO_ID_5124451256122440402" border="0"&gt;&lt;/a&gt;This is how we can use template classes. Actually, anyone with a good OO and C++ knowledge can at once device or at least grasp this thing...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-1882521633470944583?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/1882521633470944583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=1882521633470944583' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/1882521633470944583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/1882521633470944583'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2007/10/writing-template-class-in-symbian-c.html' title='Writing a template class in Symbian C++'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_WYKEhPq_evM/Rx2SCFX7emI/AAAAAAAAAEk/z5Qroq4JtYk/s72-c/Figure1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-2323130010793516848</id><published>2007-10-07T19:09:00.000+06:00</published><updated>2008-07-30T13:36:15.743+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><title type='text'>Implementation of Observer Pattern Using Symbian View+Container And ActiveObject</title><content type='html'>&lt;div style="text-align: justify;"&gt;Here we will give an implementation example of the observer design pattern in Symbian C++. We will implement it in Symbian S60 2nd Edition, although the developer SDK version is not important that here because we will not be doing any extensive of any SDK API.&lt;br /&gt;The original Observer pattern need not to be described here because that is available over the net or reference books.&lt;br /&gt;&lt;br /&gt;Symbian Application depends on the view based architecture. That is , we can use Symbian view and Container classes together to present some Model on the application. So, we will use Symbian View &lt;span style="font-weight: bold;"&gt;(CAknView)&lt;/span&gt; and Container &lt;span style="font-weight: bold;"&gt;(CCoeControl)&lt;/span&gt;  classes for the view part of the Observer pattern implementation. Actually, sample application implementing the Observer Pattern needs two Views + containers , one of which will be the opening or Default view, and the other will present the changing data (Which is actually the view used in the Observer pattern).&lt;br /&gt;&lt;br /&gt;Along with demonstrating the implementation of the Observer pattern , here we  have used multiple views in my application. In my next blog I will show how to do that.Otherwise, carefully looking at the current example will also do.&lt;br /&gt;&lt;br /&gt;For implementing the observer pattern , we will need Model which holds the transient or changing data. For simulating the changing data, we will use Active objects. In other cases, it can be a class with asynchronous functions. Its a simple class which extends the CActive class and holds a list of Observers (Described later) which observers on the change of Data. It also contains functions for attaching and detaching observers and also for notifying the observer upon change in Data.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_WYKEhPq_evM/RxiNoFX7eiI/AAAAAAAAAEE/oqENfLzq93U/s1600-h/Figure1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 403px; height: 268px;" src="http://bp1.blogger.com/_WYKEhPq_evM/RxiNoFX7eiI/AAAAAAAAAEE/oqENfLzq93U/s320/Figure1.jpg" alt="" id="BLOGGER_PHOTO_ID_5123000295910767138" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The Class which acts as the model is called &lt;span style="font-style: italic; font-weight: bold;"&gt;"CUserData" &lt;/span&gt;(just for the record)..&lt;br /&gt;&lt;br /&gt;For now, it is enough to show only the model class decleration. Now we turn to Observers. One things should be kept in mind here, this is not optimal example of implementation of Observer Pattern, (i.e. Programming to interface, not implementation etc).&lt;br /&gt;&lt;br /&gt;For creating Observers , we first create an Observer interface through which the actual observers will be attached , detached or notified by the model.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_WYKEhPq_evM/RxiUgVX7ejI/AAAAAAAAAEM/WDuZfMUeKto/s1600-h/Figure2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_WYKEhPq_evM/RxiUgVX7ejI/AAAAAAAAAEM/WDuZfMUeKto/s320/Figure2.jpg" alt="" id="BLOGGER_PHOTO_ID_5123007859348175410" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now, the observer interface is ready. Now we declare the Observer (The View + Container classes)  which implements this MObserver interface.&lt;br /&gt;The View Part: This is the main part.. This will keep connection with the Model.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_WYKEhPq_evM/RxiZ91X7ekI/AAAAAAAAAEU/Hug9fnqEAIs/s1600-h/Figure3.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_WYKEhPq_evM/RxiZ91X7ekI/AAAAAAAAAEU/Hug9fnqEAIs/s320/Figure3.jpg" alt="" id="BLOGGER_PHOTO_ID_5123013863712455234" border="0" /&gt;&lt;/a&gt;Now , we need a controller. Here, the AppUI will act as a controller. It has reference to the view and the Model. It controls the change in view too. Here is the snapshot of our AppUI class...&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_WYKEhPq_evM/Rxwmh1X7elI/AAAAAAAAAEc/DGmlmTkHZUg/s1600-h/Figure4.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_WYKEhPq_evM/Rxwmh1X7elI/AAAAAAAAAEc/DGmlmTkHZUg/s320/Figure4.jpg" alt="" id="BLOGGER_PHOTO_ID_5124012838745766482" border="0" /&gt;&lt;/a&gt;Now, we see how it works...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1.&lt;/span&gt; Create the Observer View and Subject (CUserData) from inside the AppUI.&lt;br /&gt;&lt;br /&gt;void CObserverTestAppUi::ConstructL()&lt;br /&gt; {&lt;br /&gt; BaseConstructL();&lt;br /&gt; iAppContainer = new (ELeave) CObserverTestContainer;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    //we create the Observer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    iUserStatusView = new (ELeave) CUserStatusView(*this,KNoView);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    iUserStatusView-&gt;ConstructL();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    AddViewL(iUserStatusView);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    //We create another View which is the default view&lt;/span&gt;&lt;br /&gt; iOpeningView = new (ELeave) COpeningView(*this,KNoView);&lt;br /&gt; iOpeningView-&gt;ConstructL();&lt;br /&gt; AddViewL(iOpeningView);&lt;br /&gt; &lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    //we create the Subject&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    iGpsData = new (ELeave) CUserData();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    iGpsData-&gt;ConstructL();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; iAppContainer-&gt;SetMopParent( this );&lt;br /&gt; iAppContainer-&gt;ConstructL( ClientRect() );&lt;br /&gt; SetDefaultViewL(*iOpeningView);&lt;br /&gt;&lt;br /&gt; AddToStackL( iAppContainer );&lt;br /&gt; }&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;In the &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;CUserStatusView class , there is not much to show, we just have an Update Function which is called from the Subject;s Notify() function.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;void CUserStatusView::Update(CUserData* theChangedSubject)&lt;br /&gt;{&lt;br /&gt; iContainer-&gt;SetSize(theChangedSubject-&gt;GetRectSize());&lt;br /&gt; iContainer-&gt;SetAngle(theChangedSubject-&gt;DirectionAngle());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;It is evident what this function does.... :-)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3.&lt;/span&gt; There is not also much to show the UserStatusContainer , inside its draw function , the data from CUserData is taken and shown in appropriate format to the screen.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4.&lt;/span&gt; The Subject (CUserData) class has some importatnt functions which are notable.&lt;br /&gt;void CUserData::Attach(MObserver* anObserver)&lt;br /&gt;{&lt;br /&gt;     iObservers.Append(anObserver);&lt;span style="color: rgb(0, 153, 0);"&gt;//attaches the observer to this&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void CUserData::Detach(MObserver* anObserver)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void CUserData::Notify()&lt;br /&gt;{&lt;br /&gt;         //notifies all the observers...&lt;br /&gt;     TInt numObservers = iObservers.Count();&lt;br /&gt;     for(TInt index =0; index &lt;&gt;Update(this);&lt;span style="color: rgb(0, 153, 0);"&gt;//this is the views Update function stated at step 2&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5.  &lt;/span&gt;And the above Notify() function is called from the Active Objects RunL() function..&lt;br /&gt;void CUserData::RunL()&lt;br /&gt;{&lt;br /&gt;   ...................&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    Notify();&lt;/span&gt;&lt;br /&gt; if (iState == EUninitialized) {&lt;br /&gt;     // Do something the first time RunL() is called&lt;br /&gt;     iState = EInitialized;&lt;br /&gt; } else if (iState != EError) {&lt;br /&gt;     // Do something&lt;br /&gt; }&lt;br /&gt; iTimer.After(iStatus, 1000000);    // Set for 1 sec later&lt;br /&gt; SetActive();                    // Tell scheduler a request is active&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;6. &lt;/span&gt;Now the most important thing... controlliing the view from AppUI...&lt;br /&gt;&lt;br /&gt;void CObserverTestAppUi::HandleCommandL(TInt aCommand)&lt;br /&gt; {&lt;br /&gt; switch ( aCommand )&lt;br /&gt;     {&lt;br /&gt;     case EAknSoftkeyBack:&lt;br /&gt;     case EEikCmdExit:&lt;br /&gt;         {&lt;br /&gt;         Exit();&lt;br /&gt;         break;&lt;br /&gt;         }&lt;br /&gt;   &lt;span style="color: rgb(255, 0, 0);"&gt;  case EObserverTestCmdAppTest:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;                iGpsData-&gt;Attach(iUserStatusView);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;                iGpsData-&gt;StartL(1000000);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;                ActivateViewL(TVwsViewId(KUidObserverTest,KUserStatusViewId));&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;                break;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;            }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;span style="color: rgb(255, 0, 0);"&gt;case EViewChangeCmd:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;                iGpsData-&gt;Detach(iUserStatusView);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;                iGpsData-&gt;Cancel();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;                ActivateViewL(TVwsViewId(KUidObserverTest,KOpeningViewId));&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;                break;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;            }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     default:&lt;br /&gt;         break;  &lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;This is the implementation details of the Observer pattern in Symbian C++ platform. Because of the Symbian OS architecture, the implementation is so Easy. There , is not much to customize, the great Symbian has it all made up from before....&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-2323130010793516848?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/2323130010793516848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=2323130010793516848' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/2323130010793516848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/2323130010793516848'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2007/10/implementation-of-observer-pattern.html' title='Implementation of Observer Pattern Using Symbian View+Container And ActiveObject'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_WYKEhPq_evM/RxiNoFX7eiI/AAAAAAAAAEE/oqENfLzq93U/s72-c/Figure1.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-1336557498984225756</id><published>2007-09-11T17:06:00.000+06:00</published><updated>2008-07-30T13:36:50.645+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><title type='text'>Easiest Way To Use Font on Canvas</title><content type='html'>&lt;span style="font-size:100%;"&gt;There are  many ways to use CFont in Symbian with the help of which we can draw texts on Canvas. But most easy way (IMHO!) is the following one:&lt;br /&gt;&lt;br /&gt;1. Keep a CFont* as class member variable.&lt;br /&gt;&lt;/span&gt;                      &lt;span style="font-weight: bold;font-size:100%;" &gt;  CFont* iFont;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;2. Load font in the class's ConstructL() like :&lt;br /&gt;&lt;/span&gt;                    &lt;span style="font-weight: bold;font-size:100%;" &gt;TInt fontSize = 5;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;                    _LIT(KMyFontName,"Nokia Sans SemiBold S60");&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;                    TFontSpec myFontSpec(KMyFontName,fontSize*20);&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;                    CGraphicsDevice* iScreenDevice = iCoeEnv-&gt;ScreenDevice();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;                   iScreenDevice-&gt;GetNearestFontInTwips(iFont,myFontSpec);&lt;br /&gt;&lt;/span&gt;               &lt;span style="font-size:100%;"&gt;&lt;br /&gt;3.Use the font whenever needed:&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;                    gc.UseFont(iFont);&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;                    gc.SetPenColor(KRgbRed);&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;                    gc.DrawText(_L("MyText"),TPoint(100,100));     &lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;                    gc.DiscardFont();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;4. Release the font in the class's Destructor:&lt;br /&gt;&lt;/span&gt;                      &lt;span style="font-weight: bold;font-size:100%;" &gt;  iCoeEnv-&gt;ScreenDevice()-&gt;ReleaseFont(iFont);&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-1336557498984225756?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/1336557498984225756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=1336557498984225756' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/1336557498984225756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/1336557498984225756'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2007/09/easiest-way-to-use-font-on-canvas.html' title='Easiest Way To Use Font on Canvas'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-3038706621817461818</id><published>2007-09-02T14:01:00.001+06:00</published><updated>2008-07-30T13:37:09.764+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='S60 3rd'/><title type='text'>Usage of RPointerArray</title><content type='html'>&lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt;&lt;span style="font-size:11;"&gt;RPointerArray is one of the most frequently used Data Structures in Symbian C++ SDK. But due to the complexity of Symbian C++, its usage sometimes becomes a nightmare. If not properly handled, using RPointerArray may introduce a lot of memory leaks and bugs.&lt;br /&gt;To Not one thing about RPointerArray : it always keeps a pointer to the instance and not the copy of the instance. So if we write RPointerArraya then it actually means an array of Pointer to TPoint.&lt;br /&gt;The most common pattern of usage of RPointerArray will be discussed here.&lt;br /&gt;RPointerArray can be of several types:&lt;br /&gt;&lt;span style=""&gt;                                       &lt;/span&gt;&lt;i&gt;1.RPointerArray&lt;'T'&gt; myPointerArray;&lt;br /&gt;&lt;span style=""&gt;                                       &lt;/span&gt;2.RPointerArray&lt;'T*'&gt; myPointerArray;&lt;br /&gt;&lt;span style=""&gt;                                       &lt;/span&gt;3.RPointerArray&lt;'T*'&gt;* myPointerArray;&lt;br /&gt;H&lt;/i&gt;owever, the usage and cleanup of the RPointerArray differs according to the declaration type.Here they will be with real examples:&lt;br /&gt;Type 1: &lt;span style="color: rgb(255, 102, 0);"&gt;As Member Variable:&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Construction&lt;/span&gt;&lt;br /&gt;&lt;i&gt;void CMyClass::ConstructL()&lt;br /&gt;{&lt;/i&gt;&lt;br /&gt;&lt;span style=""&gt;      &lt;/span&gt;............................&lt;br /&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;i&gt;iArray1 = RPointerArray(10);&lt;br /&gt;&lt;span style=""&gt;      &lt;/span&gt;for(TInt index = 0; index ‘&lt;’10; index++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;            &lt;/span&gt;iArray1.Append(new (ELeave)TPoint(index*10, index*10));&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="color: rgb(51, 102, 255);font-size:11;" &gt;Usage Inside Function&lt;/span&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;&lt;br /&gt;void CMyClass::void f()&lt;br /&gt;{&lt;br /&gt;&lt;span style=""&gt;       &lt;/span&gt;TPoint tempPoint;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;for(TInt index = 0; index ‘&lt;’iArray1.Count(); index ++) &lt;span style=""&gt;       &lt;/span&gt;&lt;span style=""&gt;       &lt;/span&gt;tempPoint = TPoint(*iArray1[index]);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="color: rgb(51, 102, 255);font-size:11;" &gt;Destruction&lt;/span&gt;&lt;span style="font-size:11;"&gt;&lt;br /&gt;&lt;i&gt;CMyClass::~CMyClass()&lt;br /&gt;{&lt;br /&gt;&lt;span style=""&gt;           &lt;/span&gt;for(TInt index = 0; index’&lt;’ iArray1.Count(); index++) &lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;         &lt;/span&gt;delete iArray1[index];&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;iArray1.Close();&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="font-size:11;"&gt;Here We have not pushed the RpointerArray into the cleanup stack for two reasons:&lt;br /&gt;1. We should never push a member valriable into the cleanup stack&lt;br /&gt;2. Although RPointerArray holds pointers , but it is not itself a pointer (As declaration Suggests) and we cannot push a variable into the cleanup stack if it is not a pointer.&lt;i&gt;&lt;br /&gt;&lt;/i&gt;Type 1:Local Usage&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Construction and Usage And Destruction&lt;/span&gt;&lt;br /&gt;&lt;i&gt;void CMyClass::MyFunction()&lt;br /&gt;{&lt;br /&gt;RPointerArray array1 = RPointerArray(10);//construction&lt;br /&gt;for(TInt index = 0; index ‘&lt;’10; index++)//put values inside array&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;           array1.Append(new (ELeave) TPoint(index*10,index*10));&lt;br /&gt;DoSomeThing()&lt;/span&gt;&lt;/i&gt;&lt;span style="font-size:11;"&gt;;&lt;span style="color: rgb(51, 102, 255);"&gt;//do something with It&lt;br /&gt;&lt;i&gt;/*******************Destruction**************************************/&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;i&gt;// for(index = 0 ; index’&lt;’ array1.Count(); index++)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;// delete array1[index] ;&lt;br /&gt;//array1.Close();&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;//For T Classes , we have to use this type of cleanup&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;/*******************Destruction**************************************/&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="color: rgb(51, 102, 255);font-size:11;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;array1.ResetAndDestroy(); //&lt;span style="color: rgb(51, 204, 255);"&gt;For C Classes and Basic Data Types(TReal), we have to use this&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;//type of cleanup&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;br /&gt;&lt;/span&gt;}&lt;br /&gt;&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;                &lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt;&lt;span style="font-size:11;"&gt;Type 2: As a member Variable:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:11;" &gt;Construction&lt;/span&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;Void CMyClass:ConstructL()&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:10;"&gt;iArray2&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:10;"&gt; = &lt;span style=""&gt; &lt;/span&gt;new (ELeave) RPointerArray&lt;’TPoint’&gt;(10);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:10;"&gt;for&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:10;"&gt;(TInt index = 0; index ‘&lt;’ 10; index++)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:10;"&gt;           iArray2-‘&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:10;"&gt;&gt;’Append(new (ELeave)TPoint(index*10, index*10));&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;                              &lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt;&lt;b&gt;&lt;span style="color: rgb(51, 102, 255);font-size:10;" &gt;Usage&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-size:10;"&gt;Void CMyClass::DoSomeThing()&lt;br /&gt;{&lt;br /&gt;TPoint&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:10;"&gt; tempPoint;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:10;"&gt;for&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:10;"&gt;(TInt index = 0; index ‘&lt;’ iArray2-‘&gt;’Count(); index ++)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:10;"&gt;             tempPoint&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:10;"&gt; = TPoint(*(*iArray2)[index]);&lt;br /&gt;}&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style="font-size:10;"&gt;Destruction&lt;/span&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-size:10;"&gt;CMyClass::~CMyClass()&lt;br /&gt;{&lt;br /&gt;for(TInt index = 0;index ‘&lt;’ iArray2-‘&gt;’Count(); index ++)&lt;br /&gt;         delete (*iArray2)[index];&lt;br /&gt;iArray2-‘&gt;’Reset();&lt;br /&gt;delete iArray2&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;                                                          &lt;p class="MsoNormal" style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 102, 255);font-size:10;" &gt;Local Usage&lt;/span&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-size:10;"&gt;Void CMyClass::MyFunction()&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11;"&gt;RPointerArray&lt;’TPoint’&gt;* iArray3 = new (ELeave)RPointerArray&lt;’TPoint’&gt;(10);&lt;br /&gt;CleanupStack&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;::PushL(iArray3);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11;"&gt;CleanupClosePushL&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;(*iArray3);&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style="font-size:11;"&gt;//Append Values&lt;/span&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;for(TInt index = 0; index ‘&lt;’ 10; index ++)             iArray3-‘&gt;’Append(new (ELeave) TPoint(index,index));&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style="font-size:11;"&gt;//Sample Usage&lt;/span&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;TPoint&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt; tempPoint;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11;"&gt;for(index =0; index ‘&lt;’ iArray3-‘&gt;’Count(); index++)&lt;br /&gt;        tempPoint = TPoint(*(*iArray3)[index]);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11;"&gt;//....................&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style="font-size:11;"&gt;//Deleition and Cleanup&lt;i&gt;.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;for(index&lt;span style=""&gt;  &lt;/span&gt;= 0 ; index ‘&lt;’ iArray3-‘&gt;’Count(); index++)&lt;br /&gt;&lt;span style=""&gt;           &lt;/span&gt;delete (*iArray3)[index];&lt;br /&gt;CleanupStack&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;::PopAndDestroy(iArray3);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:11;"&gt;CleanupStack&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;::PopAndDestroy(iArray3);&lt;br /&gt;}&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:11;"&gt;RPointerArray&lt;’TPoint*’&gt;*array4 = new (ELeave)RPointerArray&lt;’TPoint*’&gt;(10);&lt;br /&gt;TPoint* myPoint2 = new (ELeave) TPoint;&lt;br /&gt;myPoint2-‘&gt;’SetXY(100,100);&lt;br /&gt;array4-‘&gt;’Append(&amp;amp;myPoint2);&lt;br /&gt;TPoint* myPoint1;&lt;br /&gt;for(TInt index = 0; index ‘&lt;’ array4-‘&gt;’Count(); index++)&lt;br /&gt;{&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;myPoint1 = new TPoint(**(*array4)[index]);&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;        &lt;p class="MsoNormal" style="color: rgb(0, 0, 0);"&gt;&lt;i&gt;&lt;span style="font-size:11;"&gt;delete myPoint1;&lt;br /&gt;for(TInt index = 0; index ‘&lt;’ array4-‘&gt;’Count(); index ++)&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;delete *(*array4)[index];&lt;br /&gt;array4-‘&gt;’Reset();&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=""&gt;delete array4;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-3038706621817461818?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/3038706621817461818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=3038706621817461818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/3038706621817461818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/3038706621817461818'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2007/09/usage-of-rpointerarray_02.html' title='Usage of RPointerArray'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-6709140903943945245</id><published>2007-08-29T16:21:00.000+06:00</published><updated>2008-07-30T13:37:50.288+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><title type='text'>How to develop and Install a DLL in Symbian Development Environment.</title><content type='html'>&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;It is not necessary to describe what dll is and why they are used. I will just try to discuss dll from Symbian development point of view. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;          &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;1. How to write a DLL.&lt;br /&gt;2. Building a DLL.&lt;br /&gt;3. How to use dll in Program.&lt;br /&gt;4. How to load dll in Symbian devices.&lt;br /&gt;5. An example of a usage of Messaging Type Module , a symbian System Level Dll.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt;         &lt;/o:p&gt;In Symbian OS architecture, DLLs (Dynamic Link Library) are heavily used. However the discussion will start with polymorphic DLLs. From the usage point of view, Polymorphic are no different from static Interface DLLs – both of these are loaded and linked at runtime. In Symbian development, there is a bit difference between static interface dll and polymorphic interface dll. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;        Static interface DLL s have a specific and unique set of functions – in other words, 2 dlls with the same function name can not co exist in memory (One can not be loaded if other is loaded already).Static interfaces DLLs always have .dll extension. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;        Polymorphic DLLs are kind of different. Polymorphic DLL s work as a plug in that implements an abstract interface – it implements a concrete class that extends an abstract interface. Polymorphic dlls are explicitly loaded by &lt;span style="font-weight: bold; font-style: italic;"&gt;RLibrary::Load()&lt;/span&gt; and closed using &lt;span style="font-weight: bold; font-style: italic;"&gt;RLibrary::Close();&lt;/span&gt;&lt;br /&gt;Polymorphic DLL s normally do not end in .dll but it has other extensions like .prn , .prt .app (more descriptive of the type of plug in they are implementing).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt;         &lt;/o:p&gt;Developing a static interface dll is straightforward and there are many articles found in the internet which describes how to build&lt;span style=""&gt;  &lt;/span&gt;a static DLL. However, here is the process in a nutshell.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;!--[if !supportLists]--&gt;&lt;/p&gt;&lt;p class="MsoNormal"  style="margin-left: 0.75in; text-indent: -0.25in;font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;/p&gt;        &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;!--[if !supportLists]--&gt;&lt;/p&gt;&lt;p class="MsoNormal"  style="margin-left: 0.75in; text-indent: -0.25in;font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt;         &lt;/o:p&gt;What Clients Get :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;&lt;br /&gt;1.&lt;span style=""&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:100%;"&gt;A .h file which will be normally included by a normal #include “mydll.h”&lt;br /&gt;&lt;span style=""&gt;2.&lt;span style=""&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:100%;"&gt;A .lib file which will be linked against.&lt;br /&gt;&lt;span style=""&gt;3.&lt;span style=""&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:100%;"&gt;A .dll file which contains the implementations of all functions in the DLL.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;!--[if !supportLists]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-left: 0.75in; text-indent: -0.25in;font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;What DLL developers need to Do:&lt;br /&gt;&lt;span style=""&gt;1.&lt;span style=""&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:100%;"&gt;Declare The class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"  style="margin-left: 0.75in;font-family:times new roman;"&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;class CDLL : public CBase&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;br /&gt;{&lt;br /&gt;public:&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;br /&gt;IMPORT_C static CDLL* NewL();&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;br /&gt;IMPORT_C static CDLL* NewLC();&lt;br /&gt;IMPORT_C void MyPublicMethod();&lt;br /&gt;IMPORT_C void AnotherPublicMethod();&lt;br /&gt;private:&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;br /&gt;CDLL();&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;   void ConstructL();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;   void SomePrivateMethod(); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;};&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="text-indent: 0.5in;font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;The public functions are tagged with&lt;span style=""&gt;  &lt;/span&gt;“IMPORT_C” macro to indicate that they will be used as dll functions. The NewL() and NewLC() functions are used to initialize the instance from client code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"  style="margin-left: 0.75in;font-family:times new roman;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;2.&lt;span style=""&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;Define the implementation:&lt;br /&gt;In case of implementation , the functions that are to be Exported (Used as dll functions) will have EXPORT_C tag before the function definitions&lt;/span&gt;.&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;Creating a static interface dll through VS2003 IDE is pretty straightforward. It has some other issues related which will be discussed later.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol  style="margin-top: 0in;font-family:times new roman;" start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Build a Symbian Os Dll application by VS2003 IDE . All the      necessary changes will be made automatically in the .mmp file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Write code and specific Export functions.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Build The Solution . The bld.inf file will be created.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Go into the Group Folder inside the project folder from Command      Prompt. Write:&lt;span style=""&gt;                &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;bldmake      bldfiles&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;font-size:100%;" &gt;abld      build armi urel&lt;span style=""&gt; ;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-weight: bold; font-style: italic;font-size:100%;" &gt;MakeSis urDLL.pkg&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt; &lt;/span&gt;   &lt;/span&gt;&lt;span style=""&gt;                                                                                    &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Then the necessary .h , .lib and .dll will be created &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;              &lt;p class="MsoNormal"  style="margin-left: 0.75in; text-indent: -0.25in;font-family:times new roman;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;To use this on another application&lt;br /&gt;&lt;span style=""&gt;1.&lt;span style=""&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:100%;"&gt;Include the .h file in &lt;st1:place st="on"&gt;&lt;st1:city st="on"&gt;ur&lt;/st1:city&gt;&lt;/st1:place&gt; code.&lt;br /&gt;&lt;span style=""&gt;2.&lt;span style=""&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:100%;"&gt;Include the .lib in your project&lt;br /&gt;&lt;span style=""&gt;3.&lt;span style=""&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:100%;"&gt;Do the works as needed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt;         &lt;/o:p&gt;To install the DLL on the device :&lt;br /&gt;1.Go to the .mmp file and and this line&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;                         TARGETPATH            /system/libs   &lt;/span&gt;after &lt;span style="font-weight: bold;"&gt;TARGETTYPE &lt;/span&gt;line &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;2.Go to the pkg file and Update the target Path from &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt;; Target&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;"C:\Symbian\8.0a\S60_2nd_FP2\Epoc32\release\armi\UREL\&lt;/span&gt;&lt;b style="font-weight: bold;"&gt;UrDLL.dll&lt;/b&gt;&lt;span style="font-weight: bold;"&gt;"&lt;br /&gt;-"!:\system\libs\&lt;/span&gt;&lt;b style="font-weight: bold;"&gt;UrDLL.dll&lt;/b&gt;&lt;span style="font-weight: bold;"&gt;"&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="font-family:courier new;"&gt;&lt;span style="font-size:100%;"&gt;        Then the sis file will be created and then if we install this on the device, then the .dll will be automatically loaded into the &lt;span style="font-weight: bold;"&gt;/system/libs&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;From programming point of view, A polymorphic DLL does not pose much difference.To write a polymorphic DLL we, have to first declare an interface and its functions which all the concrete classes inheriting this interface will implement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;i&gt;The Abstract Base Class &lt;o:p style="font-weight: bold;"&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p class="MsoNormal" style="font-family: times new roman;"&gt;&lt;span style="font-size:100%;"&gt;class CMyBase : public CBase{&lt;/span&gt; &lt;span style="font-size:100%;"&gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt; :&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;      virtual void DoThis(const TDesC&amp; aValue) = 0;&lt;/span&gt; &lt;span style="color: rgb(0, 0, 0); font-weight: bold;"&gt;};&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" face="times new roman"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="color:black;"&gt;The Derived Class Implementing The Interface&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;                        &lt;p class="MsoNormal" face="times new roman"&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;class CDerived : public CMyBase&lt;br /&gt;{&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt; &lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;public:&lt;br /&gt;&lt;span style=""&gt;      &lt;/span&gt;~CDerived();&lt;br /&gt;&lt;span style=""&gt;      &lt;/span&gt;static CDerived* NewL();&lt;br /&gt;&lt;span style=""&gt;      &lt;/span&gt;static CDerived* NewLC();&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt; &lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;public:&lt;br /&gt;&lt;span style=""&gt;      &lt;/span&gt;void DoThis(const TDesC&amp; aValue);&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt; &lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;private:&lt;br /&gt;&lt;span style=""&gt;      &lt;/span&gt;CDerived();&lt;br /&gt;&lt;span style=""&gt;      &lt;/span&gt;void ConstructL();&lt;br /&gt;};&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" face="times new roman"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;            &lt;p class="MsoNormal" style="font-family: times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;&lt;i&gt;The Definition&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; (Only the implemented Function)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;void CDerived::DoThis(const TDesC&amp; aValue)&lt;br /&gt;{&lt;br /&gt;&lt;span style=""&gt;      &lt;/span&gt;CAknInformationNote* note = new (ELeave)CAknInformationNote();&lt;br /&gt;&lt;span style=""&gt;      &lt;/span&gt;note-&gt;ExecuteLD(_L("From Derived"));&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;              &lt;p class="MsoNormal" style="font-family: times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p style="font-weight: bold;"&gt;     &lt;/o:p&gt;            Now we can use this as:&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;CMyBase&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;* &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;myBase&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;      &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;myBase&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;CDerived&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;::&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;NewL&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;();&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;      &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;myBase&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;DoThis&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;_L&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;("ZAFAR"));&lt;/span&gt;&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;            That’s it. This is the whole concept, simple and Elegant . Now any one can write another DLL which implements The CMyBase class And he will be able to write his own implementation of DoThis() Fucntion. Each implementing Concrete class now resides in separate DLL.&lt;/span&gt;&lt;/p&gt;The next discussion will be about the messaging type modules....&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-6709140903943945245?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/6709140903943945245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=6709140903943945245' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6709140903943945245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/6709140903943945245'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2007/08/how-to-develop-and-installing-dll-in.html' title='How to develop and Install a DLL in Symbian Development Environment.'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-7548161447226498723</id><published>2007-08-28T16:04:00.000+06:00</published><updated>2008-07-30T13:38:09.579+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><title type='text'>Installing Symbian SDK for VS2003 Platform</title><content type='html'>I found installing Symbian SDK and Development Environment Quite Complex. There are a bunch of ways to Establish the envirnment for developing Symbian Programs. I have not  a single complete Installation Manual for Development in Symbian . After searching the internet and doing some trial and Error, I have been able to install Symbian Development Environment in a go. I am stating here the installation steps. I dont question myself while following the steps , I just become a dumbTruck. Anywayz, Here are the steps to install Symbian Development Environment in Visual Studio 2003 IDE(There may be other more elegant ways Available, but mine will surely work).&lt;br /&gt;       1. Install Visual Studio 2003 IDE.&lt;br /&gt;       2. Install      JRE 5.0&lt;br /&gt;       3. Install      Active Perl (ActivePerl-5.8.8.819-MSWin32-x86-267479.msi - Found on the internet)&lt;br /&gt;       4. Install      the Symbian SDK for visual studio 2003 (S60_SDK_v2.0_FP2_msb.zip)&lt;br /&gt;       5. Install      the visual j# redistributable package.&lt;br /&gt;       6. Install      Carbide plug-in, which is compatible for visual studio 2003.(carbide_vs_201.exe)&lt;br /&gt;       7. After      installing the files in appropriate places, when we open the visual studio      2003 a form comes asking to register for the carbide plug-in. If we select      the register form internet option, then it takes us to the forum.nokia.com      site and after logging in there, it gives us a serial; number. Putting the      serial number in the dialog of register options, Carbide is registered!!&lt;br /&gt;      8. Open      the visual studio 2003 IDE.&lt;br /&gt;      9. Select      new-&gt;project-&gt;visual c++ projects-&gt;Symbian OS and select New      Symbian OS project from the template tab.&lt;br /&gt;   10. Then      the wizard tells us to select the SDK of Symbian we are going to use for      the project. &lt;br /&gt;&lt;br /&gt;Hope This Helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-7548161447226498723?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/7548161447226498723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=7548161447226498723' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/7548161447226498723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/7548161447226498723'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2007/08/installing-symbian-sdk-for-vs2003.html' title='Installing Symbian SDK for VS2003 Platform'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-19860528423403824</id><published>2007-08-28T15:25:00.000+06:00</published><updated>2008-07-30T13:38:22.711+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S60 2nd'/><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><title type='text'>Copying Bitmap Image in Symbian C++</title><content type='html'>Here Is a simple way as how to copy an Offscreen Bitmap into another Bitmap.Suppose that we have loaded a Bitmap from the mbm (multi Bitmap File) Like this&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;CFbsBitmap* myBitmap =  iEikonEnv-&gt;CreateBitmapL(KBmpPath,index);&lt;/span&gt;&lt;br /&gt;Now we want to copy this bitmap into another CFbsBitmap object. But we dont want to pointer assignment , that is , we want to copy the contents of myBitmap into another bitmap. The way to do it is :&lt;br /&gt;  &lt;span style="font-style: italic; font-weight: bold;"&gt;CFbsBitmap*  aBitmap =  new (ELeave)CFbsBitmap;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;    aBitmap-&gt;Create(myBitmap-&gt;SizeInPixels(),myBitmap-&gt;DisplayMode());&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;    TRect tempRect(TPoint(0,0),myBitmap-&gt;SizeInPixels() );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;    TInt iBufLength = tempRect.Width() * tempRect.Height() * 2;     &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;    Mem::Copy(aBitmap-&gt;DataAddress(),myBitmap-&gt;DataAddress(),iBufLength);&lt;br /&gt;&lt;/span&gt;And Its Done.Now we can use aBitmap in the same way as myBitmap.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-19860528423403824?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/19860528423403824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=19860528423403824' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/19860528423403824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/19860528423403824'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2007/08/copying-bitmap-image-in-symbian-c.html' title='Copying Bitmap Image in Symbian C++'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1940111982610564587.post-1076577738617114872</id><published>2007-08-20T11:46:00.000+06:00</published><updated>2008-07-30T13:38:51.042+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Simple C++</title><content type='html'>This is a simple technique for Symbian, especially C++ programmers. Suppose want to change the value of a member data of an instance. But the only way you get that instance as a &lt;span style="font-style: italic;"&gt;const&lt;/span&gt; object. in that case, normally calling the value changing function wont work. Suppose you want to call the function &lt;span style="font-weight: bold;"&gt;SetHumanReadbleName()&lt;/span&gt; on the instance of &lt;span style="font-weight: bold; font-style: italic;"&gt;CMtmDllInfo&lt;/span&gt; class. But the only way you get the reference of the instance is by calling &lt;span style="font-weight: bold;"&gt;CRegisteredMtmDll::MtmDllInfo() &lt;/span&gt;function which returns a const &lt;span style="font-weight: bold; font-style: italic;"&gt;CMtmDllInfo&lt;/span&gt; object. In that case, &lt;span style="font-weight: bold;"&gt;SetHumanReadbleName()&lt;/span&gt; wont be allowed to be called on this object. So to call the function , you have to write :&lt;br /&gt;&lt;cmtmdllinfo&amp;&gt;&lt;span style="font-weight: bold;"&gt;const_cast"&lt;"CMtmDllInfo&amp;"&gt;"&lt;br /&gt;(aRegisteredDll.MtmDllInfo()).SetHumanReadableNameL(_L("X"));&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;/cmtmdllinfo&amp;&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1940111982610564587-1076577738617114872?l=pritorius.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pritorius.blogspot.com/feeds/1076577738617114872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1940111982610564587&amp;postID=1076577738617114872' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/1076577738617114872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1940111982610564587/posts/default/1076577738617114872'/><link rel='alternate' type='text/html' href='http://pritorius.blogspot.com/2007/08/simple-c.html' title='Simple C++'/><author><name>pritorius</name><uri>http://www.blogger.com/profile/10972687137229901577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_WYKEhPq_evM/Rsuwd7k7bhI/AAAAAAAAABw/qThEWmSgbOQ/s320/276732881.img.jpg'/></author><thr:total>0</thr:total></entry></feed>
