<?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-9937599</id><updated>2012-02-02T20:01:36.908-08:00</updated><category term='smart thinking'/><category term='C#'/><category term='web application'/><category term='J2ME'/><category term='ASP.NET AJAX'/><category term='P1'/><category term='Excel Printing'/><category term='Celcom'/><category term='XSLT'/><category term='nifty tools'/><category term='U-Mobile'/><category term='browser'/><category term='Nokia'/><category term='AJAX'/><category term='IE'/><category term='Malaysia Wireless Broadband'/><category term='useful shortcuts'/><category term='DOS batch'/><category term='Visual Studio .NET'/><category term='ASP.NET 3.5'/><category term='JAR'/><category term='Prepaid'/><category term='Digi Internet'/><title type='text'>Semut's References</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default?start-index=101&amp;max-results=100'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>104</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9937599.post-3087623456474675064</id><published>2012-02-02T19:59:00.000-08:00</published><updated>2012-02-02T20:01:36.923-08:00</updated><title type='text'>Spam Messages and Messenger Software in Mobile Devices. And How to Remove the Spammer</title><content type='html'>Many people are using their mobile devices to communicate nowadays. Messenger, facebook, SMS and etc in one device. And to serve the users needs, most mobile devices will come equip with multi-protocol messenger built in or free to download and install. However, because these free multi-procotol messenger software are not the de facto owner of these messenging protocol like GTalk or MSN messenger. They lack of proper update in term of protocol support and vulnerability fixe that big corp like Microsoft can offer. Because of that, spammer and malware are taking advantages of this and exploiting these loopholes. Thus, many mobile devices user are getting scam, junk messages from their mobile devices messengers. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Recently, i have just removed a long time MSN messenger spam+bot contact  of mine that has Artifical Inteligent that can prevent typical messenger contact removal from mobile phone. Logon to latest version of PC Microsoft Windows Live. Then click - Tools - Options - Privacy - Block the contact. Select no for any invites that pop up later sent by the bot contact. That is the AI and trick of the bot contact to try to stay in the contact list. Most software/freeware will fail to remove the contact because these invites are invisble in most software other than genuine MS Live Messenger. Spammers or malwares are exploiting the loopholes of those software.Block list is centralized, so, you remove it in MSN Live PC would remove it in mobile devices or other multi-protocol messenger like Miranda/Pidgin later. &lt;br /&gt;&lt;br /&gt;I believe there are more of these kind of exploits going on in the internet/mobile internet to be precise nowadays. Open source software economy has a common weakness which is getting proper support. Proprietary software company on the other hand has the obligation to help to fix and support.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-3087623456474675064?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/3087623456474675064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=3087623456474675064' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/3087623456474675064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/3087623456474675064'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2012/02/spam-messages-and-messenger-software-in.html' title='Spam Messages and Messenger Software in Mobile Devices. And How to Remove the Spammer'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-5257231252636545911</id><published>2011-04-10T08:41:00.000-07:00</published><updated>2011-04-10T09:29:06.070-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Nokia'/><category scheme='http://www.blogger.com/atom/ns#' term='J2ME'/><category scheme='http://www.blogger.com/atom/ns#' term='JAR'/><title type='text'>Disable Nokia On Screen Keypad for the applications by editing JAR (j2ME) manifest file without having to repacking or make use of programming tools</title><content type='html'>I have a phone that runs on Symbian S60v5. The phone is a cool phone as I can use it for GPS navigation, decent camera, ergonomic (no awkward function/design like some other phones i have used before that put me off. Design and function make sense to me, no impractical but just down to earth.), sturdy , stable signal reception and good call quality. &lt;br /&gt;&lt;br /&gt;However, like any phone OSes, there are always bugs in it and Symbian makes no exception. And of all bugs in Symbian S60v5, there is one particular bug in the Symbian that really annoys me. It is this Java Suite Setting that sits inside the Installed App menu (Symbian Application Manager). The Installed Applications  has a memory constraint bug that it cannot load up if there are too many applications/games installed into your phone. Especially if you have upgraded your memory card. &lt;br /&gt;&lt;br /&gt;When the Installed App could not load up. There is no way that you can change the Java Suite Settings of your Java application/game.&lt;br /&gt;What is in the Java Suite Settings? You can turn off the on screen keypad and the default orientation of the application in it.&lt;br /&gt;&lt;br /&gt;And without that, I need to live with games/application with a redundant ugly on screen keypad which I do not need knowing my phone is touch screen and those games/application support touch screen. On screen keypad is only needed if the applications/games required keypad to operate but not in this case.&lt;br /&gt;&lt;br /&gt;I google quite a bit but the working solution that people proposed is to reduce the number of applications/games in your phone. This is not a solution because I need those applications/games.&lt;br /&gt;&lt;br /&gt;So, how do i overcome the problem.&lt;br /&gt;&lt;br /&gt;Edit the J2ME jar file before you install it to your phone. And it is not difficult too. &lt;br /&gt;&lt;br /&gt;1. Download and install WinRAR.&lt;br /&gt;2. Download the Jar file of your application. &lt;br /&gt;3. Open the JAR file using WinRAR&lt;br /&gt;4. Locate the manifest file. Normally in META-INF\MANIFEST.MF&lt;br /&gt;5. Edit the manifest file using Notepad.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Add lines&lt;br /&gt;&lt;br /&gt;Nokia-MIDlet-On-Screen-Keypad: no&lt;br /&gt;Nokia-MIDlet-App-Orientation: portrait      &lt;br /&gt;&lt;br /&gt;or &lt;br /&gt;&lt;br /&gt;Nokia-MIDlet-App-Orientation: landscape&lt;br /&gt;&lt;br /&gt;6. Save and exit the notepad and WinRAR would prompt if you would want to update your archive. Select Yes.&lt;br /&gt;&lt;br /&gt;That's all you need to do. Install the JAR again and you would find that the on screen keypad is gone and orientation default has been changed for your application/game.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-5257231252636545911?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/5257231252636545911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=5257231252636545911' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/5257231252636545911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/5257231252636545911'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2011/04/disable-nokia-on-screen-keypad-for.html' title='Disable Nokia On Screen Keypad for the applications by editing JAR (j2ME) manifest file without having to repacking or make use of programming tools'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-8283523949429972289</id><published>2011-01-21T03:21:00.000-08:00</published><updated>2011-01-21T03:34:27.811-08:00</updated><title type='text'>Dos Prompt - Batch file programming - Preparing executables for deployment(more straightforward way)</title><content type='html'>All I want to do is to get a set of binaries from projects in solution file (.NET win application) in the debug/release folder and put into one target folder so then I can quickly deploy into staging environment for testing.&lt;br /&gt;&lt;br /&gt;I do not want to create the setup packages because I want to retain the pdb files in it (for debug version). I know this can be done using the package setup too and also some well build automation script to include debug database but too much of hassle and I want to do it across many projects. Also, I do not want to purchase another tool for simple stuff like this. All I want is a generic script for all kind of the projects.&lt;br /&gt;&lt;br /&gt;So, here, I come out with a batch file &lt;br /&gt;&lt;br /&gt;There are some approach in batch programming where a batch will read from another text file (the locations of the project).  But i like to put all the location setting to the batch file. Easy to keep track and feel like in control all the time. Too many files to maintain not my preference that all.  &lt;br /&gt;&lt;br /&gt;Here goes the script.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  cls&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        SET SOURCELOCATION=&amp;quot;D:\Solution\&amp;quot;         &lt;br /&gt;&lt;br /&gt;        SSET OUTPUTLOCATION=&amp;quot;D:\Deployment&amp;quot;&lt;br /&gt;&lt;br /&gt;        SET FOLDER1=Project1&lt;br /&gt;&lt;br /&gt;        SET FOLDER2=Project2&lt;br /&gt;        SET FOLDER3=Project3&lt;br /&gt;&lt;br /&gt;        SET FOLDER4=Project4&lt;br /&gt;&lt;br /&gt;        SET FOLDER5=Project5&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        @echo off &amp;amp; setLocal EnableDELAYedeXpansion    &lt;br /&gt;&lt;br /&gt;        pushd %SOURCELOCATION%&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        for /Lfor /L %%i in (1 1 5) do&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        (&lt;br /&gt;&lt;br /&gt;        echo.FOLDER%%i is !FOLDER%%i!&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        pushd !FOLDER%%i! &lt;br /&gt;pushd &amp;quot;bin\Debug&amp;quot;    &lt;br /&gt;&lt;br /&gt;        if not exist *.dll goto ERROR&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        mkdir %OUTPUTLOCATION%\!FOLDER%%i!&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        xcopy xcopy *.* %OUTPUTLOCATION%\!FOLDER%%i!&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        popd&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        popd&lt;br /&gt;&lt;br /&gt;&amp;nbsp;)&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;&amp;nbsp;:QUIT echo Done EXIT /B 1&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        :ERROR echo Error occurredEXIT /B 1&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-8283523949429972289?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/8283523949429972289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=8283523949429972289' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/8283523949429972289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/8283523949429972289'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2011/01/dos-prompt-batch-file-programming.html' title='Dos Prompt - Batch file programming - Preparing executables for deployment(more straightforward way)'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-1978322321404316040</id><published>2011-01-16T18:49:00.000-08:00</published><updated>2011-01-29T09:44:38.416-08:00</updated><title type='text'>Microsoft XPS Viewer would not print in Windows 7</title><content type='html'>I need to delay the print job as there is no printer available for me to print. Therefore, I decided to save it as XPS for the print job and print it later when I am hook up to a printer in the network.&lt;br /&gt;&lt;br /&gt;XPS is the format supported in Win 7. It is part of the windows installation.&lt;br /&gt;So, i suppose, no issue would follow even though this would be my first time using the XPS.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Next day, I open the file using the Ms XPS viewer. Yes, it does the job nicely, i can see the print out clearly and it looks exactly like the actual print out. (what am i talking, it "is" the print out.)&lt;br /&gt;Then, ok, it is time to print since i am hooked up to printer.&lt;br /&gt;&lt;br /&gt;Click print, says successful. Then, go to the printer, nothing comes out. Try few more times, same thing.&lt;br /&gt;&lt;br /&gt;I thought something is wrong with my printer. Try to print other thing. No issue. Only XPS viewer can't print. So, I figured out that it is XPS viewer printing issue.&lt;br /&gt;I then, try to convert to other format like PDF using Paperport or paginated version using Fineprint. Nothing works.&lt;br /&gt;Google it, the only working solution is &lt;br /&gt;http://www.timbarcz.com/blog/HowToPrintXPSDocumentsEasyAs11a1aI233a45.aspx&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This guy do not have XPS in Vista or XP where he needs to install the XPS software bottom up. Along the way, he has identify the bug in Ms XPS Viewer. My case is even Ms did install the XPS for me which should have learn from other people comment. Yet, the XPS viewer shipped in Win 7 is still buggy!!! How come no one ever complaint about this loudly? Unless... no one uses this XPS thingy. &lt;br /&gt;I can confirm is XPS viewer bug because the when i print in Paperport or Fineprint. &lt;br /&gt;Those programs would report error or something. &lt;br /&gt;The solution I found based on the blog and some trial and error is &lt;br /&gt;To install PrimoPdf - http://www.primopdf.com/index.aspx. And then print the XPS to the PrimoPdf. The reason why it works is that PrimoPdf is more lax and has additional error correction to the print out that gets send to it. Like this case, XPS viewer send buggy print script to the printer (in our case, the PrimoPdf). PrimoPdf corrects it and make the printing possible. &lt;br /&gt;&lt;br /&gt;Good work PrimoPdf, you save the day for a bunch of Ms XPS users.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-1978322321404316040?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/1978322321404316040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=1978322321404316040' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/1978322321404316040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/1978322321404316040'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2011/01/ms-xps-viewer-would-not-print-in.html' title='Microsoft XPS Viewer would not print in Windows 7'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-4140497721149274730</id><published>2010-12-08T01:09:00.000-08:00</published><updated>2011-11-19T04:40:14.223-08:00</updated><title type='text'>Resolving SSRS 2008 Deployment and Access Issues</title><content type='html'>If you are coming from SSRS 2005 background. You would be accustomed to the fact that SSRS is part of SQL server and at the same time, it is a web application in IIS. &lt;br /&gt;So, when you want to configure the report server, you would tinker the  IIS and SQL server management studio. &lt;br /&gt;&lt;br /&gt;However, once you have upgraded the SSRS to be 2008. You would feel lost at first that all these familiar ways of doing things have changed. So, now, it is no longer depending on IIS seems. It has it's own http.sys.&lt;br /&gt;&lt;br /&gt;These are all good as in term of technology improvement and progress but at developer end, it is nothing pleasant but confusion and frustration when trying to troubleshoot the problem developers encounter, especially for experienced SSRS developers. They suddenly have turned into rookies. Ok, to help those experienced developers out there. This is my take to experienced guys as this is what i have been through too. &lt;br /&gt;First thing first, you have to accept the fact that technology advance quicker than you thought, don't obsess to the old way of doing things. (This is a digression, just for laugh, don't take it seriously...:)).&lt;br /&gt;&lt;br /&gt;Ok, the real deal is there are few new places that you need to check on. So quit those old habits and check items below. &lt;br /&gt;&lt;br /&gt;1. Reporting Services Configuration Manager. &lt;br /&gt;2. The familiar http://(YourServer)/Reports (report manager)&lt;br /&gt;3. SQL Server Management Studio&lt;br /&gt;4. C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config&lt;br /&gt;5. Checking status of URL for http.sys &lt;br /&gt;6. Folder permission for virtual directory.&lt;br /&gt;7. Visual Studio Project Setting. &lt;br /&gt;8. The Run As Administrator permission when running the Internet Explorer.&lt;br /&gt;&lt;br /&gt;Reporting Services Configuration Manager&lt;br /&gt;----------------------------------------&lt;br /&gt;Reporting Services Configuration Manager is a new dedicated configuration program to configure everything that you used to do in IIS in the past. &lt;br /&gt;&lt;br /&gt;The common problem that you would face if you are using it in your own testing machine is that you can't connect to ReportManager URL using your browser. No matter what you do, you tweak your permission and etc. Out of many solutions that i have tried. (If i am positively sure i install everything correctly). The commonest problem would be the SSRS is trying to use SSL  as the main connection to the report manager. May be someone would be needing that in the production server but not for developer. So, first thing, remove the Multiple SSL identities for Report Manager. iPV4 or iPV6. It should solve the report manager not being able to connect problem.&lt;br /&gt;&lt;br /&gt;http://(YourServer)/Reports (report manager)&lt;br /&gt;--------------------------------------------&lt;br /&gt;This is the same old report manager but now, it has more in it. You have to assign windows login / domain user the permission to each of the folder . Especially the root. You need it for deploying using your IDE or report builder. You need to ensure roles below get assign to the Windows Login you use in your IDE/report builder. &lt;br /&gt;- Browser&lt;br /&gt;- Content Manager&lt;br /&gt;- My Reports&lt;br /&gt;- Publisher&lt;br /&gt;- Report Builder.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL Server Management Studio&lt;br /&gt;-----------------------------&lt;br /&gt;&lt;br /&gt;This is the same as before, but one thing most commonly neglect in here is the user permission to the database schema. Report server still uses database and it has it own database schema. Make sure the ReportServer database has your user login configured in it. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config&lt;br /&gt;--------------------------------------------&lt;br /&gt;This is the most obscure setting among all. It got me stuck for hours. Basically, the commonest issue is that the SSRS installer is being thoughtful to help to harden the security of the connection which most developers do not need. &lt;br /&gt;&lt;br /&gt;Look for &lt;br /&gt;&amp;lt;Add Key="SecureConnectionLevel" Value="2"/&amp;gt;&lt;br /&gt;Change the value to be 0.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Status of URL for http.sys &lt;br /&gt;-------------------------&lt;br /&gt;If you are not using the default URL/virtual directory. You need to check this&lt;br /&gt;Run&lt;br /&gt;netsh http show urlacl&lt;br /&gt;&lt;br /&gt;and compare it to C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config&lt;br /&gt;&lt;br /&gt;if the setting matches the one running in http.sys&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Delete the unwanted URL reservations:&lt;br /&gt;netsh http delete urlacl [INSERT RESERVED URL HERE]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Permission for virtual folder &lt;br /&gt;--------------------------&lt;br /&gt;I don't recall i have seen the virtual folder for the report server. IN fact, there is no virtual folder etc anymore, everything is stored in database now. So, don't bother to crack your head to look for it and suspect it is folder permission problem. &lt;br /&gt;&lt;br /&gt;However, there aresome places that you need to set the permission. &lt;br /&gt;&lt;br /&gt;http://(yourmachine)/Reports or http://(yourmachine)/ReportServer (which ever work)&lt;br /&gt;&lt;br /&gt;Run your IE with admin rights and then in site settings click security and in the setting, set it to admin for the user login. &lt;br /&gt;&lt;br /&gt;After this, set this to folder as well . Click Home and then properties of each and set the credential you need. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Visual Studio Project Setting&lt;br /&gt;-------------------------&lt;br /&gt;Ensure the targetURL is "http://ServerName/ReportServer" and NOT http://ServerName/Reports".&lt;br /&gt;&lt;br /&gt;I think that is all required for seasoned SSRS 2005 developer should they get stuck with SSRS 2008. Other problems beside above would stuff like firewall, incomplete installation, sharepoint (if it is to be used with sharepoint) and internet browser security setting which is not covered here.&lt;br /&gt;&lt;br /&gt;The Run As Administrator permission when running the Internet Explorer&lt;br /&gt;------------------&lt;br /&gt;One of the security improvement in Windows (so called improvement) is that whenever you want to perform any system related action in your application, you need to run the application as Administrator. Especially if you have Vista or Windows 7, menial stuff also you would need to ensure you run it as System Administrator eventhough your login to windows is already an Administrator. A few layers of confirmation check by Microsoft. (Kinda like, are you sure? are you really really sure?) This itself would affect the SSRS 2008 when you want to run the report manager. Find it hard to believe but if you do not run your Internet Explorer as Administrator, you get permission denied prompt. Many people would not expect this and I always forget about this. Must run as Administrator.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-4140497721149274730?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/4140497721149274730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=4140497721149274730' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/4140497721149274730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/4140497721149274730'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2010/12/resolving-ssrs-2008-deployment-and.html' title='Resolving SSRS 2008 Deployment and Access Issues'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-3373409291111484690</id><published>2010-07-26T00:02:00.000-07:00</published><updated>2010-10-25T23:59:30.417-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 3.5'/><title type='text'>Roadblocks utilizing ASP.NET 3.5 and ASP.NET AJAX - part 2</title><content type='html'>This is a continuation of the previous post. (http://anthony-yio.blogspot.com/2010/03/roadblocks-utilizing-aspnet-35-and.html)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ASP.NET Dropdownlist with tooltip&lt;br /&gt;&lt;br /&gt;Problem: Although it might occur to everyone that dropdownlist when the text in it is too lengthy, there should have some tooltip to show the text in the dropdownlist like "any" combobox in Windows. But to your surprise, this feature does not come for free on ASP.NET 1.1, 2.0, 3.0, 3.5 or may be even 4.0. &lt;br /&gt;&lt;br /&gt;Resolution: &lt;br /&gt;&lt;br /&gt;(quote from - http://forums.asp.net/p/903935/994720.aspx)&lt;br /&gt;&lt;br /&gt;I have search many solutions, some used JQuery, some use CSS and etc. But i do not like to mess around too much with the CSS and Javascript/JQuery for this sort of thing since i am doing MVP+Controller model. A little or non scripting is preferred. &lt;br /&gt;Therefore, it is to add the title attribute to the item&lt;br /&gt;&lt;br /&gt;Add  a ondatabound="ApplyOptionTitles" event to your DropDownList control.&lt;br /&gt;&lt;br /&gt;Then implement in code-behind (C#) as follows: &lt;br /&gt;&lt;br /&gt;protected void ApplyOptionTitles(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;   DropDownList ddl = sender as DropDownList;&lt;br /&gt;   if (ddl != null)&lt;br /&gt;   {&lt;br /&gt;        foreach (ListItem item in ddl.Items)&lt;br /&gt;        {&lt;br /&gt;           item.Attributes["title"] = item.Text;&lt;br /&gt;         }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Data bound controls&lt;br /&gt;&lt;br /&gt;Problem: There is no dedicated function to refresh the content of the AJAX controls that bound to data source suppose if you have updated the records in the database. The only way is to reload the page which defeat the purpose of having AJAX. &lt;br /&gt;&lt;br /&gt;Resolution: The original thought is to call databind or rebind function but it does not work. (Wonder what the use of having those functions then? Basically, it would check if there is any changes to data source "name", or else calling those functions do nothing.. duh...)&lt;br /&gt;&lt;br /&gt;So, the workaround are below&lt;br /&gt;1. Datasource set to null programmically and then call databind() and then set the datasource back to the original one and call databind() - Which look like a mess.&lt;br /&gt;&lt;br /&gt;2. If you have control parameters or session parameters. Just reset those value like set to null and back to original value. This would work even on AJAX. - The slightly better way...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-3373409291111484690?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/3373409291111484690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=3373409291111484690' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/3373409291111484690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/3373409291111484690'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2010/07/roadblocks-utilizing-aspnet-35-and.html' title='Roadblocks utilizing ASP.NET 3.5 and ASP.NET AJAX - part 2'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-8689575182547085944</id><published>2010-05-29T02:47:00.000-07:00</published><updated>2010-08-29T19:21:40.236-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web application'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='IE'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>Web Application Development - Browser Issues</title><content type='html'>I am sure anyone who have developed/run web application project before know how crucial the application compatible with the mainstream browser in the market. If you search in the google and look for the most rant about browser. It would be no surprise that IE is on top of the list. Ok. this is not a IE bash thread and never intended to be.&lt;br /&gt;Because the relation of IE to the development team or business is actually a love and hate sentiment. Why?&lt;br /&gt;thanks to IE, development team can focus only compatibility test on IE and ensure if it works there. The rest (not mainstream browser) on the other hand can be ignored (unfortunately, that would mean sayonara to my favorite Mozilla Firefox).&lt;br /&gt;&lt;br /&gt;To cut the story short, let just explain based on my experience (it could vary on your experience, just my exposure) why people would rant about IE. They said, it is bad, but how bad is bad?&lt;br /&gt;&lt;br /&gt;Most people would start off "trying" to make the application at least compatible with IE6. Because the older version of windows are bundled with it by default.&lt;br /&gt;&lt;br /&gt;Lets put aside the javascripts/ other scripting goodies , security that IE6 would have problems with. Just focus on usability.&lt;br /&gt;&lt;br /&gt;If you have tested the IE6. The IE6 is actually working "very" badly on CSS , DIV and UL tag (bulleted list). How badly is that?&lt;br /&gt;You would end up not able to see a big chunk of pages and even able to click on those buttons. That bad, not usable at all. (All good web sites have CSS nowadays. only lame ones don't use it)&lt;br /&gt;&lt;br /&gt;So, if you are a designer or UI perfectionist. Never ever consider supporting IE6. Fight to the death to ask client to upgrade to higher version of IE.&lt;br /&gt;&lt;br /&gt;Ok, then, naturally you would think IE 7 is the better choice. 6 to 7 is a big leap right? After much hard convincing your client to upgrade to IE 7. You would think now, ok, i am a lot better off. After much testing, holy shit, another slew of problems follow. So, what now?&lt;br /&gt;IE 7 has this z-index problem, what is z-index problem ?&lt;br /&gt;Meaning if you have layers of screen overlapping each other or stacking. It would be a total hay wired in the order. But hey, you would think, who need a layers screen anyway? Ok, layered screens are everywhere and pervasive in modern web application. Such as your drop down menu, modal popup, funky web layers and etc. Unless you would like to have only the static old timer HTML without AJAX support. Then, you need not worry. Or else, this is a big headache.&lt;br /&gt;&lt;br /&gt;So, what is the resolution to this IE7? One would say JQuery, workaround on CSS and etc. Just google and you will find tons of answers. But after going through all this hassle, sometimes the workaround might not even work correctly or expected. Or worst, other side effects would follow. Like in my case, the drop down menu overlap the modal popup. So, once you hover through the menu in the modal popup, the menu in background would popup for some stupid reasons.  &lt;br /&gt;So, that does make you really want to spike the programmers in MS. &lt;br /&gt;Ok, so, the only real solution and guarantee to work fine and little sweats and tears  are&lt;br /&gt;1. Upgrade to IE 8 at least&lt;br /&gt;2. Use Firefox.&lt;br /&gt;&lt;br /&gt;The rest, don't bother. Don't waste your life working on workaround&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-8689575182547085944?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/8689575182547085944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=8689575182547085944' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/8689575182547085944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/8689575182547085944'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2010/05/web-application-development-browser.html' title='Web Application Development - Browser Issues'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-4626556530485677488</id><published>2010-05-18T02:59:00.000-07:00</published><updated>2010-05-18T03:14:20.650-07:00</updated><title type='text'>Continuous Integration Environment : Parser Error Message: The file XXX does not exist</title><content type='html'>This is something that definitely continuous integration able to identify.&lt;br /&gt;&lt;br /&gt;Something to do with ASP.NET web page running well in development but not in the live environment or pre-screen - continuous integration environment.&lt;br /&gt;&lt;br /&gt; &lt;blockquote&gt;&lt;br /&gt;Server Error in '/' Application.&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Parser Error &lt;br /&gt;Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. &lt;br /&gt;&lt;br /&gt;Parser Error Message: The file '/XXX/XXXX.aspx.cs' does not exist.&lt;br /&gt;&lt;br /&gt;Source Error: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Line 1:  &lt;br /&gt;Line 2:  &lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;For seasoned developers, if they have started development since .NET 1.1. This is something definitely they familiar with. Because, in the past, all this are not so automated in older version of Visual Studio.NET.So, in this case, it is the CodeFile directive that asking compiler to look for csharp code specify in the aspx file. This would in turn force the IIS server compile the aspx file with the *.cs file dynamically.&lt;br /&gt;However, if you are deploying this to live environment, you would definitely end up puzzling how come it is not working now with the assemblies since you would not ship with source code.&lt;br /&gt;&lt;br /&gt;So, the resolution would be to change it to &lt;br /&gt;&lt;br /&gt;Codebehind="XXX.aspx.cs" instead. And once you publish the web site for deployment, it would still work and look for the respective DLL in bin folder.&lt;br /&gt;&lt;br /&gt;You can also use "assembly= " directive if you want to handcraft the location of DLL.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-4626556530485677488?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/4626556530485677488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=4626556530485677488' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/4626556530485677488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/4626556530485677488'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2010/05/continuous-integration-environment.html' title='Continuous Integration Environment : Parser Error Message: The file XXX does not exist'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-7100608688410969999</id><published>2010-04-20T19:45:00.000-07:00</published><updated>2010-04-20T20:00:57.550-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Excel Printing'/><title type='text'>Excel 2007 - Printing of excel sheet to fit to page size</title><content type='html'>The Ms Excel is a different animal when it comes to printing. &lt;br /&gt;Because of the nature of the format, you could be selecting only a fraction of page/sheet or workbook to print.&lt;br /&gt;&lt;br /&gt;For a casual excel user like me, this give inconvenient when all i care is to be able to print what i see on that particular page (or call sheet in excel).&lt;br /&gt;&lt;br /&gt;Often time, you would see some fraction of the content is being crop out in the print out. Because of exceeded range,  you need to resize the columns one by one so then to be able to see the print out in one page.  This is time consuming and frustrating. &lt;br /&gt;&lt;br /&gt;So, after some digging, I found my all time favorite Fit to Page printing function.&lt;br /&gt;&lt;br /&gt;It is located in "Page Layout" segment.And then, there is a "Scale to Fit" band next to page setup band. (that is another frustration of using newer version of office , all the menu items have been revamped, need time to search for what you want like in the past version). However, this would not work magically. You need to be accustomed with some of the Excel specific printing function. &lt;br /&gt;The 3 steps below.&lt;br /&gt;&lt;br /&gt;The first thing you need to do is to set "Print Area" in the Page Setup band.&lt;br /&gt;Then, in the Scale to Fit band, you need to set the Width and Height. You have to roughly estimate how much pages you need for your print out. For instance, 2 pages in Heights if you need print out in two pages. Also, in the scale to fit, you need to set the orientation right.(portrait or landscape). &lt;br /&gt; &lt;br /&gt;You can of course by pass these 3 steps but you would probably get a miniature print out with improper zoom out and wasting a lot of space with blanks. &lt;br /&gt;&lt;br /&gt;So, this is the summary of the steps,&lt;br /&gt;1. Select Scale to Fit, choose orientation &lt;br /&gt;2. In Scale to Fit, number of pages in heights. &lt;br /&gt;2. Set Print Area. Include only cells with data.&lt;br /&gt;&lt;br /&gt;That is all. have fun with printing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-7100608688410969999?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/7100608688410969999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=7100608688410969999' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/7100608688410969999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/7100608688410969999'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2010/04/excel-2007-printing-of-excel-sheet-to.html' title='Excel 2007 - Printing of excel sheet to fit to page size'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-850987464249858845</id><published>2010-04-02T09:40:00.000-07:00</published><updated>2010-04-03T09:02:54.406-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='U-Mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='Digi Internet'/><category scheme='http://www.blogger.com/atom/ns#' term='Celcom'/><category scheme='http://www.blogger.com/atom/ns#' term='Prepaid'/><category scheme='http://www.blogger.com/atom/ns#' term='P1'/><category scheme='http://www.blogger.com/atom/ns#' term='Malaysia Wireless Broadband'/><title type='text'>My Experience of Prepaid Wireless Broadband</title><content type='html'>I do not hook up to internet that often after office hours, only once in a blue moon for research purposes. (after all, i get to connect to internet all day long in the office.)&lt;br /&gt;It makes no sense for me to commit to the monthly flat rate plan , and thus I choose prepaid broadband for my non-office hours internet surfing. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok, I have done quite a bit of survey (that is just me, surveying even on these kind of menial stuff) - (comparison of packages as of today - 3 April 2010)&lt;br /&gt;&lt;br /&gt;Oh, by the way, I have bought a D-Link WCDMA/HSDPA USB modem to test most of these packages. (No need to lock in to any packages just to get the bundled modem by any operator, it is the same standard HSDPA modem. It would work the same way. In fact, my D-Link modem has additional MicroSD card slot (for storage) and I can use the bundled software to send SMS. So, no need to top-up using my handphone, just the modem will do. )&lt;br /&gt;&lt;br /&gt;Digi Limited Edition Prepaid Internet &lt;br /&gt;-------------------------------------&lt;br /&gt;RM10 5 days unlimited data access (384kbps)&lt;br /&gt;RM30 15 days unlimited data access (384kbps)&lt;br /&gt;RM50 25 days unlimited data access  (384kbps)&lt;br /&gt;RM100 50  days unlimited data access (384kbps)&lt;br /&gt;(with throttle of speed when reach a certain limit but still usable)&lt;br /&gt;&lt;br /&gt;U-Mobile Prepaid Broadband&lt;br /&gt;---------------------------&lt;br /&gt;UB6 1 day RM6 500MB data quota (384 kbps )&lt;br /&gt;UB1O 30 days RM1O 100MB data quota (384 kbps )&lt;br /&gt;UB2O 30 days RM 20 300 MB data quota (1.0 mbps )&lt;br /&gt;UB4O 30 days RM 40 2GB data quota (1.0 mbps )&lt;br /&gt;UB68 30 days RM 68 Unlimited (with throttle at 5Gb) (3.6 mbps )&lt;br /&gt;(data quota means you would get disconnected once you reach the quota. No more internet. Ouch!!)&lt;br /&gt;&lt;br /&gt;Celcom Prepaid Broadband&lt;br /&gt;-------------------------&lt;br /&gt;RM6 Daily Unlimited (384 kbps )&lt;br /&gt;RM20 Weekly Unlimited (384 kbps )&lt;br /&gt;(no throttle on speed)&lt;br /&gt;&lt;br /&gt;Maxis Prepaid Broadband&lt;br /&gt;------------------------&lt;br /&gt;RM8 Daily 500MB Data Quota (7.2 Mbps*)&lt;br /&gt;RM25 Weekly 2.5Gb Data Quota (7.2 Mbps*)&lt;br /&gt;(data quota means you would get disconnected once you reach the quota. No more internet. Ouch!!)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;P1 W1GGY Prepaid Broadband&lt;br /&gt;-------------------------&lt;br /&gt;RM20 15 days 500MB Data Quota (800 Kbps)&lt;br /&gt;RM50 30 days 2.5GB Data Quota (800 Kbps)&lt;br /&gt;(data quota means you would get disconnected once you reach the quota. No more internet. Ouch!!)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok, let start with Digi plan. &lt;br /&gt;Digi Plan&lt;br /&gt;---------&lt;br /&gt;After much comparing all the packages available, it is clear in my opinion that Digi broadband is the most worthwhile package consider that it is unlimited in data download and cheapest in price. (RM10 for 5 days). You would ask, isn't that U-Mobile RM10 for 30 days more worthwhile? Wait a second, there is a 100MB data quota. Unless you are going to just check your mail and chatting(without smiley or images,  and just pure text), 100MB is ridiculously little for you to consume. (Also, any of your application auto update, windows update, anti-virus update  has to be configured not to download itself because any one of those updates easily take up more than 50Mb of download. Then you wonder where the download has went to). &lt;br /&gt;&lt;br /&gt;However, when I actually tested with my 3.5G USB modem. To my disappointment, I can't connect to internet properly. It only has EDGE coverage and it is not usable at all. Constantly get disconnected and very very slow. I have even tested in other states and what I discover is , Sigh ~~~~&lt;br /&gt;So, Digi no go for me. It is worthwhile only if your area has HSPDA coverage, or else, don't bother to try. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;U-Mobile&lt;br /&gt;-------&lt;br /&gt;In term of price and number of packages you can pick on, it is the most flexible one among all. In fact, i am using it for very light surfing, like only checking mail, write blog or twitting.  However, if I want to surf heavily for short term, there is no package available (RM68 only has unlimited, the rest has data quota). &lt;br /&gt;&lt;br /&gt;Celcom&lt;br /&gt;------&lt;br /&gt;Ok, in term of price, at first, it does not look attractive. But when you are really serious into using it for surfing or so for your internet related activities. You would realize that unlimited data is very important because, data download is not something you can control easily, many background processes, many background downloads, movies, software download, surfing, etc nowadays require high "bandwidth" and the reason of having broadband is to be able to surf freely with high bandwidth with many downloads. Data quota in my opinion is causing a broadband to be useless. Imagine that if you have 7.2 Mbps with 1 month stretch connection but what use can it be if you can only use it for lesser than a day. (suppose, you are hardcore broadband user). That is why unlimited is important.  &lt;br /&gt;&lt;br /&gt;Maxis&lt;br /&gt;------&lt;br /&gt;7.2Mbps. Can they deliver it, I have not tested it, therefore, I not dare to deny anything. May be can, may be not. &lt;br /&gt;However, if and only if they can deliver 7.2 Mbps. Then, probably this is the best package  for one off download , may be in the range of 500MB and you need to download it fast. RM8 to download a 500MB of file with 7.2 Mbps connection would only take about 555.555 seconds (roughly 9 minutes ) in calculation. &lt;br /&gt;&lt;br /&gt;By the way, I read that Maxis is the early adopter HSPA+ . Read - http://www.maxis.com.my/mmc/index.asp?fuseaction=press.view&amp;recID=420&lt;br /&gt;&lt;br /&gt;P1 W1ggy&lt;br /&gt;---------&lt;br /&gt;I think need not to mentioned anymore that data quota is bad idea. But if and only if you think you can control your download. Then, I think this would be an ideal package to invest on for user who want to use next generation of mobile network internet access with a decent price. It has much room to improve on since it is 4G (please note there is a launching of HSPA+ for 3G which could be parallel to 4G - Read more about 4G(Wimax) vs 3G(HSDPA/HSPA+) - http://www.pcmag.com/article2/0,2817,2359139,00.asp). However, the downside of this is P1 is creating their new network in this region. So, you won't be able to see good coverage in rural areas or some areas. Unlike existing 3G or 3.5G operators, they can just utilize existing mobile network. So, this is not an ideal package for people on the go. However, because also it is a new network and only for data purpose, the bandwidth is not extensively shared by mobile phone users which could be good. &lt;br /&gt;Anything else need to mention here is that since it is Wimax, you can't use 3.5G or HSDPA/HSPA+ modem that you buy in the market. So, you are pretty much lock in to this operator if you are using Wimax modem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-850987464249858845?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/850987464249858845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=850987464249858845' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/850987464249858845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/850987464249858845'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2010/04/my-experience-of-prepaid-wireless.html' title='My Experience of Prepaid Wireless Broadband'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-4973397505864106973</id><published>2010-03-01T00:40:00.000-08:00</published><updated>2010-05-29T03:36:43.077-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 3.5'/><title type='text'>Roadblocks utilizing ASP.NET 3.5 and ASP.NET AJAX</title><content type='html'>Below is a listing of known bugs of the ASP.NET 3.5 and ASP.NET AJAX and the resolution.&lt;br /&gt;&lt;br /&gt;Calendar control extender&lt;br /&gt;&lt;br /&gt;http://forums.asp.net/p/1110311/2780472.aspx#2780472&lt;br /&gt;&lt;br /&gt;Problem: Calendar extender would show random transparent weird popup upon clicking. (unbelievable that this can pass QA in the first place)&lt;br /&gt;Resolution: Add a dummy CalendarExtender outside of updatepanel. The calendarextender might need to associate with a dummy invisible textbox and invisble image button too.&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;&lt;br /&gt;ASP.NET AJAX CalenderExtender again, this time on the days cells being blocked.&lt;br /&gt;&lt;br /&gt;Problem: If you have a couple of CalenderExtender in your page and asking UI designer to design the CSS separately. You would be very likely getting this. The problem is the td, tr and div tag being overridden by the CSS .&lt;br /&gt;&lt;br /&gt;Resolution: Have a more specific CSS for your calendarextender. The rule of CSS is the most specific one prevail.Use this (MyCalendar) in the CssClass attribute of the calenderextender.Adjust the width and height to suit. However, there is another problem follows using this method. When you select month, you would see some misalignment, same goes to years.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;/*fixed ajax calendar issue*/&lt;br /&gt;/*Calendar*/&lt;br /&gt;.MyCalendar .ajax__calendar_container {&lt;br /&gt;&lt;br /&gt;border:1px solid #646464;&lt;br /&gt;background-color: white;&lt;br /&gt;&lt;br /&gt;color: black;&lt;br /&gt;width:230px;&lt;br /&gt;height:200px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.MyCalendar .ajax__calendar_body{width:100%;height:200px;&lt;br /&gt;                                 }&lt;br /&gt;&lt;br /&gt;.MyCalendar .ajax__calendar_other .ajax__calendar_day,&lt;br /&gt;.MyCalendar .ajax__calendar_other .ajax__calendar_year {&lt;br /&gt;&lt;br /&gt;color: black;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.MyCalendar .ajax__calendar_hover .ajax__calendar_day,&lt;br /&gt;&lt;br /&gt;.MyCalendar .ajax__calendar_hover .ajax__calendar_month,&lt;br /&gt;.MyCalendar .ajax__calendar_hover .ajax__calendar_year {&lt;br /&gt;&lt;br /&gt;color: black;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.MyCalendar .ajax__calendar_active .ajax__calendar_day,&lt;br /&gt;&lt;br /&gt;.MyCalendar .ajax__calendar_active .ajax__calendar_month,&lt;br /&gt;.MyCalendar .ajax__calendar_active .ajax__calendar_year {&lt;br /&gt;&lt;br /&gt;color: black;&lt;br /&gt;&lt;br /&gt;font-weight:bold;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;-------------------------------------------------&lt;br /&gt;&lt;br /&gt;ASP.NET 3.5 ListView with DropDownList in InsertItemTemplate&lt;br /&gt;&lt;br /&gt;http://forums.asp.net/t/1187425.aspx&lt;br /&gt;Problem: When you try to bind a dropdownlist in the listivew. You get&lt;br /&gt;Error "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control".&lt;br /&gt;Resolution: Handle OnItemInserting of the ASP.NET 3.5 ListView. To contruct object to be inserted manually.&lt;br /&gt;&lt;br /&gt;----------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SSRS ReportViewer in ASP.NET AJAX UpdatePanel&lt;br /&gt;&lt;br /&gt;Problem: So, you want to have those fancy AJAX updatepanel behavior on the dropdownlist to choose your report in reportviewer. You diligently code the way up your controls so then it is ready to load the report. However, when you about to roll in the report. Strange things happen. It is not working all and the browser throwing all sort of javascript that you have no idea what it is about. You must be wonder could be browser compatibility issue but the more browser you more, the different errors you get.&lt;br /&gt;&lt;br /&gt;Resolution (so-called):&lt;br /&gt;&lt;br /&gt;From - http://forums.asp.net/p/1044194/1460759.aspx&lt;br /&gt;&lt;blockquote&gt;ReportViewer.AsyncRendering="false", can anyone help me solve script error? This is my current code base on Yarick's:&lt;br /&gt;&lt;br /&gt;  protected void Page_PreRenderComplete(object sender, EventArgs e)&lt;br /&gt;  {&lt;br /&gt;      ListDictionary scripts = ClientScript.GetType().GetField("_registeredClientScriptBlocks", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ClientScript) as ListDictionary;&lt;br /&gt;&lt;br /&gt;      foreach (object key in scripts.Keys)&lt;br /&gt;      {&lt;br /&gt;          Type type = key.GetType().GetField("_type", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(key) as Type;&lt;br /&gt;          if (type.Namespace.StartsWith("Microsoft.Reporting.WebForms"))&lt;br /&gt;          {&lt;br /&gt;              string registeredKey = key.GetType().GetField("_key", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(key) as string;&lt;br /&gt;              ToolkitScriptManager.RegisterClientScriptBlock(Page, type, registeredKey, scripts[key] as string, true);&lt;br /&gt;          }&lt;br /&gt;      }&lt;/blockquote&gt;&lt;br /&gt;However, this is not working. Only working if your report view does not need to scroll. What kind of page does not need to scroll. Absurd.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;However, found someone posting in stackoverflow that new version of library would solve it. Just give it a shot if you are desperate for solution. For me, i would prefer stay safe by not using any updatepanel at all if i have reportviewer in the page. Your reportviewer would not work even it is outside of updatepanel.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Microsoft Report Viewer 2010 Redistributable Package from :&lt;br /&gt;&lt;br /&gt;http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=a941c6b2-64dd-4d03-9ca7-4017a0d164fd&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;----------------------------------------&lt;br /&gt;&lt;br /&gt;ASP.NET listview - record running number&lt;br /&gt;&lt;br /&gt;Problem: Would like to have the asp.net ListView to have a automatic running number of the records. Thinking just a few simple settings and thats it. However, no luck.&lt;br /&gt;&lt;br /&gt;Resolution: Handle ListView ItemDataBound event&lt;br /&gt;&lt;br /&gt;To have codes like this in the handler where LblNo is your control name in the column of the  listview&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Label LblNumber = e.Item.FindControl("LblNo") as Label;&lt;br /&gt;          ListViewDataItem dataItem = (ListViewDataItem)e.Item;&lt;br /&gt;          if (LblNumber != null)&lt;br /&gt;          {&lt;br /&gt;              LblNumber.Text = (dataItem.DataItemIndex + 1).ToString();&lt;br /&gt;          }  &lt;/blockquote&gt;&lt;br /&gt;-------------------------------------------&lt;br /&gt;&lt;br /&gt;ASP.NET Menu incompatibility in IE7 and IE8.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Problem: In IE 7, the asp.net menu looks fine, however when you open it in IE8. Disaster. Menu item turn into blank white spaces. &lt;br /&gt;&lt;br /&gt;Resolution:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/giorgio/archive/2009/02/01/asp-net-menu-and-ie8-rendering-white-issue.aspx"&gt;http://blogs.msdn.com/giorgio/archive/2009/02/01/asp-net-menu-and-ie8-rendering-white-issue.aspx&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Just overwrite the z-index&lt;br /&gt;&lt;br /&gt;.IE8Fix&lt;br /&gt;{&lt;br /&gt;      z-index: 100;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(however, i notice there is a side effect doing this. It would interfere the ASP.NET AJAX modalpopup where the z-index overlap the modalpopup. ) Probably can try other methods pointed in the website. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-----------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Believe me, some of these bugs/inconveniences have wasted few hours of mine trying to figure what was wrong.&lt;br /&gt;(this list would grow from time to time)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-4973397505864106973?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/4973397505864106973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=4973397505864106973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/4973397505864106973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/4973397505864106973'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2010/03/roadblocks-utilizing-aspnet-35-and.html' title='Roadblocks utilizing ASP.NET 3.5 and ASP.NET AJAX'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-9031220106639609018</id><published>2009-11-30T01:10:00.000-08:00</published><updated>2009-11-30T01:21:22.909-08:00</updated><title type='text'>WCF - Reading from Application Configuration File  - config section -  system.serviceModel</title><content type='html'>I can't find any example on the web for this, so i guess it could be helpful.&lt;br /&gt;This is a simple example to show a way to read the system.serviceModel configuration section in application/web configuration file. &lt;br /&gt;&lt;br /&gt;Something like for &lt;br /&gt;ConnectionString, there is a straightforward class for that, &lt;br /&gt;ConfigurationManager.ConnectionStrings["keyname"].ConnectionString&lt;br /&gt;&lt;br /&gt;Codes snippet below&lt;br /&gt;&lt;br /&gt;ServiceModelSectionGroup group = ServiceModelSectionGroup.GetSectionGroup(ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None));&lt;br /&gt;&lt;br /&gt;//suppose if there is only one endpoint&lt;br /&gt;            if(group.Client.Endpoints.Count &amp;lt;  0)&lt;br /&gt;            {&lt;br /&gt;                uri = group.Client.Endpoints[0].Address.AbsoluteUri;&lt;br /&gt;            }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-9031220106639609018?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/9031220106639609018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=9031220106639609018' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/9031220106639609018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/9031220106639609018'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2009/11/wcf-reading-from-application.html' title='WCF - Reading from Application Configuration File  - config section -  system.serviceModel'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-806266309436963170</id><published>2009-11-23T17:18:00.000-08:00</published><updated>2009-11-23T17:28:03.825-08:00</updated><title type='text'>Stop Symantec Endpoint Protection Weekly Scheduled Scan Momentary</title><content type='html'>The intention of weekly scheduled scan is good, it helps to safeguard and diagnose your computer from malware. It is a setting set by the most system administrator that any computer with endpoint protection installed would need to oblige this and have it scan every week. It is a centralized setting where users can't change it at the user end. &lt;br /&gt;&lt;br /&gt;However, for an advanced user like myself who know how to take care of my computer, running a PC scanning even on my peak hours are really intrusive. Therefore, after some trial and error, i notice if I use process explorer to kill the rtvscan.exe while it is running, it would force the scanning to terminate itself. And the best thing is antivirus would still be up and running and no restart required. Probably you would need to enable back the protection at the setting where it would prompt you too. That is all you need to do. &lt;br /&gt;&lt;br /&gt;(this is my backdoor trick, use it at your own risk.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-806266309436963170?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/806266309436963170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=806266309436963170' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/806266309436963170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/806266309436963170'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2009/11/stop-symantec-endpoint-protection.html' title='Stop Symantec Endpoint Protection Weekly Scheduled Scan Momentary'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-3083883279794310867</id><published>2009-07-30T23:04:00.000-07:00</published><updated>2010-05-18T03:19:13.101-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio .NET'/><title type='text'>Visual Studio .NET 2008 - Some conditional breakpoints not getting triggered and workaround.</title><content type='html'>If you read some debugging tips or reference on conditional breakpoint. You would notice that what is in the instruction should be straightforward and there is no reason why it won't work when you try it out.  &lt;br /&gt;  &lt;br /&gt;However, there are times when you set conditional breakpoint , a very simple one like  &lt;br /&gt;  &lt;br /&gt;say in you code,  &lt;br /&gt;  &lt;br /&gt;string a[] = {&amp;quot;21&amp;quot;, &amp;quot;123&amp;quot;, &amp;quot;32&amp;quot;, &amp;quot;1234&amp;quot;, &amp;quot;sds&amp;quot;};  &lt;br /&gt;  &lt;br /&gt;foreach (string myString in stringArray)  &lt;br /&gt;{  &lt;br /&gt;Console.WriteLine(&amp;quot;myString = &amp;quot; + myString); //conditional breakpoint set here.  &lt;br /&gt;}  &lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;conditional breakpoint set as myString == &amp;quot;1234&amp;quot; but to your surprise, it would not break and stop there.  &lt;br /&gt;  &lt;br /&gt;It is a very simple thing you would do but it just seems not working. For most people, they would just set normal breakpoint there and run a few more iterations and bypass the use of the conditional breakpoints but this is not my liking. This is a VS.NET function that I would really like it to work. It is afterall a very productive debugging function.   &lt;br /&gt;  &lt;br /&gt;And after some trial and error. It seems like the == operator is not correctly recognized as the ordinary C# syntax in the case of string in the conditonal breakpoint expression. It would work on most type like int, float but not on string. I suspect it would not work on most reference type variable (my reckon, though i have not tested it).   &lt;br /&gt;So, to cut story short. In the case when some occassion when expression in conditional breakpoints not working because of some operator like == or &amp;gt;.   &lt;br /&gt;Use the equivalent function. So, in the case of string. That would be String.Equals.   &lt;br /&gt;So, use Equals in the expression of the conditional breakpoint instead.  &lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:dbf39e51-9870-40f8-92aa-e39bca026ab7" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/VS.NET+Debugger" rel="tag"&gt;VS.NET Debugger&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-3083883279794310867?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/3083883279794310867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=3083883279794310867' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/3083883279794310867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/3083883279794310867'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2009/07/visual-studio-net-2008-some-conditional.html' title='Visual Studio .NET 2008 - Some conditional breakpoints not getting triggered and workaround.'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-458633475315421128</id><published>2009-06-03T22:23:00.000-07:00</published><updated>2009-10-19T22:59:30.307-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# 2.0 syntax reference</title><content type='html'>readonly - member variable of class where can only be initialized once in constructor.&lt;br /&gt;&lt;br /&gt;yield - contruct return for IEnumerable&lt;br /&gt;&lt;br /&gt;e.g.&lt;br /&gt;&lt;br /&gt;IEnumerable&lt;int&gt; GetNumbers()&lt;br /&gt;{&lt;br /&gt; yield return 1;&lt;br /&gt; yield return 2;&lt;br /&gt; yield return 3;&lt;br /&gt; yield return 4;&lt;br /&gt; yield break;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This is return a 1,2,3,4 list.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;this() - calling class constructor&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;this[] - [] operator override&lt;br /&gt;&lt;br /&gt;e.g&lt;br /&gt;&lt;br /&gt;public int this[int i]&lt;br /&gt;{&lt;br /&gt;get &lt;br /&gt;{&lt;br /&gt;   return 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;generic programming&lt;br /&gt;&lt;br /&gt;//where TbaseClass is use for T calling function&lt;br /&gt;class C1&amp;lt;T&amp;gt;:D1 where T:TbaseClass &lt;br /&gt;&lt;br /&gt;class B1 : C1&amp;lt;myInherittedTbaseClass&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-458633475315421128?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/458633475315421128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=458633475315421128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/458633475315421128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/458633475315421128'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2009/06/c-20-syntax-reference.html' title='C# 2.0 syntax reference'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-1055379231432414961</id><published>2009-06-03T21:00:00.000-07:00</published><updated>2009-10-19T22:59:46.537-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# pass-by-value and reference type</title><content type='html'>If you are coming from C/C++ programming background. You would be accustomed  with heavy use of pass by reference (or pass by pointer) as a  way to improve the performance, update the variable passed in  and reducing memory consumption. It is  so common, that most C/C++ function written to be efficient would be passing by constant reference (if they do not wish to allow variable passed in get updated) &lt;br /&gt;&lt;br /&gt;Like&lt;br /&gt;&lt;br /&gt;void myFunction(const MyClass &amp; param)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, you are rest assured that variable pass in would not get updated. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For C#, there is no such thing as const reference. But, there is pass-by-ref, unsafe pointer and pass-by-value.&lt;br /&gt;So, to ensure that your variable passed in to function not get updated. You would naturally think of using pass-by-value. &lt;br /&gt;&lt;br /&gt;However, there is a catch for pass-by-value if your object is of reference type (class, interface, delegate, objet, string)&lt;br /&gt;&lt;br /&gt;Value type variable store value but reference type variable store references to object. So, even the reference is passed by value in the function. The method can still use the reference it receive to &lt;br /&gt;update the original object stored in the memory.&lt;br /&gt;&lt;br /&gt;So,&lt;br /&gt;&lt;br /&gt;MyClass o = new MyClass();&lt;br /&gt;myFunction(o);&lt;br /&gt;Debug.Assert(o.MyName  != “123”) ; //assertion get thrown because object has been updated by function&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Public void myFunction(MyClass o)&lt;br /&gt;{&lt;br /&gt;  o.MyName = “123”&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;So, in short, do not update the variable pass in to the function if you do not intend to. Or simply, write a  Clone function for your object and pass in clone object instead.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-1055379231432414961?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/1055379231432414961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=1055379231432414961' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/1055379231432414961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/1055379231432414961'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2009/06/c-pass-by-value-and-reference-type.html' title='C# pass-by-value and reference type'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-8603985740102773738</id><published>2009-04-26T22:45:00.000-07:00</published><updated>2009-10-19T23:00:07.223-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smart thinking'/><title type='text'>Smart Thinking &amp; Lateral Thinking (Edward De Bono)</title><content type='html'>(These are just my own "personal" summary to Edward De Bono smart thinking &amp; lateral thinking materials where I have came across some of his books lately. (for my own reference)&lt;br /&gt; Please visit authorized Edward De Bono web sites if you are interested on these topics. http://www.edwdebono.com/)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Lateral Thinking - 6 thinking hats&lt;br /&gt;&lt;br /&gt;White Hat - Based on hard data, facts, figures and numbers&lt;br /&gt;Red Hat - Based on hunch, gut feeling emotional point of view&lt;br /&gt;Black Hat - Pessimistic, sad &amp; negative view but logical.&lt;br /&gt;Yellow Hat - Glad and possitive but logical view.&lt;br /&gt;Green Hat - Alternative, creative and sprouting new idea.&lt;br /&gt;Blue Hat - Step back and take care of process of thinking. Deciding hats to be used and summarize what have been thought.&lt;br /&gt;&lt;br /&gt;Critical Thinking - A way to minimize mistake in thinking.&lt;br /&gt;&lt;br /&gt;Creative Thinking &lt;br /&gt;&lt;br /&gt;Provocative Operation - Come up with an absurd idea. Then, think of "movement".&lt;br /&gt;Movement - Think of ways to make provocative operation / random words possible. &lt;br /&gt;&lt;br /&gt;Random Words - Random nouns, then think of "movement"&lt;br /&gt;&lt;br /&gt;Focus - Set hit list (focus point for the creative thiking or where to improve).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-8603985740102773738?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/8603985740102773738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=8603985740102773738' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/8603985740102773738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/8603985740102773738'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2009/04/smart-thinking-lateral-thinking-edward.html' title='Smart Thinking &amp; Lateral Thinking (Edward De Bono)'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-2362891243632061376</id><published>2009-03-27T00:55:00.000-07:00</published><updated>2009-10-19T23:00:36.789-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DOS batch'/><title type='text'>DOS prompt batch</title><content type='html'>Was trying out something on batch file, quite interesting though has limited features. But would be a quick way to delivery some solutions. Always check what batch can do before want to write a program for it.  &lt;br /&gt;&lt;br /&gt;Good place to start on batch programming at -&gt; http://www.allenware.com/icsw/icswidx.htm&lt;br /&gt;&lt;br /&gt;SET MYLOCATION = C:\Folder&lt;br /&gt;&lt;br /&gt;REM A reversible CD command where you can go back where you &lt;br /&gt;REM came from.&lt;br /&gt;pushd %MYLOCATION% &lt;br /&gt;&lt;br /&gt;REM check for file existent&lt;br /&gt;if not exist *.txt goto ERROR&lt;br /&gt;&lt;br /&gt;for %%file in (*txt) do type "%%file" &gt;&gt; mySingleFile.txt&lt;br /&gt;IF ERRORLEVEL 1 goto ERROR&lt;br /&gt;popd&lt;br /&gt;&lt;br /&gt;:ERROR&lt;br /&gt;echo Error occurredEXIT /B 1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-2362891243632061376?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/2362891243632061376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=2362891243632061376' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/2362891243632061376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/2362891243632061376'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2009/03/dos-prompt-batch.html' title='DOS prompt batch'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-1778222228987882796</id><published>2009-03-09T03:36:00.001-07:00</published><updated>2009-10-19T23:00:57.417-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XSLT'/><title type='text'>XSL - Altering child attribute with original parent attribute</title><content type='html'>XML&lt;br /&gt;&lt;br /&gt; &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt; &amp;lt;Items xmlns=&amp;quot;http://www.abc.com&amp;quot; &lt;br /&gt;        xmlns:myns=&amp;quot;http://www.abc.com&amp;quot;&amp;gt; &amp;lt;Item attr=&amp;quot;1&amp;quot;&amp;gt; &amp;lt;field1&amp;gt;My Content 1&amp;lt;/field1&amp;gt; &lt;br /&gt;        &amp;lt;/Item&amp;gt; &amp;lt;Item attr=&amp;quot;2&amp;quot;&amp;gt; &amp;lt;field1&amp;gt;My Content 1&amp;lt;/field1&amp;gt; &amp;lt;/Item&amp;gt; &amp;lt;Item attr=&amp;quot;3&amp;quot;&amp;gt; &lt;br /&gt;        &amp;lt;field1&amp;gt;My Content 1&amp;lt;/field1&amp;gt; &amp;lt;field2 innerAttr=&amp;quot;a&amp;quot;&amp;gt;My Content 2&amp;lt;/field2&amp;gt; &lt;br /&gt;        &amp;lt;/Item&amp;gt; &amp;lt;/Items&amp;gt;&lt;br /&gt;&lt;br /&gt;XSL&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt; &amp;lt;xsl:stylesheet version=&amp;quot;1.0&amp;quot; &lt;br /&gt;        xmlns:xsl=&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot; xmlns:myns=&amp;quot;http://www.abc.com&amp;quot; &lt;br /&gt;        xmlns=&amp;quot;http://www.abc.com&amp;quot; &amp;gt; &amp;lt;xsl:output omit-xml-declaration=&amp;quot;no&amp;quot; &lt;br /&gt;        indent=&amp;quot;yes&amp;quot;/&amp;gt; &amp;lt;xsl:namespace-alias stylesheet-prefix=&amp;quot;#default&amp;quot; &lt;br /&gt;        result-prefix=&amp;quot;#default&amp;quot;/&amp;gt; &amp;lt;xsl:template match=&amp;quot;@* | node()&amp;quot;&amp;gt; &amp;lt;xsl:copy&amp;gt; &lt;br /&gt;        &amp;lt;xsl:apply-templates select=&amp;quot;@* | node()&amp;quot;/&amp;gt; &amp;lt;/xsl:copy&amp;gt; &amp;lt;/xsl:template&amp;gt; &lt;br /&gt;        &amp;lt;xsl:template match=&amp;quot;/myns:Items/myns:Item&amp;quot;&amp;gt; &amp;lt;xsl:variable name=&amp;quot;OriginalAttr&amp;quot; &lt;br /&gt;        select=&amp;quot;@attr&amp;quot;/&amp;gt; &amp;lt;xsl:choose&amp;gt; &amp;lt;xsl:when test=&amp;quot;./myns:field2/@innerAttr&amp;quot;&amp;gt; &lt;br /&gt;        &amp;lt;xsl:copy&amp;gt; &amp;lt;xsl:apply-templates select=&amp;quot;@*&amp;quot;/&amp;gt; &amp;lt;xsl:for-each select=&amp;quot;*&amp;quot;&amp;gt; &amp;lt;xsl:if &lt;br /&gt;        test=&amp;quot;local-name()=&amp;#39;field1&amp;#39;&amp;quot;&amp;gt; &amp;lt;xsl:copy&amp;gt; &amp;lt;xsl:apply-templates select=&amp;quot;@*&amp;quot;/&amp;gt; &lt;br /&gt;        &amp;lt;xsl:apply-templates select=&amp;quot;node()&amp;quot;/&amp;gt; &amp;lt;/xsl:copy&amp;gt; &amp;lt;/xsl:if&amp;gt; &amp;lt;xsl:if &lt;br /&gt;        test=&amp;quot;local-name()=&amp;#39;field2&amp;#39;&amp;quot;&amp;gt; &amp;lt;xsl:copy&amp;gt; &amp;lt;xsl:attribute name=&amp;quot;innerAttr&amp;quot;&amp;gt; &amp;lt;!-- &lt;br /&gt;        copy from parent attribute to child attribute--&amp;gt; &amp;lt;xsl:value-of &lt;br /&gt;        select=&amp;quot;$OriginalAttr&amp;quot;/&amp;gt; &amp;lt;/xsl:attribute&amp;gt; &amp;lt;xsl:apply-templates select=&amp;quot; &lt;br /&gt;        node()&amp;quot;/&amp;gt; &amp;lt;/xsl:copy&amp;gt; &amp;lt;/xsl:if&amp;gt; &amp;lt;/xsl:for-each&amp;gt; &amp;lt;/xsl:copy&amp;gt; &amp;lt;/xsl:when&amp;gt; &lt;br /&gt;        &amp;lt;xsl:otherwise&amp;gt; &amp;lt;xsl:copy&amp;gt; &amp;lt;xsl:apply-templates select=&amp;quot;@* | node()&amp;quot;/&amp;gt; &lt;br /&gt;        &amp;lt;/xsl:copy&amp;gt; &amp;lt;/xsl:otherwise&amp;gt; &amp;lt;/xsl:choose&amp;gt; &amp;lt;/xsl:template&amp;gt; &amp;lt;/xsl:stylesheet&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-1778222228987882796?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/1778222228987882796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=1778222228987882796' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/1778222228987882796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/1778222228987882796'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2009/03/xsl-altering-child-attribute-with.html' title='XSL - Altering child attribute with original parent attribute'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-5090825910312967560</id><published>2009-02-17T20:16:00.000-08:00</published><updated>2011-01-29T09:38:16.704-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nifty tools'/><title type='text'>Resumeable Windows File Copying</title><content type='html'>Recently having need to copy huge files or a whole set of files more often over the network. Thinking of finding a tool like getright. So, this is the tool I found really useful. &lt;br /&gt;&lt;br /&gt;Robocopy - &lt;a href="http://en.wikipedia.org/wiki/Robocopy"&gt;http://en.wikipedia.org/wiki/Robocopy&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;How it fit my usage is with command like below.&lt;br /&gt;&lt;br /&gt;robocopy &lt;a href="file://source/dir"&gt;\\source\dir&lt;/a&gt; &lt;a href="file://destination/dir"&gt;\\destination\dir&lt;/a&gt; /W:15 /R:30 /E /Z&lt;br /&gt;&lt;br /&gt;W = 15 seconds pause should it failed&lt;br /&gt;R = Retry of 30 times&lt;br /&gt;Z = Restartable mode&lt;br /&gt;E = Copying content recursively (including subfolders content)&lt;br /&gt;&lt;br /&gt;(use /MIR if want to mirror both side of content instead of /E. /MIR would remove the destination file if not found in source)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-5090825910312967560?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/5090825910312967560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=5090825910312967560' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/5090825910312967560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/5090825910312967560'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2009/02/restartable-windows-file-copying.html' title='Resumeable Windows File Copying'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-494191084418691192</id><published>2009-02-12T23:59:00.001-08:00</published><updated>2009-10-20T00:23:18.204-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='useful shortcuts'/><title type='text'>Adding notepad, command prompt, powershell run here context menu</title><content type='html'>Create a text file, name it temp.reg. Then, for each application you want to add it context menu.&lt;br /&gt;Copy and paste to the temp.reg. Then, just execute the temp.reg by double clicking it.&lt;br /&gt;&lt;br /&gt;For Powershell&lt;br /&gt; --------------&lt;br /&gt;&lt;br /&gt;Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\Directory\shell\powershell]@="PowerShell Here"[HKEY_CLASSES_ROOT\Directory\shell\powershell\command]@="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Command Prompt&lt;br /&gt;-----------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Windows Registry Editor Version 5.00&lt;br /&gt;[HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt]&lt;br /&gt;@="Command Prompt Here"&lt;br /&gt;[HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt\command]&lt;br /&gt;@="C:\\Windows\\system32\\cmd.exe /k pushd %1"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Notepad&lt;br /&gt;----------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Windows Registry Editor Version 5.00&lt;br /&gt;[HKEY_CLASSES_ROOT\*\shell\Edit in Notepad]&lt;br /&gt;[HKEY_CLASSES_ROOT\*\shell\Edit in Notepad\command]&lt;br /&gt;@="notepad.exe \"%l\""&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-494191084418691192?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/494191084418691192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=494191084418691192' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/494191084418691192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/494191084418691192'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2009/02/adding-notepad-command-prompt.html' title='Adding notepad, command prompt, powershell run here context menu'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-7959511510152919278</id><published>2009-01-29T23:40:00.000-08:00</published><updated>2009-01-30T01:47:47.843-08:00</updated><title type='text'>Searching word/phrase in a very large text file in windows</title><content type='html'>1. Firstly, you need to have a grep tool (like Unix). For windows, you can try&lt;br /&gt;&lt;br /&gt;http://www.wingrep.com/&lt;br /&gt;&lt;br /&gt;2. Then, you just search a word/phrase in the text file with simple query or advanced regular expression query in the wingrep.&lt;br /&gt;&lt;br /&gt;3. You should be getting the line number in the grep search result.&lt;br /&gt;&lt;br /&gt;4. Then, start dos prompt.&lt;br /&gt;&lt;br /&gt;5. Type command - "more +123 YourHugeFile.txt" where 123 for example is the line number you wish to see starting from.&lt;br /&gt;&lt;br /&gt;6. Then, you should see some content in "more"  dos screen.&lt;br /&gt;&lt;br /&gt;7. If you wish to scroll line by line in "more", key in "enter/ret". if you wish to go page by page, key in "space"&lt;br /&gt;&lt;br /&gt;9 Once you are done, type "CTRL + C" to exit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-7959511510152919278?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/7959511510152919278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=7959511510152919278' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/7959511510152919278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/7959511510152919278'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2009/01/searching-wordphrase-in-very-large-text.html' title='Searching word/phrase in a very large text file in windows'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-509356575006845009</id><published>2008-09-07T20:03:00.000-07:00</published><updated>2008-09-07T20:07:03.766-07:00</updated><title type='text'>Virtual PC setting - resetting MAC address.</title><content type='html'>In the case where you would want to change the IP address by forcing the DHCP to re-assign a new IP to you Virtual PC. (or in the case you are using the same *.vmc file and you don’t bother to recreate a new one)&lt;br /&gt;&lt;br /&gt;Stop your virtual machine. Then, in your *.vmc, look for&lt;br /&gt;&lt;br /&gt;&amp;lt;ethernet_card_address type="bytes"&amp;gt;0003FFxxxxxx&amp;lt;/ethernet_card_address&amp;gt;&lt;br /&gt;&lt;br /&gt;Remove the number so the line appears as follows:&lt;br /&gt;&lt;br /&gt;&amp;lt;ethernet_card_address type="bytes"&amp;gt;&amp;lt;/ethernet_card_address&amp;gt;&lt;br /&gt;&lt;br /&gt;After you remove the number, Virtual PC will create a new MAC address the next time you start the virtual machine. And in turn, DHCP will assign u a new IP address for your virtual machine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-509356575006845009?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/509356575006845009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=509356575006845009' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/509356575006845009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/509356575006845009'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2008/09/virtual-pc-setting-resetting-mac.html' title='Virtual PC setting - resetting MAC address.'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-3923694871135469624</id><published>2008-08-29T00:22:00.000-07:00</published><updated>2009-01-29T23:58:01.281-08:00</updated><title type='text'>SQL server IDENTITY and seed</title><content type='html'>One can make a column to be auto increment by setting it as identity.&lt;br /&gt;&lt;br /&gt;CREATE TABLE dbo.MyTable ( MyID int identity(1,1), MyName nvarchar(20) )&lt;br /&gt;&lt;br /&gt;One can make it start from certain number by setting the seed&lt;br /&gt;&lt;br /&gt;identity(1000, 1)&lt;br /&gt;&lt;br /&gt;So, the first row would have id 1001&lt;br /&gt;&lt;br /&gt;One can also increase the seed even with some data in the table say already the record run up to 102. If set seed to 200, the next record id would be 201. (one catch is if seed is 1, it will start with 1. But if seed as 11, it will start at 12.)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also one note is that the seed can not be smaller than the existing one as it would not make any changes. (the existing seed number can be check in the property of the column)&lt;br /&gt;&lt;br /&gt;For reseting the identity seed. The DBCC command is needed like&lt;br /&gt;&lt;br /&gt;DBCC CHECKIDENT('MyTable', RESEED, 1)&lt;br /&gt;&lt;br /&gt;It will attempt to start over from 1 and if found some ID with the same number exist, it will skip that ID and use next number. (This is done by the MSSQL in best effort mode. It is not predictable and guaranteed to work correctly)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-3923694871135469624?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/3923694871135469624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=3923694871135469624' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/3923694871135469624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/3923694871135469624'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2008/08/sql-server-identity-and-seed.html' title='SQL server IDENTITY and seed'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-5978233218506802300</id><published>2008-06-06T01:27:00.000-07:00</published><updated>2008-06-06T01:30:05.277-07:00</updated><title type='text'>Getting started powershell</title><content type='html'>After installing powershell 1.0. The $profile will not be added. &lt;br /&gt;The $profile is equivalent to .profile in ksh where it initialized when it started.&lt;br /&gt;&lt;br /&gt;So, to add it. You need to specify permission first (like below), then, create the $profile. (you can echo $profile to see where the file resides in the windows)&lt;br /&gt;&lt;br /&gt;Set-ExecutionPolicy RemoteSigned&lt;br /&gt;new-item -path $profile -itemtype file -force&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-5978233218506802300?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/5978233218506802300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=5978233218506802300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/5978233218506802300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/5978233218506802300'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2008/06/getting-started-powershell.html' title='Getting started powershell'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-8721072264497792250</id><published>2008-06-03T21:21:00.000-07:00</published><updated>2008-06-03T22:54:09.573-07:00</updated><title type='text'>Fix login of restored DB (SQL server 2005)</title><content type='html'>After when restored Database from *.bak file. The associated login will not be restored into the MSSQL. &lt;br /&gt;&lt;br /&gt;And when trying to create the same login in the security tab in managemement studio. It will prompt&lt;br /&gt;&lt;br /&gt;Error 15023: User already exists in current database.&lt;br /&gt;&lt;br /&gt;The off hand workaround that normally one would do would be drop the user in the database user login and recreate again.&lt;br /&gt;like&lt;br /&gt;USE YourDB&lt;br /&gt;GO&lt;br /&gt;EXEC sp_dropuser 'YourRestoredDBLogin'&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;The better way would be &lt;br /&gt;&lt;br /&gt;run command below to check the orphan logins.&lt;br /&gt;&lt;br /&gt;USE YourDB&lt;br /&gt;GO&lt;br /&gt;EXEC sp_change_users_login 'Report'&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;then below to restored the login with command below. It will retain the settings that you have. &lt;br /&gt;&lt;br /&gt;USE YourDB&lt;br /&gt;GO&lt;br /&gt;EXEC sp_change_users_login 'Auto_Fix', 'YourRestoredDBLogin', NULL, 'YourRestoredDBLoginPassword'&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Reference: http://blog.sqlauthority.com/2007/02/15/sql-server-fix-error-15023-user-already-exists-in-current-database/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-8721072264497792250?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/8721072264497792250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=8721072264497792250' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/8721072264497792250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/8721072264497792250'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2008/06/fix-login-of-restored-db-sql-server.html' title='Fix login of restored DB (SQL server 2005)'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-925201653605486995</id><published>2008-03-11T01:06:00.000-07:00</published><updated>2008-03-11T01:09:53.927-07:00</updated><title type='text'>Winmerge - To be able to see non English characters in compare windows</title><content type='html'>Firstly, &lt;br /&gt;&lt;br /&gt;                Change your windows Language for non-unicode program to the language you want.(In Regional and Language Option in control. refer Windows Help file)&lt;br /&gt;Then, &lt;br /&gt;&lt;br /&gt;In winmerge – Edit – Options – Codepage (tab) &lt;br /&gt;&lt;br /&gt;Tick ‘According to WinMerge User Interface’&lt;br /&gt;&lt;br /&gt;Then, &lt;br /&gt;&lt;br /&gt;In View – Select Font – choose the font which has needed font script. E.g. CHINESE_GB2312 for simplified chinese&lt;br /&gt;&lt;br /&gt;Then&lt;br /&gt;&lt;br /&gt;In winmerge – Edit   - Refresh Selected (if you are already viewing  something.) and no restart required to see the changes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-925201653605486995?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/925201653605486995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=925201653605486995' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/925201653605486995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/925201653605486995'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2008/03/winmerge-to-able-to-see-non-english.html' title='Winmerge - To be able to see non English characters in compare windows'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-145924903525419205</id><published>2008-02-28T01:23:00.000-08:00</published><updated>2008-02-28T01:28:27.968-08:00</updated><title type='text'>Win32 SendMessage  equivalent in Javascript</title><content type='html'>Problem Statement:&lt;br /&gt;&lt;br /&gt;Custom control written in Javascript can't immediate trigger the onchange event if &lt;br /&gt;the textbox control are updated using the code. e.g. ctrl.value = "123";&lt;br /&gt;It will only trigger the onchange when move focus to another control.&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;Win32 SendMessage  equivalent in Javascript&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;IE:&lt;br /&gt;&lt;br /&gt;element.fireEvent('onchange');&lt;br /&gt;&lt;br /&gt;And via DOM2 Events (for Gecko):&lt;br /&gt;&lt;br /&gt;var evt = document.createEvent('HTMLEvents');&lt;br /&gt;evt.initEvent('change', true, true);&lt;br /&gt;element.dispatchEvent(evt);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-145924903525419205?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/145924903525419205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=145924903525419205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/145924903525419205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/145924903525419205'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2008/02/win32-sendmessage-equivalent-in.html' title='Win32 SendMessage  equivalent in Javascript'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-3959847526397388956</id><published>2007-12-18T17:49:00.000-08:00</published><updated>2007-12-18T17:54:55.005-08:00</updated><title type='text'>Eclipse CVS Repository Integration Watch Out</title><content type='html'>Eclipse has CVS version control integrated. It is nifty but some watch out to be careful of.&lt;br /&gt;&lt;br /&gt;1. Always Refresh your project/ whole thing in the project view before performing Team -  Synchronize With Repository or else you would not see your changes during synchronization and causing your changes GONE if you choose to update the files thinking your side have no changes!!!&lt;br /&gt;&lt;br /&gt;2. Always use synchronize to check the changes. NEVER use the update (to overwrite local file with changes from server) or commit (to overwrite server/remote files with local file changes) to a folder directly. You would cause either server version get overwritten by your version if there are additional changes by others or your version get overwritten by server copy without doing the conflict checking and merge.&lt;br /&gt;&lt;br /&gt;3. If you have already merged the changes (by comparing remote file and local file and use move change facility), your side with the server. Select ‘mark as merge’ and then commit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-3959847526397388956?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/3959847526397388956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=3959847526397388956' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/3959847526397388956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/3959847526397388956'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/12/eclipse-cvs-watch-out.html' title='Eclipse CVS Repository Integration Watch Out'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-761111429335399231</id><published>2007-12-05T05:53:00.000-08:00</published><updated>2007-12-05T06:03:19.779-08:00</updated><title type='text'>MSSQL GROUP_CONCAT</title><content type='html'>This is using XML feature of the SQL server. (nothing new here)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select Type, RestaurantNames from Restaurant AS A CROSS APPLY&lt;br /&gt;(SELECT RestaurantName + ',' FROM  Restaurant AS B WHERE A.Type = B.Type FOR XML PATH('')) D (RestaurantNames) GROUP BY Type, RestaurantNames&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is to get something like below (similar to MYSQL GROUP_CONCAT)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Type               |RestaurantNames&lt;br /&gt;-----              ---------------&lt;br /&gt;Chinese Food       | Ah Yat Abalone, Liang Yah Yong Tau Foo, &lt;br /&gt;Indian Food        | Kanna Curry House, &lt;br /&gt;Western Fast Food  | Burger King, McDonald   &lt;br /&gt;&lt;br /&gt;instead of multiple rows. &lt;br /&gt;&lt;br /&gt;like &lt;br /&gt;Type               |RestaurantName&lt;br /&gt;-----              ---------------&lt;br /&gt;Chinese Food       |Ah Yat Abalone&lt;br /&gt;Chinese Food       |Liang Yah Yong Tau Foo&lt;br /&gt;Indian Food        |Kanna Curry House&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-761111429335399231?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/761111429335399231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=761111429335399231' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/761111429335399231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/761111429335399231'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/12/mssql-groupconcat.html' title='MSSQL GROUP_CONCAT'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-7342805064835464829</id><published>2007-11-05T02:52:00.000-08:00</published><updated>2007-11-05T03:02:15.632-08:00</updated><title type='text'>ASP.NET i18n setting.</title><content type='html'>&lt;span&gt;&lt;p&gt;web.config&lt;/p&gt; &lt;p&gt;&amp;lt;globalization requestencoding="utf-8" responseencoding="utf-8" fileencoding="utf-8"&amp;gt;&amp;lt;/globalization&amp;gt;&lt;/p&gt;If UTF-8 does not solve the problem for some reasons or feeling it is too consuming bytes since it standardize to 2 bytes.&lt;br /&gt;&lt;br /&gt;use each language codec (multibyte mode) by specify.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;&amp;lt;globalization requestencoding="euc-jp" responseencoding="euc-jp" enablebestfitresponseencoding="true"&amp;gt;&amp;lt;/globalization&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;p&gt;Note: the language codec must be installed of course in the first place.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-7342805064835464829?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/7342805064835464829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=7342805064835464829' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/7342805064835464829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/7342805064835464829'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/11/aspnet-i18n-setting.html' title='ASP.NET i18n setting.'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-5769245509687975619</id><published>2007-10-17T21:55:00.000-07:00</published><updated>2007-10-18T02:05:04.523-07:00</updated><title type='text'>Truncate String in XSL call-template</title><content type='html'>The purpose is to just prune the string and add ... at the end when certain size of the string in xsl output exceeded.&lt;br /&gt;This method do not burden CPU much. (as some using recursive ways do)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- include this into XSL stylesheet --&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:template name="fixed-string"&amp;gt;&lt;br /&gt;&amp;lt;xsl:param name="targetVar"&amp;gt;&lt;br /&gt;&amp;lt;xsl:param name="allowable-length"&amp;gt;&lt;br /&gt;&amp;lt;xsl:value-of select="substring($targetVar, 1, $allowable-length)"&amp;gt;&lt;br /&gt;&amp;lt;xsl:if test="string-length($targetVar) &amp;amp; gt ; $allowable-length"&amp;gt;&lt;br /&gt;&amp;lt;xsl:text&amp;gt;...&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;&amp;lt;/xsl:if&amp;gt;&lt;br /&gt;&amp;lt;/xsl:value-of&amp;gt;&amp;lt;/xsl:param&amp;gt;&amp;lt;/xsl:param&amp;gt;&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To use it,&lt;br /&gt;&lt;br /&gt;just&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:call-template name="fixed-string"&amp;gt;&lt;br /&gt;&amp;lt;xsl:with-param name="targetVar"&amp;gt;'&amp;lt;xsl:value-of select="MyContent"&amp;gt;'&amp;lt;/xsl:value-of&amp;gt;&lt;br /&gt;&amp;lt;xsl:with-param name="allowable-length" select="15"&amp;gt; &amp;lt;!-- say, limited to 15 chars--&amp;gt; &amp;lt;/xsl:call-template--&amp;gt;&lt;br /&gt;&amp;lt;/xsl:with-param&amp;gt;&amp;lt;/xsl:with-param&amp;gt;&amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;&lt;br /&gt;Original script located at http://www.stylusstudio.com/xsllist/200104/post20940.html&lt;br /&gt;I just tidy up to ease reuse.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-5769245509687975619?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/5769245509687975619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=5769245509687975619' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/5769245509687975619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/5769245509687975619'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/10/truncate-string-in-xsl-call-template.html' title='Truncate String in XSL call-template'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-5067394478181172624</id><published>2007-08-16T06:17:00.000-07:00</published><updated>2007-08-16T06:18:41.642-07:00</updated><title type='text'>Press anykey to continue</title><content type='html'>Taken from http://www.codeproject.com/useritems/PressAnyKeyToContinue.asp&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private void FlushConsole()&lt;br /&gt;{&lt;br /&gt;  while( Console.In.Peek() != -1 )&lt;br /&gt;  {&lt;br /&gt;    Console.In.Read();&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Console.WriteLine("Press any key to continue...");&lt;br /&gt;FlushConsole();&lt;br /&gt;Console.Read();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-5067394478181172624?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/5067394478181172624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=5067394478181172624' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/5067394478181172624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/5067394478181172624'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/08/press-anykey-to-continue.html' title='Press anykey to continue'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-4229240514700543954</id><published>2007-07-23T05:02:00.000-07:00</published><updated>2007-07-23T05:09:41.037-07:00</updated><title type='text'>Crystal Report Formula - ToWords - Remove 'xx/100' the trailing string.</title><content type='html'>Left(ToWords(Sum ({YourTable.Field})),   InStr(ToWords(Sum ({YourTable.Field})), " and "))    &amp; " and " &amp; ToWords(ToNumber (Right(ToText(Sum ({YourTable.Field})),  2  )), 0) &amp; " cents."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-4229240514700543954?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/4229240514700543954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=4229240514700543954' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/4229240514700543954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/4229240514700543954'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/07/crystal-report-formula-towords-remove.html' title='Crystal Report Formula - ToWords - Remove &apos;xx/100&apos; the trailing string.'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-3950821575823521818</id><published>2007-07-23T04:54:00.000-07:00</published><updated>2007-07-29T22:36:58.315-07:00</updated><title type='text'>LPAD in T-SQL and Crystal Report Formula</title><content type='html'>I am sure there should have some neater ways to do this but if all you need are just working version, here it goes.&lt;br /&gt;&lt;br /&gt;T-SQL&lt;br /&gt;&lt;br /&gt;REPLICATE('0', 8 - LEN(LTRIM(STR(YourTableField)))) + LTRIM(STR(YourTableField))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Crystal Report Formula&lt;br /&gt;&lt;br /&gt;StringVar Message := "";&lt;br /&gt;StringVar Num := {YourCrystalReportTable.Field};&lt;br /&gt;Num := Trim (Num);&lt;br /&gt;NumberVar Counter := 8 - Length(Num) ;&lt;br /&gt;While (Counter &gt; 0)  do&lt;br /&gt;(    &lt;br /&gt;Message := Message &amp; "0";&lt;br /&gt;Counter := Counter - 1;&lt;br /&gt;);&lt;br /&gt;Message := Message &amp; Num&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-3950821575823521818?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/3950821575823521818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=3950821575823521818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/3950821575823521818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/3950821575823521818'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/07/lpad-in-t-sql-and-crystal-report.html' title='LPAD in T-SQL and Crystal Report Formula'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-7272538605276396147</id><published>2007-07-17T05:13:00.000-07:00</published><updated>2007-07-17T05:15:28.263-07:00</updated><title type='text'>Workflow in ASP.NET</title><content type='html'>Same codes except &lt;br /&gt;placing static variable &lt;br /&gt;&lt;br /&gt;static WorkflowRuntime wr = new WorkflowRuntime();&lt;br /&gt;&lt;br /&gt;in &lt;br /&gt;Application_Start of global.asax&lt;br /&gt;&lt;br /&gt;then &lt;br /&gt;&lt;br /&gt;(quoted from MSLearning)&lt;br /&gt;&lt;br /&gt;If you use the WorkflowWebRequestContext object to access the workflow runtime, you cannot add services such as persistence or scheduling services because the workflow is already started. If you try to add services to the runtime when it has already started it will generate an error. Instead, to configure the runtime with services, use the &amp;lt;workflowRuntime&amp;gt; section in the Web.config file:&lt;br /&gt;&lt;br /&gt;[Web.config]&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;    &amp;lt;configSections&amp;gt;&lt;br /&gt;        &amp;lt;section name="WorkflowRuntime"&lt;br /&gt;            type="WorkflowRuntimeSection, System.Workflow.Runtime" /&amp;gt;&lt;br /&gt;    &amp;lt;/configSections&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-7272538605276396147?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/7272538605276396147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=7272538605276396147' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/7272538605276396147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/7272538605276396147'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/07/workflow-in-aspnet.html' title='Workflow in ASP.NET'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-767635126686196651</id><published>2007-07-17T04:08:00.000-07:00</published><updated>2007-07-17T04:35:22.866-07:00</updated><title type='text'>Host Workflow in .NET WinForm</title><content type='html'>Add reference to&lt;br /&gt; - System.Workflow.Activities&lt;br /&gt; - System.Workflow.Runtime&lt;br /&gt; - System.Workflow.ComponentModel&lt;br /&gt;  - &amp;lt;the MyWorkflow assembly&amp;gt;&lt;br /&gt;&lt;br /&gt;in the WinForm codes,&lt;br /&gt;&lt;br /&gt;add member variable &lt;br /&gt;&lt;br /&gt;WorkflowRuntime myWorkflowRuntime = new WorkflowRuntime()&lt;br /&gt;&lt;br /&gt;Then, in the constructor of the winform.&lt;br /&gt;//setup event handler&lt;br /&gt; myWorkflowRuntime.WorkflowCompleted += new EventHandler&amp;lt;WorkflowCompletedEventArg&amp;gt;(wr_WFCompleted);&lt;br /&gt; myWorkflowRuntime.WorkflowTerminated += new EventHandler&amp;lt;WorkflowTerminatedEventArg&amp;gt;(wr_WFTerminated);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//handler for the workflow thread. &lt;br /&gt;void wr_WFCompleted(object sender, WorkflowCompletedEventArg e)&lt;br /&gt;{&lt;br /&gt; MessageBox.Show("Workflow output" +  e.OutputParameters["Field"].ToString());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//to kick start the work flow thread. &lt;br /&gt; Type type = typeof(MyNamespace.MyWorkflow);&lt;br /&gt;//to pass parameter to the workflow thread.&lt;br /&gt;Dictionary&amp;lt;string, object&amp;gt; param = Dictionary&amp;lt;string, object&amp;gt;;&lt;br /&gt;param.Add("Field", System.Convert.ToInt32(123));&lt;br /&gt; WorkflowInstance myWI= myWorkflowRuntime.CreateWorkflow(type, param);&lt;br /&gt; myWI.Start();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-767635126686196651?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/767635126686196651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=767635126686196651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/767635126686196651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/767635126686196651'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/07/host-workflow-in-net-winform.html' title='Host Workflow in .NET WinForm'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-4846777945199261834</id><published>2007-07-16T03:18:00.000-07:00</published><updated>2007-07-16T03:52:00.914-07:00</updated><title type='text'>WPF sample</title><content type='html'>(Nothing new, codes taken from MSLearning)&lt;br /&gt;&lt;br /&gt;&amp;lt;Application x:Class="MyApp"&lt;br /&gt;    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;br /&gt;    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&lt;br /&gt;    StartupUri="Window1.xaml"&amp;gt;&lt;br /&gt;Startup="MyApp_Startup"&lt;br /&gt;Activated="MyApp_Activated"&lt;br /&gt;Deactivated="MyApp_Deactivated"&lt;br /&gt;SessionEnding="MyApp_SessionEnding"&lt;br /&gt;Exit="MyApp_Exit"&lt;br /&gt;&amp;lt;/Application&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C#&lt;br /&gt;public class MyApp : Application&lt;br /&gt;{&lt;br /&gt;    StackPanel rootPanel;&lt;br /&gt;    Window win;&lt;br /&gt;&lt;br /&gt;    protected override void OnStartup(StartupEventArgs e)&lt;br /&gt;    {&lt;br /&gt;        win = new System.Windows.Window();&lt;br /&gt;        rootPanel = new StackPanel();&lt;br /&gt;        win.Content = rootPanel;&lt;br /&gt;        win.Show();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    void MyApp_Startup (object sender, StartupEventArgs e)&lt;br /&gt;   {&lt;br /&gt;    //singleton model and where sharing information pages uses Properties. &lt;br /&gt;    MyApp.Current.Properties["TextFromPage1"] = txtBox.Text;&lt;br /&gt;&lt;br /&gt;    // Retrieve the information&lt;br /&gt;    string appPropertyValue;&lt;br /&gt;    appPropertyValue = (string)MyApp.Current.Properties["TextFromPage1"];&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   void MyApp_SessionEnding(object sender, SessionEndingCancelEventArgs e)&lt;br /&gt;   {&lt;br /&gt;    //trigger if user shut down system or log off and application hasn't exit.&lt;br /&gt;    //session ending then application exit &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    void MyApp_Activated(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;   &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;internal sealed class TestMain&lt;br /&gt;{&lt;br /&gt;    [System.STAThread()]&lt;br /&gt;    public static void Main()&lt;br /&gt;    {&lt;br /&gt;        MyApp app = new MyApp();&lt;br /&gt;        app.Run();&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-4846777945199261834?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/4846777945199261834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=4846777945199261834' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/4846777945199261834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/4846777945199261834'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/07/wpf-sample.html' title='WPF sample'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-4550919989604841432</id><published>2007-07-16T01:34:00.000-07:00</published><updated>2007-07-16T02:26:49.135-07:00</updated><title type='text'>Hosting WPF (Avalon Control) in WinForm quick info</title><content type='html'>Though this code snippet already available in the Win SDK sample.&lt;br /&gt;&lt;br /&gt;//the host should be a private member variable.&lt;br /&gt;ElementHost host = new ElementHosy(); &lt;br /&gt;host.Dock = DockStyle.Fill;&lt;br /&gt;myPanel.Controls.Add(host); //adding the control the panel control in the winform.&lt;br /&gt;//the variable datatype available after added reference &lt;br /&gt;//to the WPF/Avalon control and WPF namespace)&lt;br /&gt;avControl = new MyNamespace.MyAVControl();&lt;br /&gt;avControl.InitializeComponent();&lt;br /&gt;host.Child = avControl; //control has been linked to the winform&lt;br /&gt;&lt;br /&gt;//The RoutedEventHandler is used because the WPF in this case is a &lt;br /&gt;//child control. There are 3 type of event routing namely direct, tunnel and bubble.&lt;br /&gt;//refer http://msdn2.microsoft.com/en-us/library/ms742806.aspx#why_use&lt;br /&gt;//for more info on the event on WPF.&lt;br /&gt;avControl.Loaded += new RoutedEventHandler(avCtrl_Loaded);&lt;br /&gt;&lt;br /&gt;//To use Avalon control in Win32 which wrap the Avalon control into HwndSource &lt;br /&gt;//refer http://blogs.msdn.com/nickkramer/archive/2005/07/17/439659.aspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-4550919989604841432?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/4550919989604841432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=4550919989604841432' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/4550919989604841432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/4550919989604841432'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/07/hosting-wpf-avalon-control-in-winform.html' title='Hosting WPF (Avalon Control) in WinForm quick info'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-973511272018083051</id><published>2007-06-15T00:21:00.000-07:00</published><updated>2007-06-15T00:46:50.423-07:00</updated><title type='text'>Unix Debugging Cheat Sheet</title><content type='html'>pmap &lt;core | PID&gt; &lt;br /&gt;To check the memory address mapping of the core dumped process.&lt;br /&gt;&lt;br /&gt;e.g.&lt;br /&gt;&lt;br /&gt;036AA000    2592k [heap]&lt;br /&gt;&lt;br /&gt;So, it means 036AA000 and above is heap address. &lt;br /&gt;&lt;br /&gt;FFB3A000 [stack]&lt;br /&gt;&lt;br /&gt;And likewise. &lt;br /&gt;&lt;br /&gt;Also can be used to check shared memory, shared libraries used and etc.&lt;br /&gt;&lt;br /&gt;truss -d &lt;program&gt; -o &lt;output file&gt; -p &lt;pid&gt;&lt;br /&gt; System API trace.&lt;br /&gt;&lt;br /&gt;gcore - o &lt;output file&gt; &lt;PID&gt;&lt;br /&gt;Force core dump&lt;br /&gt;&lt;br /&gt;Use dbx later to investigate the core file. &lt;br /&gt;&lt;br /&gt;pstack &lt;PID&gt;&lt;br /&gt;&lt;br /&gt;call stack.&lt;br /&gt;&lt;br /&gt;ps -ef &lt;br /&gt;&lt;br /&gt;getting running process PID. &lt;br /&gt;&lt;br /&gt;Monitor system log file.&lt;br /&gt;tail -f /var/adm/SYSLOG&lt;br /&gt;tail -f /var/adm/messages&lt;br /&gt;tail -f /var/log/syslog&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ls -l /proc/&lt;PID&gt;/as&lt;br /&gt;ps -p &lt;PID&gt; -o pmem,vsz,osz,rss,pid&lt;br /&gt;To check memory usage.&lt;br /&gt;&lt;br /&gt;pldd &lt;PID&gt;&lt;br /&gt;check dependencies&lt;br /&gt;&lt;br /&gt;pargs &lt;PID&gt;&lt;br /&gt;check all arguments passed to process. &lt;br /&gt;Note: arg[0] is always the process execution path like even Win32. Useful also if the ls -l return truncated path.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-973511272018083051?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/973511272018083051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=973511272018083051' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/973511272018083051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/973511272018083051'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/06/unix-debugging-cheat-sheet.html' title='Unix Debugging Cheat Sheet'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-2322425717351335459</id><published>2007-06-12T21:24:00.000-07:00</published><updated>2007-06-13T20:58:20.882-07:00</updated><title type='text'>Excel VBA for conditional formatting.</title><content type='html'>Sub CreateConditionalFormatting()&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;Dim column As String&lt;br /&gt;column = "C"&lt;br /&gt;Dim NoOfRowNeeded As Integer&lt;br /&gt;NoOfRowNeeded = 3000&lt;br /&gt;Dim j As Integer&lt;br /&gt;Dim cellSelect As String&lt;br /&gt;For j = 1 To NoOfRowNeeded&lt;br /&gt;&lt;br /&gt;cellSelect = column &amp; CStr(j)&lt;br /&gt;&lt;br /&gt;Range(cellSelect).Select&lt;br /&gt;Selection.FormatConditions.Delete&lt;br /&gt;    If (j - 1) &amp;lt; 1 Then&lt;br /&gt;    &lt;br /&gt;     &lt;br /&gt;    Range(cellSelect).Interior.ColorIndex = 4&lt;br /&gt;    Else&lt;br /&gt;    &lt;br /&gt;   'maximum 3 formula allowed.&lt;br /&gt;    Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _&lt;br /&gt;        "=INT(" &amp; column &amp; CStr(j - 1) &amp; ")&lt;INT(" &amp; column &amp; CStr(j) &amp; ")"&lt;br /&gt;    Selection.FormatConditions(1).Interior.ColorIndex = 3&lt;br /&gt;    Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _&lt;br /&gt;        "=INT(" &amp; column &amp; CStr(j - 1) &amp; ")&gt;INT(" &amp; column &amp; CStr(j) &amp; ")"&lt;br /&gt;    Selection.FormatConditions(2).Interior.ColorIndex = 6&lt;br /&gt;    &lt;br /&gt;    Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _&lt;br /&gt;        "=INT(" &amp; column &amp; CStr(j - 1) &amp; ")=INT(" &amp; column &amp; CStr(j) &amp; ")"&lt;br /&gt;    Selection.FormatConditions(3).Interior.ColorIndex = 4&lt;br /&gt;   &lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;    End If&lt;br /&gt;Next j&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;End Sub&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-2322425717351335459?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/2322425717351335459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=2322425717351335459' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/2322425717351335459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/2322425717351335459'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/06/excel-vba-for-conditional-formatting.html' title='Excel VBA for conditional formatting.'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-89712993095685216</id><published>2007-05-03T05:17:00.000-07:00</published><updated>2007-07-17T05:18:03.624-07:00</updated><title type='text'>.NET 2.0 modifying content of app.config file (C#)</title><content type='html'>Before you start, make sure you have added reference to System.Configuration.dll for .NET 2.0. I think the default the Visual Studio C# Express referenced to is from .NET 1.1 which will not compile.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;using System.Configuration;&lt;br /&gt;using System.Collections.Specialized;&lt;br /&gt;&lt;br /&gt;//to write&lt;br /&gt;System.Configuration.Configuration config =&lt;br /&gt;          ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);&lt;br /&gt;&lt;br /&gt;config.AppSettings.Settings.Remove("myKey");&lt;br /&gt;config.AppSettings.Settings.Add("myKey", "123");&lt;br /&gt;&lt;br /&gt;config.Save(ConfigurationSaveMode.Modified);&lt;br /&gt;&lt;br /&gt;ConfigurationManager.RefreshSection("appSettings");&lt;br /&gt;&lt;br /&gt;//to read&lt;br /&gt;NameValueCollection appSettings = System.Configuration.ConfigurationManager.AppSettings;&lt;br /&gt;string strRead = (string)appSettings["myKey"];&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Content of app.config&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt; &amp;lt;configuration&amp;gt; &amp;lt;appSettings&amp;gt;&lt;br /&gt; &amp;lt;add key="myKey" value = "123"/&amp;gt;&lt;br /&gt; &amp;lt;/appSettings&amp;gt; &amp;lt;/configuration&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-89712993095685216?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/89712993095685216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=89712993095685216' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/89712993095685216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/89712993095685216'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/05/net-20-modifying-content-of-appconfig.html' title='.NET 2.0 modifying content of app.config file (C#)'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-8804641598178754647</id><published>2007-05-03T04:59:00.000-07:00</published><updated>2007-06-27T00:24:59.434-07:00</updated><title type='text'>Clearcase check in/uncheck out all the checked out files script</title><content type='html'>I am so used to source safe recursive check in and found troublesome in clearcase having to do it manually one by one.&lt;br /&gt;&lt;br /&gt;This is the Unix script that I have come out with&lt;br /&gt;&lt;br /&gt;&lt;p&gt;//for undo check out all the checked out files&lt;/p&gt; &lt;p&gt;cleartool lsco -cview -avobs | cleartool unco -rm `awk '{ print $(5) }'  |  sed -e 's/^\"*//' -e 's/ *\"$//'`&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;//for check in all the checked out files&lt;/p&gt; &lt;p&gt;cleartool lsco -cview -avobs | cleartool ci -nc `awk '{ print $(5) }'  | sed  -e 's/^\"*//' -e 's/ *\"$//'`&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;//Using xargs&lt;br /&gt;&lt;p&gt;&lt;br /&gt;cleartool lsco -cview -avobs -short | xargs cleartool ci &lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-8804641598178754647?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/8804641598178754647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=8804641598178754647' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/8804641598178754647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/8804641598178754647'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/05/clearcase-check-inuncheck-out-all.html' title='Clearcase check in/uncheck out all the checked out files script'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-5643170624080207615</id><published>2007-04-11T00:36:00.000-07:00</published><updated>2007-11-28T03:25:03.808-08:00</updated><title type='text'>Simple Test Unix C++ Source Compilation and Makefile</title><content type='html'>Create 3 (*.C) files&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;/* main.C */&lt;br /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;stdlib.h&gt;&lt;br /&gt;#include &lt;/stdlib.h&gt;&amp;lt;stdio.h&amp;gt;&lt;br /&gt;&lt;stdlib.h&gt;&lt;stdio.h&gt;#include "1.h"&lt;br /&gt;&lt;br /&gt;extern void test2();&lt;br /&gt;extern void test3();&lt;br /&gt;&lt;br /&gt;void test1()&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;test1();&lt;br /&gt;test2();&lt;br /&gt;test3();&lt;br /&gt;exit (EXIT_SUCCESS);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* 2.C */&lt;br /&gt;#include "1.h"&lt;br /&gt;#include "2.h"&lt;br /&gt;&lt;br /&gt;void test2() {&lt;br /&gt;}&lt;br /&gt;/* 3.C */&lt;br /&gt;#include "2.h"&lt;br /&gt;#include "3.h"&lt;br /&gt;void test3() {&lt;br /&gt;}&lt;br /&gt;&lt;/stdio.h&gt;&lt;/stdlib.h&gt;&lt;/blockquote&gt;&lt;br /&gt;Create 3 (*.h) files&lt;br /&gt;touch 1.h&lt;br /&gt;touch 2.h&lt;br /&gt;touch 3.h&lt;br /&gt;&lt;br /&gt;Then,&lt;br /&gt;&lt;br /&gt;Create a makefile with content (note: &amp;lt;tab&amp;gt; should be a real tab. Tab is very important or else you will else funny compiler message)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;testing123: main.o 2.o 3.o&lt;br /&gt;&amp;lt;tab&amp;gt;g++ -o myapp main.o 2.o 3.o&lt;br /&gt;main.o: main.C 1.h&lt;br /&gt;&amp;lt;tab&amp;gt;g++ -c main.C&lt;br /&gt;&lt;br /&gt;2.o: 2.C 1.h 2.h&lt;br /&gt;&amp;lt;tab&amp;gt;g++ -c 2.C&lt;br /&gt;&lt;br /&gt;3.o: 3.C 2.h 3.h&lt;br /&gt;&amp;lt;tab&amp;gt;g++ -c 3.C&lt;/tab&gt;&lt;/tab&gt;&lt;/tab&gt;&lt;/tab&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Then run&lt;br /&gt;&lt;br /&gt;make -f makefile&lt;br /&gt;&lt;br /&gt;then&lt;br /&gt;&lt;br /&gt;export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/apps/public/lib&lt;br /&gt;&lt;br /&gt;(for C++ libraries since g++ is to compile CPP files)&lt;br /&gt;&lt;br /&gt;Then, just run "testing123"&lt;br /&gt;&lt;br /&gt;(note: In Unix, *. a is a static library where as *.so or *.sa is a shared library or dynamic DLL in Win32 term. To make the link to shared library permanently link to the binary. Use the configuration option --disable-shared)&lt;br /&gt;&lt;br /&gt;To modify makefile above to create static lib file, makefile command as below&lt;br /&gt;&lt;blockquote&gt;# Which compiler&lt;br /&gt;CC = g++&lt;br /&gt;&lt;br /&gt;# Where are include files kept&lt;br /&gt;INCLUDE = .&lt;br /&gt;&lt;br /&gt;# Options for development&lt;br /&gt;CFLAGS = -g -Wall -ansi&lt;br /&gt;&lt;br /&gt;# Local Libraries&lt;br /&gt;MYLIB = lib.a&lt;br /&gt;&lt;br /&gt;testing123: main.o $(MYLIB)&lt;br /&gt;  $(CC) -o testing123 main.o $(MYLIB) $(CFLAGS)&lt;br /&gt;&lt;br /&gt;$(MYLIB): $(MYLIB)(2.o) $(MYLIB)(3.o)&lt;br /&gt;main.o: main.C a.h&lt;br /&gt;2.o: 2.C 1.h 2.h&lt;br /&gt;3.o: 3.C 2.h 3.h&lt;br /&gt;&lt;br /&gt;clean:&lt;br /&gt;  -rm testing123 main.o 2.o 3.o $(MYLIB)&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-5643170624080207615?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/5643170624080207615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=5643170624080207615' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/5643170624080207615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/5643170624080207615'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/04/simple-test-unix-c-source-compilation.html' title='Simple Test Unix C++ Source Compilation and Makefile'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-1045604982114281067</id><published>2007-02-02T05:00:00.000-08:00</published><updated>2007-02-02T05:04:05.080-08:00</updated><title type='text'>Recover from C++ istream failure sample</title><content type='html'>The code is not coded in a standard way where it would altogether avoid the problem but does exhibit the recover from C++ istream failure which occur in a while loop.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void main_menu(){&lt;br /&gt;int condition = 1;&lt;br /&gt;int input = 0;&lt;br /&gt;&lt;br /&gt;do {&lt;br /&gt; cout &lt;&lt; "please input an integer\n"; &lt;br /&gt;    if(cin.fail())    {        &lt;br /&gt;//if it encounter a fail state which is error type. it will ignore the buffer      &lt;br /&gt;        //associate with istream       &lt;br /&gt; cin.ignore(100);    &lt;br /&gt;    cin.clear();&lt;br /&gt;//reset the fail state to be good &lt;br /&gt; }    &lt;br /&gt;&lt;br /&gt;cin &gt;&gt; input;   &lt;br /&gt; fflush(stdin);    //fflush alone not suffice for some reason thou it works on scanf &lt;br /&gt;if (input == 1)   {&lt;br /&gt;cout &lt;&lt; "Hello World\n";&lt;br /&gt; condition=0;&lt;br /&gt;system("Pause");&lt;br /&gt;} else {   condition=1; } &lt;br /&gt;}&lt;br /&gt;while (condition == 1 );&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-1045604982114281067?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/1045604982114281067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=1045604982114281067' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/1045604982114281067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/1045604982114281067'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/02/recover-from-c-istream-failure-sample.html' title='Recover from C++ istream failure sample'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-116945658197733902</id><published>2007-01-22T00:55:00.000-08:00</published><updated>2007-08-19T20:45:01.122-07:00</updated><title type='text'>Using Cygwin as XServer and putty as terminal client.</title><content type='html'>&lt;span style="font-family:arial;"&gt;Firsly, install Cygwin with XServer.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Then, start your xserver in the cygwin bash shell by typing "startx &amp;" so that you will have an additional xterm for configuration or&lt;/span&gt;&lt;br /&gt;&lt;pre style="FONT-FAMILY: arial"&gt;xwin -broadcast to start a broadcast XDMCP session instead.&lt;br /&gt;&lt;br /&gt;Then, after started xserver, it will pop a xwindow client.&lt;br /&gt;&lt;br /&gt;In your xwindow client (normally xterm), authenticate (if required) any client that&lt;br /&gt;attempt to connect to your server by typing in&lt;br /&gt;&lt;br /&gt;xhost + &amp;lt; IP / hostname &amp;gt;&lt;ip&gt;&lt;br /&gt;&lt;br /&gt;(note: if hostname unresolved, add it in at /usr/hosts. Also to identify if your client&lt;br /&gt;having authentication problem. Normally, your client will get error message like&lt;br /&gt;&lt;br /&gt;authentication error - Xlib: Invalid MIT-MAGIC-COOKIE-1 key&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/ip&gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;Then,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;you would need to configure your putty session so that it would forward X11 to Xserver, this can be done so by going to&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Connection - SSH - X11- Tick Enable X11 Forwarding&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;And key in&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;X-Display Location as "localhost:0" (note, assuming your xserver is running at localhost)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Then, start your configured session and connect and login to say myserver.helloworld.com&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;To test the XWindow, type "xclock &amp;amp;" in your putty.&lt;br /&gt;&lt;br /&gt;(side note, the copy and paste for xwindow in cygwin commands below&lt;br /&gt;&lt;br /&gt;ctrl - ins for copy (or just highlight the text in the xwindow)&lt;br /&gt;shift - ins to paste (or "wget" prior shift-ins if it does not work))&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/9937599-116945658197733902?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/116945658197733902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=116945658197733902' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116945658197733902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116945658197733902'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2007/01/using-cygwin-as-xserver-and-putty-as.html' title='Using Cygwin as XServer and putty as terminal client.'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-116737466095727292</id><published>2006-12-28T22:43:00.000-08:00</published><updated>2007-01-03T02:33:15.580-08:00</updated><title type='text'>C/C++ Basic - protect data and pointer with const</title><content type='html'>char * const lpszct = "test";        //protecting pointer&lt;br /&gt;char szBuff[10];&lt;br /&gt;strcpy(szBuff, "123");&lt;br /&gt;const char* lpctsz=szBuff;         //protecting data pointed.&lt;br /&gt;&lt;br /&gt;lpszct = "12"; //&lt;-- compile error trying to change the pointer address&lt;br /&gt;&lt;br /&gt;lpszct ++; //&lt;-- compile error trying to change the pointer address&lt;br /&gt;&lt;br /&gt;lpctsz[0] = '7'; //&lt;-- compile error where trying to change the data&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-116737466095727292?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/116737466095727292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=116737466095727292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116737466095727292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116737466095727292'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/12/cc-basic-protect-data-and-pointer-with.html' title='C/C++ Basic - protect data and pointer with const'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-116730889870469240</id><published>2006-12-28T04:19:00.000-08:00</published><updated>2006-12-28T04:30:13.806-08:00</updated><title type='text'>Google Search Cheat Sheet</title><content type='html'>define:[word]                                        Search word in dictionaries&lt;br /&gt;filetype:[ext]                                        Query result with filetyp. E.g.         "C++ filetype:pdf"&lt;br /&gt;/[country]                                             Limited search to coutry  E.g.      "food /malaysia&lt;br /&gt;/language:[language shorthand]        Limited to particular language group. e.g. "cari /language:ms"&lt;br /&gt;site:[domain]                                         Limited to a domain. e.g. "thread site:edu"&lt;br /&gt;inanchor:[url]                                          Limited search to anchor &amp;lt;a&amp;gt;&lt;br /&gt;inurl:[word]                                           Limited search to URL of sites&lt;br /&gt;intitle:[word]                                         Limited search to web site title&lt;br /&gt;                                                               (content inside html title tag i think)&lt;br /&gt;intext:[word]                                          Limited search to web site content&lt;br /&gt;                                                                (content inside html body tag i think)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-116730889870469240?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/116730889870469240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=116730889870469240' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116730889870469240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116730889870469240'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/12/google-search-cheat-sheet.html' title='Google Search Cheat Sheet'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-116730599139650690</id><published>2006-12-28T03:37:00.000-08:00</published><updated>2006-12-28T03:46:49.973-08:00</updated><title type='text'>Kill all my processes in current Unix machine (shell script)</title><content type='html'>This is a korn shell script, but should work in other shell with little change or none.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;#created by Anthony Yio, 28 Dec 06&lt;br /&gt;#!/bin/ksh&lt;br /&gt;MYUSER=`whoami`&lt;br /&gt;for MYPID in `ps -ef | grep $MYUSER | awk '{ print $(2) }' | sort -r`&lt;br /&gt;do&lt;br /&gt;`kill -9 $MYPID`&lt;br /&gt;done&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-116730599139650690?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/116730599139650690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=116730599139650690' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116730599139650690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116730599139650690'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/12/kill-all-my-processes-in-current-unix.html' title='Kill all my processes in current Unix machine (shell script)'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-116557861478174671</id><published>2006-12-08T03:40:00.000-08:00</published><updated>2007-11-28T03:15:07.078-08:00</updated><title type='text'>A little perl script to spice up your unix shell startup</title><content type='html'>Content of perl script&lt;br /&gt;-----------&lt;br /&gt;&lt;blockquote&gt;use strict;&lt;br /&gt;&lt;br /&gt;$/ = "\n%%%\n";  #define separator for array&lt;br /&gt;open ARTS, "art.dat" or die $!;&lt;br /&gt;my @file = &amp;lt;arts&amp;gt;;&lt;br /&gt;my $random = rand(@file);&lt;br /&gt;&lt;br /&gt;my $ascii_art = $file[$random];&lt;br /&gt;$ascii_art=~s/\n%%%\n//; #remove the separator string&lt;br /&gt;print $ascii_art, "\n";&lt;/arts&gt;&lt;/blockquote&gt;&lt;br /&gt;----------&lt;br /&gt;&lt;br /&gt;sample content of art.dat, you can get more from the mentioned web site or newsgroup&lt;br /&gt;(sample below taken from http://www.chris.com/ASCII/)&lt;br /&gt;----------&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$$$*" *$$$$$$$$$$$$$$$$$$$$$$$$$$$"  "*"   *$$$$$$" ^$$$"$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$" z$P"$$$$$$$$$$$$$$$$$$$$$$$$P  e$"e4$b.   "$$" d$ $P $$$$$$$$$$$$&lt;br /&gt;$$$$$$$" .$$$ J$$$$$$$$$$$$$$$$$$$$$$$" .$Pz$$4$$$$c  z" $$*" z$$$$$$$$$$$$$&lt;br /&gt;$$$$$$  4$$$$$$$$$$$$$$$$$$$$$$$$$$$P  z$$4$$%$$$$$$$d  "   z$$$$$$$$$$$$$$$&lt;br /&gt;$$$$P  z$$$* er$$$* ze$$P .$  $$  $F  d$$ $$Fz$$$$$$$  $$P$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$P  4$$$" $$F$$" $" $" z$% J$$$$F  d$$$ *"d$$$$$$$  $$Pd$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$  .$$$  $c* "  $$b$" z$P .$$$$P  4$$$$$$$$$$$$$$  d$Pd$$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$   $$$" 4$$%$  4$$$"  $$  $P$$$   $$$""$$$$$*"$$% 4$"$$P"*""$$$$$$$$$$$$$$&lt;br /&gt;$F  4$$$  $$Fd$  $$$"  $$  dPd$$"  $$" z$ $$" d$ $  $\$$  dP 4$$$$$$$$$$$$$$&lt;br /&gt;$   $$$F  *"d$F  $* r  *   "J$$$  .$% .$$.$" .$$J   d$$  $$  $$$$$$$$$$$$$$$&lt;br /&gt;$   $$$$  .$$$$   e$b  dL  $$$$F  J$  d$P$" d$e e  $$$  $$  $$$$$$$$$$$$$$$$&lt;br /&gt;$   $$$$$$$$$$$$$$$$$$$$$$$$$$$   $$d$$$.F .$$"$F 4$$  d$% J$J$$$$$$$$$$$$$$&lt;br /&gt;$L  "$$$$$$$$$$*"        "$$$$$   4$$$$ $  $$"d$  $$   $F  $.$$$$$$$$$$$$$$$&lt;br /&gt;$$c  ^*$$$*" .e$$$$$c       $$$L   "*".$$    d$$   z       .$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$e.   .e$$$$$$$$$$$z$$$$$$$$$$.  .d$$$c .$$$$c d$b .$c e$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$Gilo94'$$&lt;/pre&gt;&lt;br /&gt;%%%&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F                  "$$$P"               .P$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F                    ""                 4$e3$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F                                       4$$4$CeC$$$$$$$$$$&lt;br /&gt;$$$$$$$$F                                ....   4$$.$$$$^$$$$$$$$$&lt;br /&gt;$$$$$$$$F                           ...d$$$*"   4Pz$$$$\d$$$$$$$$$&lt;br /&gt;$$$$$$$$F                         d$$$$*"        d$$$5d$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F                      zd$$$$$ .ec     .$$$Pz$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F                   .e$$"  $$F $$$r    $$$"4$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F                  4$$"    3$$ *$$$   d$$\$4$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F                          4$$  *$$r d$$)$$4$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F               .          4$$   3$$$$$"4$$4$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F               $$.    .d  d$$    $$$$" 4$$4$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F               $$4$$cd$$  $$$    3$$$  4$$4$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F               $$4$$$$$$  $$$     """  4$$4$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F               $$4$$$$$$  4$$          4$$4$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F               $P4$$$$$$               4$$4$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$F               \d$$$$$$$               ')d$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&lt;br /&gt;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$Gilo94'$$&lt;/pre&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;After these two files are created in your unix home directory. Update your .profile or any startup script of your shell with&lt;br /&gt;&lt;br /&gt;perl &lt;your script="" name=""&gt;[your script filename] art.dat&lt;/your&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-116557861478174671?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/116557861478174671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=116557861478174671' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116557861478174671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116557861478174671'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/12/little-perl-script-to-spice-up-your.html' title='A little perl script to spice up your unix shell startup'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-116427172832426472</id><published>2006-11-23T00:48:00.000-08:00</published><updated>2007-05-03T05:16:24.806-07:00</updated><title type='text'>CTags and VIM</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:Arial,Helvetica,sans-serif;font-size:85%;"  &gt;Sample generate tags file command&lt;br /&gt;ctags -f {tag file location}&lt;tag&gt; --recurse --langmap=C++:.C.h.c.cpp.hpp --languages=C++ --extra=+q --fields=+i --verbose &lt;parent&gt;&lt;/parent&gt;&lt;/tag&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:Arial,Helvetica,sans-serif;font-size:85%;"  &gt;{source parent folder e.g. /usr/my_source/}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:Arial,Helvetica,sans-serif;font-size:85%;"  &gt;&lt;br /&gt;After tag file generated, add&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="272481510-08082005"&gt;set tags=&lt;tag&gt;{tag file location 1}, &lt;/tag&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span class="272481510-08082005"&gt;{tag file location 2}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span class="272481510-08082005"&gt;&lt;tag&gt;&lt;/tag&gt;&lt;/span&gt;&lt;span class="272481510-08082005"&gt;&lt;tag&gt;&lt;/tag&gt;&lt;/span&gt;&lt;span class="272481510-08082005"&gt; to .vimrc&lt;br /&gt;in VIM&lt;br /&gt;type&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span class="272481510-08082005"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;pre class="programlisting"&gt;:set tags=&lt;span class="272481510-08082005"&gt;&lt;tag&gt;&lt;/tag&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span class="272481510-08082005"&gt;&lt;tag&gt;{tag file location 1}, &lt;/tag&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span class="272481510-08082005"&gt;{tag file location 2}&lt;br /&gt;&lt;br /&gt;or add it to .vimrc&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="272481510-08082005"&gt;&lt;tag&gt;&lt;/tag&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;in VIM&lt;br /&gt;&lt;span class="272481510-08082005"&gt;&lt;br /&gt;&lt;br /&gt;For ultraedit, the ctag parameter is&lt;/span&gt;&lt;br /&gt;&lt;span class="272481510-08082005"&gt;-L %fi -f %fo --language-force=C++ --extra=+q --fields=+i&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="272481510-08082005"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If using VIM as editor, the supported commands are&lt;br /&gt;&lt;br /&gt;:ts - tag, class definition as priority&lt;br /&gt;:tj - tag (can use /pattern or /^pattern. Since it is pattern search, it is not binary search mode which would be slow)&lt;br /&gt;:po or ctrl + 't' - older tag search stack&lt;br /&gt;ctrl ']' on selected text to call tag search directly.&lt;br /&gt;:&lt;up&gt; or&lt;down&gt; to scroll for previous calls&lt;br /&gt;&lt;br /&gt;(refer http://www.vim.org/htmldoc/tagsrch.html )&lt;br /&gt;&lt;br /&gt;VIM commands which is useful when use in conjunction with ctags&lt;br /&gt;shift + * - start to search this word in the document&lt;br /&gt;shift + # - start to search this word in the document (backward order)&lt;br /&gt;n - continue to search forward the word&lt;br /&gt;shitf + n - continue to search backward for the word.&lt;br /&gt;:e - to reload the current document in VIM.&lt;br /&gt;/ (command mode) - to search for a word  (using regex  if supply) in forward order&lt;br /&gt;? (command mode) - to search for a  word (using regex if supply) in backward order.&lt;br /&gt;:file - to show current edit/view file in VIM&lt;br /&gt;ctrl + [ or ctrl ] or ctrl % - nagivate source files.&lt;br /&gt;:e &lt;filepath&gt; - to open another file as another page buffer in VIM.&lt;br /&gt;:E - to open another file using a file explorer of VIM&lt;br /&gt;:bn - move to next page buffer in VIM.&lt;br /&gt;:bp - &lt;/filepath&gt;&lt;/down&gt;move to previous page buffer in VIM.&lt;br /&gt;:bd - close current page buffer in VIM.&lt;br /&gt;:files - show all page buffer loaded in VIM.&lt;br /&gt;:%s/&lt;source&gt;/&lt;dest&gt;/g - to replace all the source string to destination string.&lt;br /&gt;&lt;br /&gt;&lt;up&gt;&lt;down&gt;&lt;br /&gt;If run Ctag from the shell, type vim -t {tag file}&lt;tag&gt; and then select which tag position to start edit with&lt;br /&gt;&lt;br /&gt;&lt;/tag&gt;&lt;/down&gt;&lt;/up&gt;&lt;/dest&gt;&lt;/source&gt;&lt;/up&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-116427172832426472?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/116427172832426472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=116427172832426472' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116427172832426472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116427172832426472'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/11/ctags-and-vim_23.html' title='CTags and VIM'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-116418640645692966</id><published>2006-11-22T01:00:00.000-08:00</published><updated>2006-11-23T01:06:03.746-08:00</updated><title type='text'>Operator overload</title><content type='html'>A a;&lt;br /&gt;&lt;br /&gt;if(a) &lt;--- this will trigger operator bool() and also operator void const*() const{&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;boost style&lt;br /&gt;(typedef T * (this_type::*unspecified_bool_type)() const;operator unspecified_bool_type() const // never throws{return px == 0? 0: &amp;this_type::get;})&lt;br /&gt;&lt;br /&gt;if (a == "ss") &lt;-- a combinations of few operator overload.&lt;br /&gt;&lt;br /&gt;Foo(std::string const&amp; s);&lt;br /&gt;Foo(std::string s);&lt;br /&gt;&lt;br /&gt;bool operator==(Foo const&amp; lhs, Foo const&amp;amp; rhs);&lt;br /&gt;&lt;br /&gt;For []&lt;br /&gt;&lt;br /&gt;int&amp; operator[] (unsigned i) { return data[i]; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class A&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;    enum enA { A1, A2, A3 };&lt;br /&gt;    A() { }&lt;br /&gt;    ~A() { }&lt;br /&gt;&lt;br /&gt;    operator A::enA() { return A2; }&lt;br /&gt;&lt;br /&gt;}; &lt;br /&gt;&lt;br /&gt;void Fn(A::enA e)&lt;br /&gt;{&lt;br /&gt;    std::cout &lt;&lt; "Fn(A::enA)\n";&lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;when &lt;br /&gt;A a;&lt;br /&gt;Fn(a); // Will call Fn(A::enA) due to overload of operator A::enA()&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-116418640645692966?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/116418640645692966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=116418640645692966' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116418640645692966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116418640645692966'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/11/operator-overload.html' title='Operator overload'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-116400645526838123</id><published>2006-11-19T22:51:00.000-08:00</published><updated>2006-11-19T23:07:35.376-08:00</updated><title type='text'>C++ Heap Corruption example</title><content type='html'>class A {&lt;br /&gt;&lt;br /&gt;A(int i)&lt;br /&gt;{&lt;br /&gt;text = (char *)malloc(sizeof (char *)) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;A()&lt;br /&gt;{&lt;br /&gt;text = (char *)malloc(sizeof (char *)) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;virtual ~A()&lt;br /&gt;{&lt;br /&gt;if(text != 0)&lt;br /&gt;{&lt;br /&gt;free(text);&lt;br /&gt;text = 0;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;    A a;&lt;br /&gt;    a = A(123);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-116400645526838123?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/116400645526838123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=116400645526838123' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116400645526838123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116400645526838123'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/11/c-heap-corruption-example.html' title='C++ Heap Corruption example'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-116400545604710040</id><published>2006-11-19T22:39:00.000-08:00</published><updated>2008-04-08T00:37:19.573-07:00</updated><title type='text'>Polymorphism or inheritance watch out</title><content type='html'>class B {&lt;br /&gt;char *str;&lt;br /&gt;B(){str = new char[100];}&lt;br /&gt;~B(){delete [] str;}&lt;br /&gt;};&lt;br /&gt;class D : public B {&lt;br /&gt;D(){}&lt;br /&gt;~D(){}&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;B* pB = new D;delete pB; // resource leak cause the base destructor (class B) wasn't call.&lt;br /&gt;&lt;br /&gt;Solution 1: The base class "MUST" declare destructor as virtual.&lt;br /&gt;e.g.&lt;br /&gt;&lt;br /&gt;virtual ~B(){delete [] str;}&lt;br /&gt;&lt;br /&gt;Solution 2: (a prevention mechanism to C++) By declaring class as final so that can't inherit the class. C++ itself does not have final, concept taken from Java.&lt;br /&gt;&lt;br /&gt;E.g. &lt;a href="http://www.codeproject.com/cpp/finalclass.asp"&gt;http://www.codeproject.com/cpp/finalclass.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;or use&lt;br /&gt;&lt;br /&gt;class __declspec(novtable) YourClassName&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-116400545604710040?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/116400545604710040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=116400545604710040' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116400545604710040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116400545604710040'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/11/polymorphism-or-inheritance-watch-out.html' title='Polymorphism or inheritance watch out'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-116296670002213918</id><published>2006-11-07T22:13:00.000-08:00</published><updated>2006-11-14T00:27:23.050-08:00</updated><title type='text'>Excel VBA</title><content type='html'>A macro I used to creat the hyperlinks to another sheet which is in sequence&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;Sub CreateLinks()&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Dim i, j, NoNeeded As Integer&lt;/p&gt;&lt;p&gt;i = 19 'copy source start row&lt;/p&gt;&lt;p&gt;j = 2 'copy destination start row&lt;/p&gt;&lt;p&gt;NoNeeded = 500 'number of links&lt;/p&gt;&lt;p&gt;Dim cellSelect As String&lt;/p&gt;&lt;p&gt;Dim cellTarget As String&lt;br /&gt;For j = 2 To NoNeeded&lt;/p&gt;&lt;p&gt;cellSelect = "A" &amp; CStr(j)&lt;/p&gt;&lt;p&gt;Range(cellSelect).Select&lt;/p&gt;&lt;p&gt;cellTarget = "!A" &amp;amp; CStr(i)&lt;br /&gt;ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:=_ "'UNKNOWN (1)'" &amp; cellTarget, TextToDisplay:="'UNKNOWN (1)'" &amp;amp; cellTarget&lt;/p&gt;&lt;p&gt;i = i + 1&lt;/p&gt;&lt;p&gt;Next j&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;End Sub&lt;/p&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-116296670002213918?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/116296670002213918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=116296670002213918' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116296670002213918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/116296670002213918'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/11/excel-vba.html' title='Excel VBA'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-115927191715587815</id><published>2006-09-26T04:56:00.000-07:00</published><updated>2006-11-21T22:02:26.126-08:00</updated><title type='text'>standard C++ OOP features (codes)</title><content type='html'>&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;#include&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; &lt;span style="color:maroon;"&gt;"stdafx.h"&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;#include &lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;&lt;span style="color:maroon;"&gt;cstdlib&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;#include&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; &lt;&lt;span style="color:maroon;"&gt;iostream&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:maroon;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;#define&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; OUT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;using&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; &lt;span style="color:blue;"&gt;namespace&lt;/span&gt; std;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; A&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;private&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;br /&gt;iMyNum;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;APrivateFunc()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;A()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;iMyNum = 100;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="Section1"&gt;friend ostream&amp; operator&lt;&lt;( ostream&amp;amp;, A&amp; ) ; &lt;/div&gt;&lt;div class="Section1"&gt;//made as friend function for performance reason&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;MyFunc()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;printf(&lt;span style="color:maroon;"&gt;"myfunct"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;ostream&amp;operator&lt;&lt;( ostream&amp;amp; o, A&amp; theObj ){  o &lt;&lt; "A" &lt;&lt; endl;       return o ;}&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; B : &lt;span style="color:blue;"&gt;private&lt;/span&gt; A&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;B():A()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt; iMyB;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt;&lt;br /&gt;A::MyFunc;&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//only for the&lt;br /&gt;member variables which already originaly &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//accessible but&lt;br /&gt;during inheris access specifier specify as private instead of public&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//using&lt;br /&gt;A::APrivateFunc; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//this is not&lt;br /&gt;valid APrivateFunc before that is a private function.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; A1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;protected&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt; iMyA1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 2;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;br /&gt;GetMyA1()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;span style="color:blue;"&gt;return&lt;/span&gt;&lt;br /&gt;iMyA1;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; B1:&lt;span style="color:blue;"&gt;public&lt;/span&gt; A1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt; iMyB1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;B1():A1()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;B1 &amp; &lt;span style="color:blue;"&gt;operator&lt;/span&gt;&lt;br /&gt;= (A1 &amp;amp;a1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;A1::iMyA1 = a1.GetMyA1();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 2;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt;&lt;br /&gt;*&lt;span style="color:blue;"&gt;this&lt;/span&gt;;&lt;span style="mso-tab-count: 1"&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:green;"  &gt;&lt;span style="font-size:85%;"&gt;//&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;o (based)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:green;"  &gt;&lt;span style="font-size:85%;"&gt;//&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;/\&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:green;"  &gt;&lt;span style="font-size:85%;"&gt;//&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;o&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;o (derived)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:green;"  &gt;&lt;span style="font-size:85%;"&gt;//&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;\&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:green;"  &gt;&lt;span style="font-size:85%;"&gt;//&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;o&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;(grandchild)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:green;"  &gt;&lt;span style="font-size:85%;"&gt;//hybrid inheritance base class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; Base&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;int&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; iMyBased;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;Base()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;Base(&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;br /&gt;i)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{iMyBased = i;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;MyBased(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;cout &amp;lt;&amp;lt; &lt;span style="color:maroon;"&gt;"MyBased"&lt;/span&gt; ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:green;"  &gt;&lt;span style="font-size:85%;"&gt;//virtual base class to solve hybrid inheritance problem when calling&lt;br /&gt;common based function&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:blue;"   &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt; DerivedA :&lt;br /&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;virtual&lt;/span&gt; Base&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;DerivedFunc()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;DerivedA()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;DerivedA(&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;br /&gt;i):Base(i)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:blue;"   &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt; DerivedB :&lt;br /&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;virtual&lt;/span&gt; Base&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;DerivedFunc()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;DerivedB()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;DerivedB(&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;br /&gt;i):Base(i)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:blue;"   &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;GrandChild&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;: &lt;span style="color:blue;"&gt;public&lt;/span&gt;&lt;br /&gt;DerivedA, &lt;span style="color:blue;"&gt;public&lt;/span&gt; DerivedB&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;GrandChild():DerivedB(), DerivedA()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//GrandChild(int&lt;br /&gt;i):DerivedB(i), DerivedA(i) //the problem is that if the base class is virtual,&lt;br /&gt;only the default base class constructor will be called.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//{}&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;i.e&lt;br /&gt;- the Base(int i) will not be called eventhough the constructor had instructed&lt;br /&gt;to do so.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;GrandChild(&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;br /&gt;i):Base(i), DerivedB(i), DerivedA(i) &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//to solve the&lt;br /&gt;problem above&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;MyCall()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;Base::MyBased();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; String &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-spacerun: yes;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;private&lt;/span&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;char&lt;/span&gt;&lt;br /&gt;*Strng;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-spacerun: yes;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-spacerun: yes;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;GetData()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;cout &amp;lt;&amp;lt; &lt;span style="color:maroon;"&gt;"Type the data\n"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;Strng = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:blue;"&gt;char&lt;/span&gt;[15];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;cin &amp;gt;&amp;gt; Strng;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-spacerun: yes;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;ShowData()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;cout &amp;lt;&amp;lt; Strng &amp;lt;&amp;lt; &lt;span style="color:maroon;"&gt;"\n"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-spacerun: yes;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-spacerun: yes;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-spacerun: yes;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-spacerun: yes;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;String &amp;&lt;span style="color:blue;"&gt;operator&lt;/span&gt; = (String &amp;amp;Strn)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;printf(&lt;span style="color:maroon;"&gt;"operator assignment"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;br /&gt;Len = strlen(Strn.Strng);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;Strng = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:blue;"&gt;char&lt;/span&gt;[Len + 1];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;strcpy(Strng,&lt;br /&gt;Strn.Strng);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt;&lt;br /&gt;*&lt;span style="color:blue;"&gt;this&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-spacerun: yes;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;String(){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;String (&lt;span style="color:blue;"&gt;const&lt;/span&gt;&lt;br /&gt;String &amp;Strn)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 4"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;printf(&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:maroon;"&gt;"copy&lt;br /&gt;const"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 5"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt; Len = strlen(Strn.Strng);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;Strng = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:blue;"&gt;char&lt;/span&gt;[Len + 1];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;strcpy(Strng,&lt;br /&gt;Strn.Strng);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;explicit&lt;/span&gt; String(&lt;span style="color:blue;"&gt;char&lt;/span&gt;&lt;br /&gt;*psz)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;/span&gt;printf(&lt;span style="color:maroon;"&gt;"explicit cast"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;br /&gt;Len = strlen(psz);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;Strng = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:blue;"&gt;char&lt;/span&gt;[Len + 1];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;strcpy(Strng, psz);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;operator&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;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 2;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;br /&gt;&lt;/span&gt;printf(&lt;span style="color:maroon;"&gt;"operator typename"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 2;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt; Strng;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;~String()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;delete&lt;/span&gt;&lt;br /&gt;[] Strng;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-spacerun: yes;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; Host&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;private&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt; iMyID;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;Host()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;Host(&lt;span style="color:blue;"&gt;const&lt;/span&gt;&lt;br /&gt;Host&amp;){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;Host &amp;amp; &lt;span style="color:blue;"&gt;operator&lt;/span&gt;&lt;br /&gt;= (Host &amp;h){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;friend&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; Parasite; &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//establish&lt;br /&gt;friend relationship&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; Parasite&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;private&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt; iMyID;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;friend&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; accessParasite(OUT Parasite &amp;p, &lt;span style="color:blue;"&gt;int&lt;/span&gt; ID); &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//this allow non&lt;br /&gt;member or member of class to be able to access private data members.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;Parasite(){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;SetHostID(OUT Host &amp;h, &lt;span style="color:blue;"&gt;int&lt;/span&gt; ID){h.iMyID =&lt;br /&gt;ID;} &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//this become possible if Parasite become Host&lt;br /&gt;friend class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:blue;"   &gt;void&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;accessParasite(OUT Parasite &amp;p, &lt;span style="color:blue;"&gt;int&lt;/span&gt; ID)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;p.iMyID = ID;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; v1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:green;"&gt;/*v1(){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:green;"  &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;~v1(){}*/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//when a class&lt;br /&gt;definition contain a pure virtual that definition undefined, that mean it is a&lt;br /&gt;abstract class, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//meaning it can&lt;br /&gt;not be instantiated. If inheritted class do not define the definition of that&lt;br /&gt;parent virtual&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//function, the&lt;br /&gt;inheritted class also become abstract.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//pure virtual&lt;br /&gt;save from having to write definition into function. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//__declspec(novtable)&lt;br /&gt;for VC++ can be use as it save storage for each of the inheritted object&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;virtual&lt;/span&gt; &lt;span style="color:blue;"&gt;char&lt;/span&gt;* myPVirtual() &lt;span style="color:blue;"&gt;const&lt;/span&gt;&lt;br /&gt;=0; &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//the const mean the function can not modify the&lt;br /&gt;member variable&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;virtual&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; myV1(){cout &amp;lt;&amp;lt; &lt;span style="color:maroon;"&gt;"v1-myV1"&lt;/span&gt;&amp;lt;&amp;lt;&lt;br /&gt;endl;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;myNonVirtual(){cout &amp;lt;&amp;lt; &lt;span style="color:maroon;"&gt;"v1-myNonVirtual"&lt;/span&gt;&lt;br /&gt;&amp;lt;&amp;lt; endl;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; dv1: &lt;span style="color:blue;"&gt;public&lt;/span&gt; v1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;dv1():v1(){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;~dv1(){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;virtual&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;char&lt;/span&gt;*&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;br /&gt;&lt;/span&gt;myPVirtual() &lt;span style="color:blue;"&gt;const&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;/span&gt;printf(&lt;span style="color:maroon;"&gt;"myMyVirtual"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt;&lt;br /&gt;NULL;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;virtual&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt; myV1(){cout &amp;lt;&amp;lt; &lt;span style="color:maroon;"&gt;"dv1-myV1"&lt;/span&gt;&amp;lt;&amp;lt; endl;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;myNonVirtual(){cout &amp;lt;&amp;lt; &lt;span style="color:maroon;"&gt;"dv1-myNonVirtual"&lt;/span&gt;&lt;br /&gt;&amp;lt;&amp;lt; endl;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 2;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; dv2: &lt;span style="color:blue;"&gt;public&lt;/span&gt; v1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;dv2():v1(){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;~dv2(){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;virtual&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;char&lt;/span&gt;*&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;br /&gt;&lt;/span&gt;myPVirtual() &lt;span style="color:blue;"&gt;const&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;/span&gt;printf(&lt;span style="color:maroon;"&gt;"myMyVirtual"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt;&lt;br /&gt;NULL;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;myV1(){cout &amp;lt;&amp;lt; &lt;span style="color:maroon;"&gt;"dv2-myV1"&lt;/span&gt;&amp;lt;&amp;lt;&lt;br /&gt;endl;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;myNonVirtual(){cout &amp;lt;&amp;lt; &lt;span style="color:maroon;"&gt;"dv2-myNonVirtual"&lt;/span&gt;&lt;br /&gt;&amp;lt;&amp;lt; endl;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 2;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; dv2d:&lt;span style="color:blue;"&gt;public&lt;/span&gt; dv2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;br /&gt;myV1(){cout &amp;lt;&amp;lt; &lt;span style="color:maroon;"&gt;"dv2d-myV1"&lt;/span&gt;&amp;lt;&amp;lt;&lt;br /&gt;endl;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:blue;"   &gt;int&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt; main(&lt;span style="color:blue;"&gt;int&lt;/span&gt; argc, &lt;span style="color:blue;"&gt;char&lt;/span&gt;&lt;br /&gt;*argv[])&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;String str1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;str1.GetData();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;str1.ShowData();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;String str2(str1); &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//copy&lt;br /&gt;constructor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;String str3 = str2; &lt;span style="color:green;"&gt;//copy constructor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;String str4;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;str4 = str3; &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//operator&lt;br /&gt;= called&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;str2.ShowData();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;str2.GetData();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;str1.ShowData();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;String str5;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;char&lt;/span&gt;&lt;br /&gt;*pszTest = &lt;span style="color:maroon;"&gt;"hello"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;str5 = String(pszTest); &lt;span style="color:green;"&gt;//explicit cast called&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-spacerun: yes;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;String str6;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;str6 = (String)pszTest; &lt;span style="color:green;"&gt;//explicit cast called&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;char&lt;/span&gt;&lt;br /&gt;*pCheck = (&lt;span style="color:blue;"&gt;char&lt;/span&gt;*)str1; &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//operator&lt;br /&gt;typename called (it works like text sub internally.)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;cout &amp;lt;&amp;lt; pCheck;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;A1 *a;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;B1 b;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;b.iMyB1 = 1000;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;a = &amp;amp;b;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;B1 *b2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;b2 = (B1*)a; &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//this&lt;br /&gt;will still be able to get the retained value.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;printf(&lt;span style="color:maroon;"&gt;"%d"&lt;/span&gt;,&lt;br /&gt;b2-&amp;gt;iMyB1); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;A1 aa;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:green;"&gt;/*B1 b3;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:green;"  &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;b3 =&lt;br /&gt;reinterpret_cast&amp;lt;B1&amp;gt;(*a);*/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;B1 b3;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;b3.iMyB1 = 123;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;aa = b3; &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//from&lt;br /&gt;derived to base, can&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;B1 b4;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;b4 = aa; &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//from&lt;br /&gt;base to derived, need conversion function for the B1 assignment operator or&lt;br /&gt;copy construtor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;GrandChild oo;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;oo.MyCall();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;oo.MyBased(); &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//this&lt;br /&gt;will prompt error if not using virtual base class, in the code write&lt;br /&gt;"virtual public classname" as inherit access modifier&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;oo.DerivedA::DerivedFunc(); &lt;span style="color:green;"&gt;//this will resolve ambiguity problem.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; &lt;span style="color:maroon;"&gt;"----------------"&lt;/span&gt; &amp;lt;&amp;lt; endl ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;v1 *v;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;dv1 dv_1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;dv2 dv_2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;v = &amp;amp;dv_1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;v-&amp;gt;myV1(); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;v-&amp;gt;myNonVirtual(); &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//non virtual will not be able to make the function call to&lt;br /&gt;be based on the &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 6;font-size:85%;" &gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//the real class it points to. (meaning, polymophism needs&lt;br /&gt;virtual function.)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;v = &amp;amp;dv_2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;v-&amp;gt;myV1();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;v-&amp;gt;myNonVirtual();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;dv2d dv_2d;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;dv2 *pDV2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;pDV2&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;br /&gt;&lt;/span&gt;=&amp;amp;dv_2d;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;pDV2-&amp;gt;myV1(); &lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//eventhough&lt;br /&gt;the dv2 does not declare the myV1 as virtual anymore but only its parent, but&lt;br /&gt;the derived &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//child&lt;br /&gt;still be able to make the function call to be based on the &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 4"&gt;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;span style="font-size:85%;"&gt;//the real class it&lt;br /&gt;points to. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:green;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;cout &amp;lt;&amp;lt; &lt;span style="color:maroon;"&gt;"----------------"&lt;/span&gt;&lt;br /&gt;&amp;lt;&amp;lt; endl;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;system(&lt;span style="color:maroon;"&gt;"PAUSE"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt;&lt;br /&gt;EXIT_SUCCESS;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:green;"  &gt;&lt;span style="font-size:85%;"&gt;//composite relationship&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:blue;"   &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;CompositeOrContained &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;CompositeOrContained(){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;CompositeOrContained(&lt;span style="color:blue;"&gt;int&lt;/span&gt; i){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:blue;"   &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;ContainerOrComposed&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;CompositeOrContained m_o;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;ContainerOrComposed(){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;ContainerOrComposed(&lt;span style="color:blue;"&gt;int&lt;/span&gt; i):m_o(i)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:green;"  &gt;&lt;span style="font-size:85%;"&gt;//associative relationship&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:blue;"   &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Associated;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:blue;"   &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Associating&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;Associated *pA;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1;font-size:85%;" &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; Associated&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;Associated(){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;~Associated(){}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:green;"  &gt;&lt;span style="font-size:85%;"&gt;//associative with custody relationship&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;color:blue;"   &gt;class&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;AssociatingWithCustody&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;public&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;Associated *pA;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;AssociatingWithCustody(){pA = &lt;span style="color:blue;"&gt;new&lt;/span&gt; Associated();}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;~AssociatingWithCustody(){&lt;span style="color:blue;"&gt;delete&lt;/span&gt; pA;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="font-size:85%;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';font-size:85%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="Section1"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class="Section1"&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/9937599-115927191715587815?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/115927191715587815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=115927191715587815' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/115927191715587815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/115927191715587815'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/09/standard-c-oop-features-codes.html' title='standard C++ OOP features (codes)'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-115078546313344692</id><published>2006-06-19T23:18:00.000-07:00</published><updated>2006-09-26T04:55:45.016-07:00</updated><title type='text'>TLS (Thread Local Storage) sample code</title><content type='html'>This will spawn multiple threads and each thread will access itTLS, including the main thread itself will access its own TLS.&lt;br /&gt;&lt;br /&gt;The code will not deallocate the memory in the heap which initially allocated in the thread. The reason is to able to show the content of the TLS and each TLS is localized to each thread.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;#include &amp;lt;Windows.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;#include &amp;lt;process.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;static DWORD dwTlsIndex; // address of shared memory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;void func(LPVOID);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;int main(int argc, char* argv[])&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    if ((dwTlsIndex = TlsAlloc()) == 0xFFFFFFFF) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;                return FALSE; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    //main thread&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    LPSTR lpszTemp = new char[10];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    strcpy(lpszTemp, "main thread");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;     TlsSetValue(dwTlsIndex, (LPVOID)lpszTemp); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    for(int k = 0; k &amp;lt; 10; k++)&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;_beginthread(func, 0, NULL); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;     LPCTSTR pCheck = (LPCTSTR)TlsGetValue(dwTlsIndex); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;     printf("Main: %s\n", pCheck);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;      TlsFree(dwTlsIndex); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    return 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;void func(LPVOID)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;     char *lpszData;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;     lpszData = new char[10];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;     sprintf(lpszData, "%d", GetCurrentThreadId());&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    LPCSTR lpcszCheck = (LPCTSTR)TlsGetValue(dwTlsIndex); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    printf("Prev: %s\n", lpcszCheck);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;   TlsSetValue(dwTlsIndex, (LPVOID)lpszData); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;   lpcszCheck = (LPCTSTR)TlsGetValue(dwTlsIndex); &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;   printf("Current: %s\n", lpcszCheck);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &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/9937599-115078546313344692?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/115078546313344692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=115078546313344692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/115078546313344692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/115078546313344692'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/06/tls-thread-local-storage-sample-code.html' title='TLS (Thread Local Storage) sample code'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-114985017098836096</id><published>2006-06-09T03:41:00.000-07:00</published><updated>2006-06-09T03:49:31.006-07:00</updated><title type='text'>My frequently used Visual Studio.NET 2003 IDE Commands</title><content type='html'>I do not know about others but these are commands that I would definitely want it to be customized for my preference.&lt;br /&gt;&lt;br /&gt;Edit.ToggleTaskListShortCut&lt;br /&gt;Edit.GotoNextLocation&lt;br /&gt;Edit.GotoPreviousLocation&lt;br /&gt;Edit.ToggleBookMark&lt;br /&gt;Edit.NextBookMark&lt;br /&gt;Edit.PreviousBookMark&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-114985017098836096?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/114985017098836096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=114985017098836096' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/114985017098836096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/114985017098836096'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/06/my-frequently-used-visual-studionet.html' title='My frequently used Visual Studio.NET 2003 IDE Commands'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-114826924293997965</id><published>2006-05-21T20:36:00.000-07:00</published><updated>2006-05-21T20:43:02.213-07:00</updated><title type='text'>Windows Script to search for a file in all the drives</title><content type='html'>&lt;span style="color: rgb(0, 0, 153);font-size:85%;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Script below will search for a file in all drives(excluding network mapped drive)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;'filename to search for&lt;br /&gt;filename="test.txt"&lt;br /&gt;&lt;br /&gt;On Error Resume Next&lt;br /&gt;strComputer = "."&lt;br /&gt;Set objWMIService = GetObject("winmgmts:\\" &amp; strComputer &amp;amp; "\root\cimv2")&lt;br /&gt;Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk",,48)&lt;br /&gt;For Each objItem in colItems&lt;br /&gt;&lt;br /&gt;     Set fs = CreateObject("Scripting.FileSystemObject")&lt;br /&gt;    Set folder = fs.GetFolder(objItem.Caption)&lt;br /&gt;    fList(folder)&lt;br /&gt;&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sub fList(folderObj)&lt;br /&gt;for each file in folderObj.Files&lt;br /&gt;if file.name=filename then&lt;br /&gt;  Wscript.Echo "File found at" &amp;amp; file.Path&lt;br /&gt; exit for&lt;br /&gt;end if&lt;br /&gt;next&lt;br /&gt;for each folder in folderObj.subfolders&lt;br /&gt;fList(folder)&lt;br /&gt;next&lt;br /&gt;end sub &lt;/blockquote&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-114826924293997965?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/114826924293997965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=114826924293997965' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/114826924293997965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/114826924293997965'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/05/windows-script-to-search-for-file-in.html' title='Windows Script to search for a file in all the drives'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-113991662497895196</id><published>2006-02-14T03:15:00.000-08:00</published><updated>2006-02-14T20:39:41.766-08:00</updated><title type='text'>Using DrWatson log to debug</title><content type='html'>- If lately application crash. DrWatson will record it and place the info to a log file.(newer version Windows should have it). Type drwtsn32 or drwatson&lt;br /&gt;- Then, open the log. Look for Fault-&gt;&lt;br /&gt;- Start vadump and type&lt;br /&gt;vadump -v -p 1160 |more&lt;br /&gt;&lt;br /&gt;-p = is the process ID. (get it from task manager)&lt;br /&gt;&lt;br /&gt;in the crashed PC&lt;br /&gt;to get the memory address of the environment.&lt;br /&gt;&lt;br /&gt;- If confirm involved module are related to your application.&lt;br /&gt;- Get the pdb file (debug info) file of the related module. (even for release mode module, you can rebuild it and checked the generate debug info. It will still be able to load some additional info without the expense of address changes a lot cause the compiled release module with debug info size is identical to one without)&lt;br /&gt;- Debug the process using IDE - Attach to process.&lt;br /&gt;- The DrWatson should contain offset from the loaded module to the crash location.&lt;br /&gt;Makesure IDE set to read the debug info to ease in reading the crash location in response to real source. If the IDE is super enough to be able load the complete source code. It would even greater. (tough luck so far on the IDE I know off that able to load the complete source code on release mode module) Anyway, given the name appear if any in the disassembly is already good enough. (The prefered IDE would be V.S.NET 2003, more setting during debug process. VS6 too primitive)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-113991662497895196?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/113991662497895196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=113991662497895196' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/113991662497895196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/113991662497895196'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/02/using-drwatson-log-to-debug.html' title='Using DrWatson log to debug'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-113833413289448164</id><published>2006-01-26T19:53:00.000-08:00</published><updated>2006-01-26T19:55:32.913-08:00</updated><title type='text'>Outlook - IMAP Sent Items folder not keeping the sent items</title><content type='html'>&lt;span style="font-size:85%;"&gt;If you are familiar with Outlook Express, you will notice  that everytime if you are using the IMAP account to send out the email, the sent  emails will automatically be copied one copy into "Sent Items" IMAP folder.  But, if you switch to Outlook, regardless of Outlook 2000, 2002, 2003 and etc.  The sent email will never be copied into the IMAP sent items folder but instead  only into the local sent items folder.  &lt;/span&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;    Anyway, there is a way to overcome this problem (courtesy  of Lee Ta Nen). By using the Outlook rules to imitate the effect. &lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;&lt;u&gt;Steps&lt;/u&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;1. Goto menu, Tools - Rules and Alerts&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt; 2. Click "New Rules ..." button&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;3. In the Rules Wizard - choose "Start from a blank  rule"&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;4. In "Select when message should be checked", select "Check  messages after sending"&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;5. Click "Next" button &lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;6. Then, in the next page, choose "uses the form name from"  and tick it. &lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;7. Then, in the "Edit the rule description" click on the "form  name" hyperlink.&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;8. Then, in the "Choose Form" dialog box, select "Application  Form" in the combo box, and then, select "Message" in the list box and click  "Add -&gt;" button.&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;9. Then click "Close" button in the "Choose Form" dialog box.  &lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;10. Then click "Next" button&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;11. Then in the next Rules Wizard page, in "What do you want  to do with the message?" - "Select action(s)", tick "move a copy to a specified  folder". &lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;12. In the Edit Rule Description, click on "specified"  hyperlink, and then it will pop a dialog box for choosing the folder. Choose the  IMAP sent items folder and press ok. &lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;13. Then, click "Next" two times.&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt;14. Click "Finish" button. &lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-size:85%;"&gt; &lt;p class="MsoNormal"&gt;If you have set up the above rule you may want to stop  Outlook automatically copying your sent messages to your local Outlook Sent  Items folder as well as the IMAP Sent folder. To do this:&lt;/p&gt; &lt;p class="MsoNormal"&gt;1. Choose Tools &gt; Options&lt;br /&gt;2. Click on the Preferences  tab, then E-mail Options&lt;br /&gt;3. Uncheck the Save copies of messages in the Sent  Items folder box.&lt;br /&gt;4. Press OK&lt;br /&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt; &lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-113833413289448164?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/113833413289448164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=113833413289448164' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/113833413289448164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/113833413289448164'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/01/outlook-imap-sent-items-folder-not.html' title='Outlook - IMAP Sent Items folder not keeping the sent items'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-113679567686710295</id><published>2006-01-09T00:21:00.000-08:00</published><updated>2008-03-11T01:14:06.531-07:00</updated><title type='text'>.NET GDI+ Simple Image Operations</title><content type='html'>&lt;span style="font-size:85%;"&gt;(In C#)&lt;br /&gt;&lt;br /&gt;System.Drawing.Graphics g;&lt;br /&gt;&lt;br /&gt;bmpOriginal = new Bitmap("C:\\myImage.gif");&lt;br /&gt;&lt;br /&gt;            int nNewWidth = 2 * &lt;/span&gt;&lt;span style="font-size:85%;"&gt;bmpOriginal &lt;/span&gt;&lt;span style="font-size:85%;"&gt;.Width;     //suppose resize 200%&lt;br /&gt;            int nNewHeight =  2 * &lt;/span&gt;&lt;span style="font-size:85%;"&gt;bmpOriginal &lt;/span&gt;&lt;span style="font-size:85%;"&gt;.Height;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            System.Drawing.Bitmap bmpModified = new Bitmap(nNewWidth, nNewHeight);&lt;br /&gt;            g = Graphics.FromImage(&lt;/span&gt;&lt;span style="font-size:85%;"&gt;bmpModified &lt;/span&gt;&lt;span style="font-size:85%;"&gt;);&lt;br /&gt;&lt;br /&gt;RectangleF rectDest =new RectangleF(&lt;br /&gt;                                0,&lt;br /&gt;                                0,&lt;br /&gt;                                nNewWidth,&lt;br /&gt;                                nNewHeight);&lt;br /&gt;&lt;br /&gt;          &lt;br /&gt;            RectangleF rectSource = new RectangleF(0, 0, &lt;/span&gt;&lt;span style="font-size:85%;"&gt;bmpOriginal&lt;/span&gt;&lt;span style="font-size:85%;"&gt;.Width, &lt;/span&gt;&lt;span style="font-size:85%;"&gt;bmpOriginal&lt;/span&gt;&lt;span style="font-size:85%;"&gt;.Height);&lt;br /&gt;            g.DrawImage(&lt;br /&gt;                &lt;/span&gt;&lt;span style="font-size:85%;"&gt;bmpOriginal &lt;/span&gt;&lt;span style="font-size:85%;"&gt;,&lt;br /&gt;                rectDest,&lt;br /&gt;                rectSource ,&lt;br /&gt;                GraphicsUnit.Pixel);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;           &lt;br /&gt;            bmpModified .Save("C:\\myNewImage.gif", System.Drawing.Imaging.ImageFormat.Gif);&lt;br /&gt;&lt;br /&gt;            g.Dispose();&lt;br /&gt;            g = null; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-113679567686710295?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/113679567686710295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=113679567686710295' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/113679567686710295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/113679567686710295'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2006/01/net-gdi-simple-image-operations.html' title='.NET GDI+ Simple Image Operations'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-113072610880883228</id><published>2005-10-30T18:31:00.000-08:00</published><updated>2005-10-30T18:35:08.826-08:00</updated><title type='text'>Reflection API to access COM objects sample</title><content type='html'>&lt;span class="messagecontent"&gt;&lt;code&gt;quoted from &lt;a href="http://www.codeproject.com/csharp/MODI.asp#xx1255521xx"&gt;URL&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Object o;&lt;br /&gt;     System.Type t = Type.GetTypeFromProgID("MODI.Document");&lt;br /&gt;     o = System.Activator.CreateInstance(t);&lt;br /&gt;&lt;br /&gt;     Object[] a = new Object[1];&lt;br /&gt;     a[0] = "C:\\Temp\\iri36300.TIF";&lt;br /&gt;&lt;br /&gt;     t.InvokeMember("Create", BindingFlags.InvokeMethod, null, o, a);&lt;br /&gt;     Object images = t.InvokeMember( "Images", BindingFlags.GetProperty, null, o, new Object[] {} );&lt;br /&gt;     Type imagesType = images.GetType();&lt;br /&gt;     Object item = imagesType.InvokeMember( "Item", BindingFlags.GetProperty, null, images, new Object[] {"0"} );&lt;br /&gt;     Type itemType = item.GetType();&lt;br /&gt;     itemType.InvokeMember("OCR", BindingFlags.InvokeMethod, null, item, new Object[] { 9 } );&lt;br /&gt;     Object layout = itemType.InvokeMember("Layout", BindingFlags.GetProperty, null, item, new Object[] {} );&lt;br /&gt;     Type layoutType = layout.GetType();&lt;br /&gt;     Object ocrResult = layoutType.InvokeMember( "Text", BindingFlags.GetProperty, null, layout, new Object[] {} );&lt;/code&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-113072610880883228?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/113072610880883228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=113072610880883228' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/113072610880883228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/113072610880883228'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/10/reflection-api-to-access-com-objects.html' title='Reflection API to access COM objects sample'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-113031376954297899</id><published>2005-10-26T00:56:00.000-07:00</published><updated>2005-10-27T01:32:58.053-07:00</updated><title type='text'>Locating MAPI directory using FGetComponentPath</title><content type='html'>Codes below quoted from&lt;br /&gt;&lt;a href="http://peach.ease.lsoft.com/scripts/wa.exe?A2=ind9908&amp;L=mapi-l&amp;amp;amp;T=0&amp;F=&amp;amp;S=&amp;P=6227"&gt;URL&lt;/a&gt;&lt;br /&gt;By Sam Charchian&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:arial;font-size:85%;"  &gt;typedef BOOL (STDAPICALLTYPE FGETCOMPONENTPATH)&lt;br /&gt;       (LPSTR szComponent,&lt;br /&gt;       LPSTR szQualifier,&lt;br /&gt;       LPSTR szDllPath,&lt;br /&gt;       DWORD cchBufferSize,&lt;br /&gt;       BOOL fInstall);&lt;br /&gt;typedef FGETCOMPONENTPATH FAR * LPFGETCOMPONENTPATH;&lt;br /&gt;&lt;br /&gt;static TCHAR s_szMSIApplicationLCID[] =&lt;br /&gt;       "Microsoft\\Office\\9.0\\Outlook\0LastUILanguage\0";    // STRING_OK&lt;br /&gt;static TCHAR s_szMSIOfficeLCID[] =&lt;br /&gt;&lt;br /&gt;"Microsoft\\Office\\9.0\\Common\\LanguageResources\0UILanguage\0InstallLangu&lt;br /&gt;age\0";         // STRING_OK&lt;br /&gt;&lt;br /&gt;////////////////////////////////////////////////////////////////////////////&lt;br /&gt;///&lt;br /&gt;// Function name        : CSVCFile::InitMAPIDir&lt;br /&gt;// Description      : For Outlook 2000 compliance.  This will get the&lt;br /&gt;correct path to the&lt;br /&gt;//                                      :       MAPISVC.INF file.&lt;br /&gt;// Return type          : void&lt;br /&gt;// Argument         : LPSTR szMAPIDir - Buffer to hold the path to the&lt;br /&gt;MAPISVC file.&lt;br /&gt;void CSVCFile::InitMAPIDir(LPTSTR szMAPIDir)&lt;br /&gt;{&lt;br /&gt;       HINSTANCE hinstStub = NULL;&lt;br /&gt;&lt;br /&gt;       // Call common code in mapistub.dll&lt;br /&gt;       hinstStub = LoadLibrary("mapistub.dll");&lt;br /&gt;       if (!hinstStub)&lt;br /&gt;       {&lt;br /&gt;               // Try stub mapi32.dll if mapistub.dll missing&lt;br /&gt;               hinstStub = LoadLibrary("mapi32.dll");&lt;br /&gt;               if (!hinstStub)&lt;br /&gt;                       goto Done;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       LPFGETCOMPONENTPATH pfnFGetComponentPath;&lt;br /&gt;&lt;br /&gt;       pfnFGetComponentPath = (LPFGETCOMPONENTPATH)&lt;br /&gt;               GetProcAddress(hinstStub, "FGetComponentPath");&lt;br /&gt;&lt;br /&gt;       if (!pfnFGetComponentPath)&lt;br /&gt;               goto Done;&lt;br /&gt;&lt;br /&gt;       if ((pfnFGetComponentPath("{FF1D0740-D227-11D1-A4B0-006008AF820E}",&lt;br /&gt;                       s_szMSIApplicationLCID, szMAPIDir, MAX_PATH, TRUE)&lt;br /&gt;||&lt;br /&gt;&lt;br /&gt;pfnFGetComponentPath("{FF1D0740-D227-11D1-A4B0-006008AF820E}",&lt;br /&gt;                       s_szMSIOfficeLCID, szMAPIDir, MAX_PATH, TRUE) ||&lt;br /&gt;&lt;br /&gt;pfnFGetComponentPath("{FF1D0740-D227-11D1-A4B0-006008AF820E}",&lt;br /&gt;                       NULL, szMAPIDir, MAX_PATH, TRUE)) &amp;&amp;amp;&lt;br /&gt;                       szMAPIDir[0] != '\0')&lt;br /&gt;       {&lt;br /&gt;               szMAPIDir[lstrlen(szMAPIDir) - 13] = 0; // Strip&lt;br /&gt;"\msmapi32.dll"&lt;br /&gt;       }&lt;br /&gt;       else&lt;br /&gt;       {&lt;br /&gt;               szMAPIDir[0] = '\0';    // Terminate String at pos 0.&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;Done:&lt;br /&gt;&lt;br /&gt;       if (hinstStub)&lt;br /&gt;               FreeLibrary(hinstStub);&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Another reference available in&lt;br /&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/229700"&gt;http://support.microsoft.com/kb/229700&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;(In Delphi by Dmitry Streblechenko)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.tech-archive.net/Archive/Development/microsoft.public.win32.programmer.messaging/2004-10/0359.html"&gt;URL&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-113031376954297899?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/113031376954297899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=113031376954297899' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/113031376954297899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/113031376954297899'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/10/locating-mapi-directory-using.html' title='Locating MAPI directory using FGetComponentPath'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-111638631645945280</id><published>2005-05-17T20:16:00.000-07:00</published><updated>2005-05-17T20:21:17.470-07:00</updated><title type='text'>Troubleshooting Outlook Express (IMAP, POP3, HTTP, NEWS) with the log file</title><content type='html'>Just happen to know this when trying to solve my friend OE problem. &lt;br /&gt;&lt;br /&gt;You can log in POP3, IMAP, NEWS, HTTP commands of your Outlook Express into a log file.  (note, the password in the log file is encrypted by Microsoft, therefore, it is safe to ask user to send the log file over if you are a IT support)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To enable logging.&lt;br /&gt;-------------------------&lt;br /&gt;&lt;br /&gt;Tools(menu) - Options (menu) - Maintenance(menu)  - check on the protocol you need. (POP3, IMAP, NEWS or HTTP) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To view the log file&lt;br /&gt;--------------------------&lt;br /&gt;&lt;br /&gt;Goto path&lt;br /&gt;&lt;br /&gt;C:\Documents and Settings\YourUserName\Local Settings\Application Data\Identities\{8D32DF8B-D3B8-4783-A0C5-FE37E2FC8659}\Microsoft\Outlook Express\pop3.log  (for pop3)&lt;br /&gt;&lt;br /&gt;imap.log for (imap)&lt;br /&gt;and other respectively. &lt;br /&gt;&lt;br /&gt;P.S. The {8D32DF8B-D3B8-4783-A0C5-FE37E2FC8659} may vary and there could be a few Identities in it. Look for the folder with the structure of *.dbx similar to your Outlook Express email account.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-111638631645945280?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/111638631645945280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=111638631645945280' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/111638631645945280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/111638631645945280'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/05/troubleshooting-outlook-express-imap.html' title='Troubleshooting Outlook Express (IMAP, POP3, HTTP, NEWS) with the log file'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-111587216640120662</id><published>2005-05-11T21:22:00.000-07:00</published><updated>2005-10-27T01:34:31.000-07:00</updated><title type='text'>Steps to set up VS.NET 2003 remote debugger</title><content type='html'>(quoted from http://www.codecomments.com/archive370-2005-2-396392.html)&lt;br /&gt;&lt;br /&gt;msvcmon ( Visual C++ .NET 2003 ) on Windows 9x/NT 4.0/2k/XP.&lt;br /&gt;&lt;br /&gt;Steps to set up&lt;br /&gt;the remote debugger&lt;br /&gt;&lt;br /&gt;1. copy msvcmon.exe and all the dll it needs to the target machine ( Windows&lt;br /&gt;NT4.0 SP6). Psapi.dll need to be copied over Winnt\System32.&lt;br /&gt;2. on the target machine, open a DOS command windows&lt;br /&gt;c:\app\msvcmon -anyuser&lt;br /&gt;3. start the app ( of course the debug version ) on the target machine&lt;br /&gt;4. on the development machine ( Windows XP SP2 ) , open the project file, go&lt;br /&gt;to&lt;br /&gt;Debug -&gt; Processes&lt;br /&gt;select "TCP/IP(native only)" as the transport layer, and type the IP&lt;br /&gt;address of the target machine. Then click "refresh" button.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(use PSList or PSKill for remotely terminate process. (at sysinternals.com))&lt;br /&gt;&lt;a href="http://www.windowsitpro.com/Articles/Index.cfm?ArticleID=43569&amp;amp;DisplayTab=Article"&gt;URL&lt;/a&gt; for explanation on its usage.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-111587216640120662?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/111587216640120662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=111587216640120662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/111587216640120662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/111587216640120662'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/05/steps-to-set-up-vsnet-2003-remote.html' title='Steps to set up VS.NET 2003 remote debugger'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-111477354270411818</id><published>2005-04-29T04:19:00.000-07:00</published><updated>2007-07-24T23:13:43.469-07:00</updated><title type='text'>Outlook : "operation failed, object could not be found. " when trying to close a PST.</title><content type='html'>When you try to close a PST. The error message &lt;br /&gt;"operation failed, object could not be found"&lt;br /&gt;pop up. &lt;br /&gt;After you have tried scanpst and detect and repair. Still won't work.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Solution. (a hard way)&lt;br /&gt;&lt;br /&gt;Start Regedit&lt;br /&gt;&lt;br /&gt;Go to Key&lt;br /&gt;HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Microsoft Outlook Internet Settings&lt;br /&gt;&lt;br /&gt;Where "Microsoft Outlook Internet Settings" is the Outlook profile name that has problem. (note: Outlook support multiple profile even for same Windows login)&lt;br /&gt;&lt;br /&gt;In the HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Microsoft Outlook Internet Settings, you will see a bunch of long string sub keys in it &lt;br /&gt;&lt;br /&gt;Like in the format of GUID, like e.g.   75d1fa940a0d3a4497130516edbde90e &lt;br /&gt;&lt;br /&gt;Then, start at the very first sub keys of HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Microsoft Outlook Internet Settings. Right click on sub key,&lt;br /&gt;&lt;br /&gt;Select Find (menu)&lt;br /&gt;And then, in the Find dialog, check on 'Values' (checkbox) and leave the other uncheck. &lt;br /&gt;In the Find What text box, key in 01020fff&lt;br /&gt;&lt;br /&gt;Then, you will see a few values get highlighted. Double click on it and you will see&lt;br /&gt;something like this&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href='http://photos1.blogger.com/img/262/5481/640/reg.jpg'&gt;&lt;img border='0' style='border:1px solid #000000; margin:2px' src='http://photos1.blogger.com/img/262/5481/320/reg.jpg'&gt;&lt;/a&gt;&lt;br /&gt;reg_screen&amp;nbsp;&lt;a href='http://www.hello.com/' target='ext'&gt;&lt;img src='http://photos1.blogger.com/pbh.gif' alt='Posted by Hello' border='0' style='border:0px;padding:0px;background:transparent;' align='absmiddle'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Check what is in it, the value show is actually the PST path of your Outlook Store. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Microsoft Outlook Internet Settings\XXXXXXXX&lt;br /&gt;&lt;br /&gt;delete the whole XXXXXXXX key if it contain the 01020fff which is the PST path you can't close it in the Outlook. You can check what is your PST path in Outlook by checking the properties of the mailbox. (the root node in the tree)&lt;br /&gt;&lt;br /&gt;The reason why you need to do this is that Outlook API is unable to remove the sub key where it is appearing in the Outlook folder list. Doing this is to force to remove the sub string manually. However, there is a risk to take whenever you are changing any registry key. By the way, if your PST/OST is a Exchange Mailbox, this solution is not suitable cause this is meant for local PST where the PST file is stored locally and no one copy in server. &lt;br /&gt;&lt;br /&gt;(IMPORTANT: Make sure you back up your keys before deleting it by just right click on the key you want to delete and select "Export" in the regedit.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-111477354270411818?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/111477354270411818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=111477354270411818' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/111477354270411818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/111477354270411818'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/04/outlook-operation-failed-object-could.html' title='Outlook : &quot;operation failed, object could not be found. &quot; when trying to close a PST.'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-111457224556114195</id><published>2005-04-26T20:07:00.000-07:00</published><updated>2005-04-26T20:25:54.436-07:00</updated><title type='text'>error LNK2001: unresolved external symbol _IID_IMessage</title><content type='html'>Often time, I encounter unresolved external symbol _IID_IMessage problem when I am trying to use IID_IMessage in my codes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is my solution to the problem, include and define in such sequence.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#define INITGUID&lt;br /&gt;#define USES_IID_IMessage&lt;br /&gt;#define USES_IID_IMAPIPropData&lt;br /&gt;#define USES_IID_IMAPITable&lt;br /&gt;&lt;br /&gt;#include &amp;lt;initguid.h&amp;gt; //this is needed,&lt;br /&gt;#include &amp;lt;mapiguid.h&amp;gt; //then this&lt;br /&gt;#include &amp;lt;mapiform.h&amp;gt;&lt;br /&gt;#include &amp;lt;objbase.h&amp;gt;&lt;br /&gt;#include &amp;lt;mapix.h&amp;gt;&lt;br /&gt;#include &amp;lt;mapitags.h&amp;gt;&lt;br /&gt;#include &amp;lt;mapidefs.h&amp;gt;&lt;br /&gt;#include &amp;lt;mapiutil.h&amp;gt;&lt;br /&gt;#include &amp;lt;imessage.h&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-111457224556114195?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/111457224556114195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=111457224556114195' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/111457224556114195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/111457224556114195'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/04/error-lnk2001-unresolved-external.html' title='error LNK2001: unresolved external symbol _IID_IMessage'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-111157783760024496</id><published>2005-03-23T03:35:00.000-08:00</published><updated>2005-03-23T03:37:17.606-08:00</updated><title type='text'>Managed string to Unmanaged string</title><content type='html'>&lt;p&gt;&lt;tt&gt;&lt;span style="font-family:Times New Roman;font-size:130%;"&gt;Taken from &lt;a href="http://www.cs.virginia.edu/%7Ecs216/labs/helpdocs/system.string.html"&gt;http://www.cs.virginia.edu/~cs216/labs/helpdocs/system.string.html&lt;/a&gt;&lt;/span&gt;&lt;/tt&gt;&lt;b&gt;&lt;tt&gt;&lt;span style="font-family:Times New Roman;font-size:130%;"&gt;&lt;a href="http://www.cs.virginia.edu/%7Ecs216/labs/helpdocs/system.string.html"&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;b&gt;&lt;tt&gt;&lt;span style="font-family:Times New Roman;font-size:130%;"&gt;Example Code&lt;/span&gt;&lt;/tt&gt;&lt;/b&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;#include "stdafx.h" &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;#include &lt;iostream&gt;&lt;br /&gt;  #include &lt;string&gt;&lt;br /&gt;  using namespace std; &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;#using &lt;mscorlib.dll&gt;&lt;br /&gt;  using namespace System;&lt;br /&gt;  using namespace System::Text;&lt;br /&gt;  using namespace System::Runtime::InteropServices; &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;//Converts a    System::String to a std::string&lt;br /&gt;  //This code assumes that you have used the following namespace:&lt;br /&gt;  // using namespace System::Runtime::InteropServices;&lt;br /&gt;  &lt;/span&gt;std::string ManagedToSTL(System::String *managed) {&lt;br /&gt;  &lt;span style="color:#cc0000;"&gt;    //get a pointer to an array of ANSI    chars&lt;br /&gt;  &lt;/span&gt;    char *chars = (char*)    Marshal::StringToHGlobalAnsi(managed).ToPointer(); &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       //assign the array to an STL string&lt;br /&gt;  &lt;/span&gt;    std::string stl = chars; &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       //free the memory used by the array&lt;br /&gt;    //since the array is not managed, it will not be claimed by    the garbage collector&lt;br /&gt;  &lt;/span&gt;    Marshal::FreeHGlobal(chars); &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;    return stl;&lt;br /&gt;  } &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;//Converts a    std::string to a System::String&lt;br /&gt;  //This code assumes that you have used the following namespace:&lt;br /&gt;  // using namespace System::Runtime::InteropServices&lt;br /&gt;  &lt;/span&gt;System::String* STLToManaged(std::string stl) {&lt;br /&gt;  &lt;span style="color:#cc0000;"&gt;    //the c_str() function gets a char    array from the STL string,&lt;br /&gt;    //but the PtrToStringAnsi function wants a int array, so it    gets casted&lt;br /&gt;  &lt;/span&gt;    return Marshal::PtrToStringAnsi((int*) stl.c_str());&lt;br /&gt;  } &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;int _tmain()&lt;br /&gt;  {&lt;br /&gt;  &lt;span style="color:#cc0000;"&gt;    /*Parsing and Comparison Example*/&lt;br /&gt;    //First, here is an example of simple string parsing&lt;br /&gt;  &lt;/span&gt;    Console::WriteLine("Parsing and Comparison    Example:"); &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       //here is a string to parse&lt;br /&gt;  &lt;/span&gt;    String *str = S"one two,three:four;five"; &lt;/span&gt;   &lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       //this is a list of delimiters that can separate words&lt;br /&gt;  &lt;/span&gt;    Char delim[] = {' ', ',', ':', ';'}; &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       //using the Split() method, we can obtain an array of strings that&lt;br /&gt;    //are separated by the given delimeters&lt;br /&gt;  &lt;/span&gt;    String *strArray[] = str-&gt;Split(delim); &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       //check that the first element contains "one"&lt;br /&gt;    //if you wish to compare alphabetically, use Compare() (see    MSDN)&lt;br /&gt;  &lt;/span&gt;    if (strArray[0]-&gt;Equals(S"one"))&lt;br /&gt;        Console::WriteLine("\"one\" ==    \"one\""); &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       //output all members of the array&lt;br /&gt;    //we should see:&lt;br /&gt;    // one&lt;br /&gt;    // two&lt;br /&gt;    // three&lt;br /&gt;    // four&lt;br /&gt;    // five&lt;br /&gt;  &lt;/span&gt;    for (int i = 0; i &lt;&gt;get_Count(); i++)&lt;br /&gt;        Console::WriteLine(strArray[i]);   &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       /*StringBuilder Example*/&lt;br /&gt;    //Here is an example of using StringBuilder as a changeable    alternative&lt;br /&gt;    //to the immutable String class&lt;br /&gt;    //Here we assume:&lt;br /&gt;    // using namespace System::Text;&lt;br /&gt;  &lt;/span&gt;    Console::WriteLine();&lt;br /&gt;    Console::WriteLine("StringBuilder Example:"); &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       //declare a new StringBuilder&lt;br /&gt;  &lt;/span&gt;    StringBuilder *strBuild = new StringBuilder();   &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       //use the Append() method to construct a string of the words that we parsed&lt;br /&gt;  &lt;/span&gt;    strBuild-&gt;Append(strArray[0]);&lt;br /&gt;    for (int i = 1; i &lt;&gt;get_Count(); i++) {&lt;br /&gt;        strBuild-&gt;Append(" ");&lt;br /&gt;        strBuild-&gt;Append(strArray[i]);&lt;br /&gt;    } &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       //convert the StringBuilder to an immutable String and output&lt;br /&gt;  &lt;/span&gt;    String *final = strBuild-&gt;ToString();&lt;br /&gt;    Console::WriteLine(final); &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       /*Conversion Example*/&lt;br /&gt;    //Here we see how to use the functions declared above to    convert between&lt;br /&gt;    //the managed System::String class and the unmanaged STL    std::string class&lt;br /&gt;  &lt;/span&gt;    Console::WriteLine();&lt;br /&gt;    Console::WriteLine("Conversion Example:"); &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       //the variables we will be using&lt;br /&gt;  &lt;/span&gt;    String *managedString;&lt;br /&gt;    string stlString; &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       //converts a managed String to an STL string, using cout to output&lt;br /&gt;  &lt;/span&gt;    managedString = S"Managed -&gt; STL";&lt;br /&gt;    stlString = ManagedToSTL(managedString);&lt;br /&gt;    cout &lt;&lt;&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#cc0000;"&gt;       //converts an STL string to a managed String, using Console::WriteLine to    output&lt;br /&gt;  &lt;/span&gt;    stlString = "STL -&gt; Managed";&lt;br /&gt;    managedString = STLToManaged(stlString);&lt;br /&gt;    Console::WriteLine(managedString); &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;    return 0;&lt;br /&gt;  }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-111157783760024496?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/111157783760024496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=111157783760024496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/111157783760024496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/111157783760024496'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/03/managed-string-to-unmanaged-string.html' title='Managed string to Unmanaged string'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110964396987182413</id><published>2005-02-28T18:25:00.000-08:00</published><updated>2005-02-28T18:26:09.873-08:00</updated><title type='text'>IT conversation</title><content type='html'>&lt;a href="http://www.itconversations.com/"&gt;http://www.itconversations.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Listener-supported audio programs,&lt;br /&gt;interviews and important events.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110964396987182413?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110964396987182413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110964396987182413' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110964396987182413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110964396987182413'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/02/it-conversation.html' title='IT conversation'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110921932611364560</id><published>2005-02-23T20:28:00.000-08:00</published><updated>2005-02-23T20:28:46.116-08:00</updated><title type='text'>Viewing STL container in VS.NET 2003 watch windows</title><content type='html'>For a vector, you can start with these examples:&lt;br /&gt;&lt;br /&gt;"v._Myfirst" -&gt; the  first element&lt;br /&gt;"v._Myfirst, 10"  -&gt; 10 elements&lt;br /&gt;"v._Myfirst[1]" -&gt;  the element at index 1&lt;br /&gt;"v.size()" -&gt; number of elements&lt;br /&gt;&lt;br /&gt;For a  list:&lt;br /&gt;&lt;br /&gt;"l._Mysize" -&gt; number of  elements&lt;br /&gt;"l._Myhead-&gt;_Next-&gt;_Myval" -&gt; the first  element&lt;br /&gt;"l._Myhead-&gt;_Next-&gt;_Next-&gt;_Myval" -&gt; the second  element&lt;br /&gt;"l._Myhead-&gt;_Next-&gt;_Next-&gt;_Next-&gt;_Myval" -&gt; the third  element, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110921932611364560?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110921932611364560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110921932611364560' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110921932611364560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110921932611364560'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/02/viewing-stl-container-in-vsnet-2003.html' title='Viewing STL container in VS.NET 2003 watch windows'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110895929797808956</id><published>2005-02-20T19:54:00.000-08:00</published><updated>2005-02-20T20:14:57.980-08:00</updated><title type='text'>MFC Windows Message Processing - yield control</title><content type='html'>&lt;p&gt;(Refering Programming Ms Visual C++ fifth edition - Ms Press)&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;A workaround  which works with both Win16 and  Win32. Yield control once in  a while by inserting the following instructions inside the time consuming function:  &lt;/p&gt; &lt;pre&gt;MSG message;&lt;br /&gt;if (::PeekMessage(&amp;message, NULL, 0, 0, PM_REMOVE)) {&lt;br /&gt;   ::TranslateMessage(&amp;amp;message);&lt;br /&gt;   ::DispatchMessage(&amp;message);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt;The &lt;i&gt;PeekMessage&lt;/i&gt; function works like &lt;i&gt;GetMessage&lt;/i&gt;, except that it  returns immediately even if no message has arrived for your program. In that  case, the function keeps on processing. If there &lt;u&gt;is&lt;/u&gt; a message, however, the function  pauses, the handler is called, and the function starts up again after the handler  exits.&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;E.g.&lt;br /&gt;&lt;/p&gt; &lt;pre style="color: rgb(51, 102, 255);"&gt;void CMyClass::LengthyFunction()&lt;br /&gt;{&lt;br /&gt;   MSG message;&lt;br /&gt;&lt;br /&gt;   volatile int nTemp;&lt;br /&gt;   for (m_nCount = 0; m_nCount &lt; nMaxCount; m_nCount++) {&lt;br /&gt;       for (nTemp = 0; nTemp &lt; 10000; nTemp++) {&lt;br /&gt;           // processing here.&lt;br /&gt;       }&lt;br /&gt;       if (::PeekMessage(&amp;message, NULL, 0, 0, PM_REMOVE)) {&lt;br /&gt;           ::TranslateMessage(&amp;amp;message);&lt;br /&gt;           ::DispatchMessage(&amp;message);&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="color: rgb(51, 102, 255);"&gt; &lt;/span&gt;&lt;br /&gt;&lt;a name="240"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110895929797808956?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110895929797808956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110895929797808956' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110895929797808956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110895929797808956'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/02/mfc-windows-message-processing-yield.html' title='MFC Windows Message Processing - yield control'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110845885889072785</id><published>2005-02-15T01:12:00.000-08:00</published><updated>2005-02-15T01:14:18.893-08:00</updated><title type='text'>Recover HDD after format</title><content type='html'>&lt;span class="messagecontent"&gt;&lt;i&gt;SystemRescueCd is an improvement of the gentoo live cd. It aims to provide an high quality bootable CD-Rom, with all system utilities that can be required to repair your system.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sourceforge.net/projects/systemrescuecd"&gt;http://sourceforge.net/projects/systemrescuecd&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="messagecontent"&gt;There seems to be some utilities for FAT16/32 (&lt;a href="http://packages.debian.org/unstable/otherosfs/dosfstools" rel="nofollow"&gt;dosfstools&lt;/a&gt;[&lt;a href="http://packages.debian.org/unstable/otherosfs/dosfstools" target="_blank" rel="nofollow" title="New Window"&gt;^&lt;/a&gt;]) and NTSF (&lt;a href="http://packages.debian.org/unstable/otherosfs/ntfsprogs" rel="nofollow"&gt;NTSFProgs&lt;/a&gt;[&lt;a href="http://packages.debian.org/unstable/otherosfs/ntfsprogs" target="_blank" rel="nofollow" title="New Window"&gt;^&lt;/a&gt;]) included on the bootable linux CD&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="messagecontent"&gt;There is also this tool &lt;a href="http://www.r-studio.ca/?FD91" rel="nofollow"&gt;R-Studio 2.0&lt;/a&gt;[&lt;a href="http://www.r-studio.ca/?FD91" target="_blank" rel="nofollow" title="New Window"&gt;^&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="messagecontent"&gt;&lt;a href="http://www.grc.com/sr/spinrite.htm" rel="nofollow"&gt;http://www.grc.com/sr/spinrite.htm&lt;/a&gt;[&lt;a href="http://www.grc.com/sr/spinrite.htm" target="_blank" rel="nofollow" title="New Window"&gt;^&lt;/a&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/9937599-110845885889072785?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110845885889072785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110845885889072785' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110845885889072785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110845885889072785'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/02/recover-hdd-after-format.html' title='Recover HDD after format'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110844100406547151</id><published>2005-02-14T20:05:00.000-08:00</published><updated>2005-02-14T20:16:44.070-08:00</updated><title type='text'>Merging menu items for MDI container and MDI  child forms</title><content type='html'>Say, if MDI container has a "About" Menu that the MDI child forms need to merge with.&lt;br /&gt;&lt;br /&gt;Set the MDI container menu in such manner.  (In the InitializeComponent or change it using the IDE property window)&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(51, 102, 255);font-size:85%;" &gt;         this.menuItemAbout.Index = 1;&lt;br /&gt;            this.menuItemAbout.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {&lt;br /&gt;                                                                                         this.menuItemMainHelp});&lt;br /&gt;            this.menuItemAbout.MergeOrder = 1;&lt;br /&gt;            this.menuItemAbout.MergeType = System.Windows.Forms.MenuMerge.MergeItems;&lt;br /&gt;            this.menuItemAbout.Text = "Help";&lt;br /&gt;           &lt;br /&gt;            this.menuItemMainHelp.Index = 0;&lt;br /&gt;            this.menuItemMainHelp.MergeOrder = 1000; //this need to be larger than the child so that it appear                                                                                                                 //underneath the child menu items.&lt;br /&gt;            this.menuItemMainHelp.Text = "Main Help";&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);font-size:85%;" &gt;               this.menuItemMainHelp.MergeType = System.Windows.Forms.MenuMerge.Add;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Set MDI child forms in such manner. (In the InitializeComponent or change it using the IDE property window)&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(51, 102, 255);font-size:85%;" &gt;   this.menuItemAbout.Index = 1;&lt;br /&gt;&lt;br /&gt;            this.menuItemAbout.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {&lt;br /&gt;                                                                                      this.menuItemChildHelp});&lt;br /&gt;            this.menuItemAbout.MergeOrder = 1;&lt;br /&gt;            this.menuItemAbout.MergeType = System.Windows.Forms.MenuMerge.MergeItems;&lt;br /&gt;            this.menuItemAbout.Text = "Help";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            this.menuItemChildHelp.Index = 0;&lt;br /&gt;            this.menuItemChildHelp.MergeOrder = 100;&lt;br /&gt;            this.menuItemChildHelp.Text = "My Child Help";&lt;br /&gt;               this.menuItemChildHelp.MergeType = System.Windows.Forms.MenuMerge.Add;&lt;br /&gt;            this.menuItemChildHelp.Click += new System.EventHandler(this.menuItemChildHelp_Click);&lt;br /&gt;&lt;br /&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/9937599-110844100406547151?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110844100406547151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110844100406547151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110844100406547151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110844100406547151'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/02/merging-menu-items-for-mdi-container.html' title='Merging menu items for MDI container and MDI  child forms'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110843953842468973</id><published>2005-02-14T19:44:00.000-08:00</published><updated>2005-02-14T20:01:24.990-08:00</updated><title type='text'>Integrate help to .NET apps</title><content type='html'>&lt;span style="font-size:85%;"&gt;Help.ShowPopup(this,&lt;br /&gt;               "Enter Phone number here. Valid input characters are 0-9,space,'-','(', and ')'",&lt;br /&gt;               Cursor.Position);&lt;br /&gt;&lt;br /&gt;//this will show an unconventional popup message box on the cursor position. Nicer than standard //messagebox&lt;br /&gt;&lt;br /&gt;Can also use the HelpProvider object HelpString properties to achieve the same effect but seems to have less control over.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;when  drag a &lt;/span&gt;&lt;span style="font-size:85%;"&gt;System.Windows.Forms.HelpProvider to a form.&lt;br /&gt;&lt;br /&gt;All the controls in the form will have the option HelpNavigator on myHelpProvider avail in the properties windows.&lt;br /&gt;&lt;br /&gt;For directing the F1 key press to index of the CHM. The helpprovider need to set HelpNamespace to "Help\VB.chm" (to chm appropriate).&lt;br /&gt;&lt;br /&gt;Then, in the needed control,  &lt;/span&gt;&lt;span style="font-size:85%;"&gt;HelpNavigator on myHelpProvider option, choose keyword index,  and then key in the helpkeyword.&lt;br /&gt;&lt;br /&gt;This will automatically map the F1 key press or the "?" help button button to be directed to the CHM.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&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/9937599-110843953842468973?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110843953842468973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110843953842468973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110843953842468973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110843953842468973'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/02/integrate-help-to-net-apps.html' title='Integrate help to .NET apps'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110837752261145843</id><published>2005-02-14T02:34:00.000-08:00</published><updated>2005-02-14T20:00:02.983-08:00</updated><title type='text'>To sort using ArrayList.Sort()</title><content type='html'>&lt;pre  lang="cs" style="font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span class="cs-keyword"&gt;Quoted from &lt;a href="http://www.codeproject.com/useritems/sortingarraylist.asp"&gt;http://www.codeproject.com/useritems/sortingarraylist.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;public&lt;/span&gt; &lt;span class="cs-keyword"&gt;struct&lt;/span&gt; MyStrcuture&lt;br /&gt;{&lt;br /&gt;&lt;span class="cs-keyword"&gt;public&lt;/span&gt; Int32 iID;&lt;br /&gt;&lt;span class="cs-keyword"&gt;public&lt;/span&gt; String sName;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt; &lt;span style=";font-family:arial;font-size:100%;"  &gt;In order to be able to sort elements contained in an &lt;code&gt;ArrayList&lt;/code&gt;, we have to define the CompareTo method of the IComparable interface, and then use the ArrayList's &lt;code&gt;.Sort()&lt;/code&gt; method. This -of course- means that our structure should be inherited from that interface .. and so we'll do! &lt;/span&gt; &lt;pre  lang="cs" style="font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span class="cs-keyword"&gt;public&lt;/span&gt; &lt;span class="cs-keyword"&gt;struct&lt;/span&gt; MyStrcuture : IComparable&lt;br /&gt;{&lt;br /&gt;&lt;span class="cs-keyword"&gt;public&lt;/span&gt; Int32 iID;&lt;br /&gt;&lt;span class="cs-keyword"&gt;public&lt;/span&gt; String sName;&lt;br /&gt;&lt;br /&gt;&lt;span class="cs-keyword"&gt;public&lt;/span&gt; Int32 CompareTo(Object obj)&lt;br /&gt;{&lt;br /&gt;  MyStrcuture tmpObj = (MyStrcuture) obj;&lt;br /&gt;  &lt;span class="cs-keyword"&gt;return&lt;/span&gt; (&lt;span class="cs-keyword"&gt;this&lt;/span&gt;.sName.CompareTo(tmpObj.sName));&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This would allow the array list to be sorted by just calling MyArrayList.Sort()&lt;br /&gt;provided the arraylist containing the item with the above structure.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Useful sorting algorithms in C#. &lt;a href="http://www.codeproject.com/csharp/cssorters.asp"&gt;URL&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110837752261145843?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110837752261145843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110837752261145843' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110837752261145843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110837752261145843'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/02/to-sort-using-arraylistsort.html' title='To sort using ArrayList.Sort()'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110743822199985990</id><published>2005-02-03T05:42:00.000-08:00</published><updated>2005-02-03T05:44:08.170-08:00</updated><title type='text'>Useful C++ code snippet (ascii to unicode)</title><content type='html'>void ascii2unicode(LPCTSTR strin, wchar_t* strout)&lt;br /&gt;{&lt;br /&gt;    int len = strlen(strin);   &lt;br /&gt;    for(int i=0; i&amp;lt;len; i++)&lt;br /&gt;        strout[i]=(wchar_t)strin[i];&lt;br /&gt;    strout[i] = 0;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110743822199985990?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110743822199985990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110743822199985990' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110743822199985990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110743822199985990'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/02/useful-c-code-snippet-ascii-to-unicode.html' title='Useful C++ code snippet (ascii to unicode)'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110742575793298254</id><published>2005-02-03T02:14:00.000-08:00</published><updated>2005-02-03T02:15:57.933-08:00</updated><title type='text'>ImpLib32</title><content type='html'>&lt;a href="http://www.geocities.com/SiliconValley/5806/implib32.htm"&gt;http://www.geocities.com/SiliconValley/5806/implib32.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;ImpLib32 is a small utility which creates an import library for Visual C++ 2.x/4.x/5.x from an existing DLL.&lt;br /&gt;&lt;/p&gt;   &lt;span style="font-size:130%;"&gt;&lt;strong&gt;What is Implib32:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; Implib32 creates 32 bit import libraries for the use with Microsoft Visual&lt;br /&gt; C++ 2.x/4.x/5.x.&lt;br /&gt;&lt;br /&gt; Back in the good old days of Windows 3.x, Microsoft supplied a tool called&lt;br /&gt; IMPLIB. This tool was able to create a import library for a given DLL.&lt;br /&gt; After creating this library, you linked it to your program in order to&lt;br /&gt; call functions contained in the DLL.&lt;br /&gt;&lt;br /&gt; Unfortunatly, there is no equivalent to IMPLIB for Win32. Microsoft suggests&lt;br /&gt; on the Win32 Knowledge Base that you should use DUMPBIN to create a file&lt;br /&gt; which lists all exports of a DLL, reformat this file to .DEF-file using a&lt;br /&gt; text editor and then use LIB to create a import library from the .DEF-file.&lt;br /&gt; Implib32 does all this work for you: It invokes DUMPBIN and LIB and creates&lt;br /&gt; an import library!&lt;br /&gt;&lt;br /&gt; Note: ImpLib32 can't process 16-Bit DLLs, it will only work with 32-Bit DLLs!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110742575793298254?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110742575793298254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110742575793298254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110742575793298254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110742575793298254'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/02/implib32.html' title='ImpLib32'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110742022094706568</id><published>2005-02-03T01:37:00.000-08:00</published><updated>2005-02-03T00:45:25.776-08:00</updated><title type='text'>Open Source Licensing Quick Guide</title><content type='html'>&lt;p&gt;(quoted from &lt;a href="http://zooko.com/license_quick_ref.html"&gt;http://zooko.com/license_quick_ref.html&lt;/a&gt;)&lt;br /&gt;&lt;/p&gt; &lt;p&gt;QUICK REFERENCE FOR CHOOSING A FREE SOFTWARE LICENSE, version 1.4.5.0, 2004-08-31&lt;/p&gt;       &lt;pre&gt;License&lt;br /&gt;|           hackers like to accept code under it&lt;br /&gt;|             | combine with proprietary and redistribute&lt;br /&gt;|             |   | combine with GPL'ed code and redistribute&lt;br /&gt;|             |   |   | must share source of redistributed version&lt;br /&gt;|             |   |   |   | must include patent license with contribution&lt;br /&gt;|             |   |   |   |   |&lt;br /&gt;|             |   |   |   |   |&lt;br /&gt;v             v   v   v   v   v&lt;br /&gt;---           --- --- --- --- ---&lt;br /&gt;&lt;a href="http://www.opensource.org/licenses/mit-license.html"&gt;permissive&lt;/a&gt;      Y   Y   Y   N   N&lt;br /&gt;&lt;a href="http://www.fsf.org/copyleft/lesser.html"&gt;GNU LGPL&lt;/a&gt;        Y2  Y1  Y   Y   Y&lt;br /&gt;&lt;a href="http://www.fsf.org/licenses/gpl.html"&gt;GNU GPL&lt;/a&gt;         ?2  N   Y   Y   Y&lt;br /&gt;&lt;a href="http://www.mozilla.org/MPL/MPL-1.1.html"&gt;Mozilla PL 1.1&lt;/a&gt;  Y2  Y   N3  Y   Y  (FAQ on MPL &lt;a href="http://www.mozilla.org/MPL/mpl-faq.html"&gt;URL&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;Excel doc which explains various licensing stuff&lt;br /&gt;&lt;a href="http://www.mass.gov/itd/legal/quickrefchart.xls"&gt;&lt;/a&gt;&lt;a href="http://www.mass.gov/itd/legal/quickrefchart.xls"&gt;http://www.mass.gov/itd/legal/quickrefchart.xls&lt;/a&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110742022094706568?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110742022094706568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110742022094706568' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110742022094706568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110742022094706568'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/02/open-source-licensing-quick-guide.html' title='Open Source Licensing Quick Guide'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110715310821059086</id><published>2005-01-30T22:28:00.000-08:00</published><updated>2005-01-30T22:31:48.210-08:00</updated><title type='text'>The Robots Exclusion Standard (web spider)</title><content type='html'>&lt;a href="http://www.searchengineworld.com/robots/robots_tutorial.htm"&gt;http://www.searchengineworld.com/robots/robots_tutorial.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.searchengineworld.com/cgi-bin/robotcheck.cgi"&gt;http://www.searchengineworld.com/cgi-bin/robotcheck.cgi&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Getting more hits count for a web sites.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://tom.gilki.org/programming/other/121104/"&gt;http://tom.gilki.org/programming/other/121104/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and set the meta tag of the main page. (check thestar.com.my)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110715310821059086?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110715310821059086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110715310821059086' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110715310821059086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110715310821059086'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/robots-exclusion-standard-web-spider.html' title='The Robots Exclusion Standard (web spider)'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110713901650248058</id><published>2005-01-30T18:35:00.000-08:00</published><updated>2005-01-30T18:36:56.503-08:00</updated><title type='text'>C++: Named Constructor Idiom</title><content type='html'> &lt;div class="FaqTitle"&gt; &lt;h3&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;span style="font-weight: normal;"&gt;(quoted from&lt;a href="http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.4"&gt; http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.4&lt;/a&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/h3&gt; &lt;h3&gt;What is the "Named Constructor Idiom"?&lt;/h3&gt; &lt;/div&gt;  &lt;p&gt;A technique that provides more intuitive and/or safer construction operations  for users of your class.  &lt;/p&gt; &lt;p&gt;The problem is that constructors always have the same name as the class.  Therefore the only way to differentiate between the various constructors of a  class is by the parameter list. But if there are lots of constructors, the  differences between them become somewhat subtle and error prone.  &lt;/p&gt; &lt;p&gt;With the Named Constructor Idiom, you declare all the class's constructors in  the &lt;tt&gt;private&lt;/tt&gt; or &lt;tt&gt;protected&lt;/tt&gt; sections, and you provide  &lt;tt&gt;public&lt;/tt&gt; &lt;tt&gt;static&lt;/tt&gt; methods that return an object. These  &lt;tt&gt;static&lt;/tt&gt; methods are the so-called "Named Constructors." In general there  is one such &lt;tt&gt;static&lt;/tt&gt; method for each different way to construct an  object.  &lt;/p&gt; &lt;p&gt;For example, suppose we are building a &lt;tt&gt;Point&lt;/tt&gt; class that represents a  position on the X-Y plane. Turns out there are two common ways to specify a  2-space coordinate: rectangular coordinates (X+Y), polar coordinates  (Radius+Angle). (Don't worry if you can't remember these; the point isn't the  particulars of coordinate systems; the point is that there are several ways to  create a &lt;tt&gt;Point&lt;/tt&gt; object.) Unfortunately the parameters for these two  coordinate systems are the same: two &lt;tt&gt;float&lt;/tt&gt;s. This would create an  ambiguity error in the overloaded constructors:  &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;div class="CodeBlock"&gt;&lt;tt&gt; class Point {&lt;br /&gt; public:&lt;br /&gt;   Point(float x, float y);     &lt;/tt&gt;&lt;em&gt;&lt;small&gt;// Rectangular coordinates&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;   Point(float r, float a);     &lt;/tt&gt;&lt;em&gt;&lt;small&gt;// Polar coordinates (radius and angle)&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;   &lt;/tt&gt;&lt;em&gt;&lt;small&gt;// ERROR: Overload is Ambiguous: &lt;nobr&gt;&lt;tt&gt;Point::Point(float,float)&lt;/tt&gt;&lt;/nobr&gt;&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt; };&lt;br /&gt;&lt;br /&gt; int main()&lt;br /&gt; {&lt;br /&gt;   Point p = Point(5.7, 1.2);   &lt;/tt&gt;&lt;em&gt;&lt;small&gt;// Ambiguous: Which coordinate system?&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;   &lt;/tt&gt;&lt;em&gt;&lt;small&gt;...&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt; }  &lt;/tt&gt;&lt;/div&gt;  &lt;p&gt;One way to solve this ambiguity is to use the Named Constructor Idiom:  &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;div class="CodeBlock"&gt;&lt;tt&gt; #include &lt;cmath&gt;               &lt;/tt&gt;&lt;em&gt;&lt;small&gt;// To get &lt;nobr&gt;&lt;tt&gt;sin()&lt;/tt&gt;&lt;/nobr&gt; and &lt;nobr&gt;&lt;tt&gt;cos()&lt;/tt&gt;&lt;/nobr&gt;&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;&lt;br /&gt; class Point {&lt;br /&gt; public:&lt;br /&gt;   static Point rectangular(float x, float y);      &lt;/tt&gt;&lt;em&gt;&lt;small&gt;// Rectangular coord's&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;   static Point polar(float radius, float angle);   &lt;/tt&gt;&lt;em&gt;&lt;small&gt;// Polar coordinates&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;   &lt;/tt&gt;&lt;em&gt;&lt;small&gt;// These &lt;tt&gt;static&lt;/tt&gt; methods are the so-called "named constructors"&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;   &lt;/tt&gt;&lt;em&gt;&lt;small&gt;...&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt; private:&lt;br /&gt;   Point(float x, float y);     &lt;/tt&gt;&lt;em&gt;&lt;small&gt;// Rectangular coordinates&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;   float x_, y_;&lt;br /&gt; };&lt;br /&gt;&lt;br /&gt; inline Point::Point(float x, float y)&lt;br /&gt; : x_(x), y_(y) { }&lt;br /&gt;&lt;br /&gt; inline Point Point::rectangular(float x, float y)&lt;br /&gt; { return Point(x, y); }&lt;br /&gt;&lt;br /&gt; inline Point Point::polar(float radius, float angle)&lt;br /&gt; { return Point(radius*cos(angle), radius*sin(angle)); }  &lt;/tt&gt;&lt;/div&gt;  &lt;p&gt;Now the users of &lt;tt&gt;Point&lt;/tt&gt; have a clear and unambiguous syntax for  creating &lt;tt&gt;Point&lt;/tt&gt;s in either coordinate system:  &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;div class="CodeBlock"&gt;&lt;tt&gt; int main()&lt;br /&gt; {&lt;br /&gt;   Point p1 = Point::rectangular(5.7, 1.2);   &lt;/tt&gt;&lt;em&gt;&lt;small&gt;// Obviously rectangular&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;   Point p2 = Point::polar(5.7, 1.2);         &lt;/tt&gt;&lt;em&gt;&lt;small&gt;// Obviously polar&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;   &lt;/tt&gt;&lt;em&gt;&lt;small&gt;...&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt; }  &lt;/tt&gt;&lt;/div&gt;  &lt;p&gt;Make sure your constructors are in the &lt;tt&gt;protected&lt;/tt&gt; section if you  expect &lt;tt&gt;Point&lt;/tt&gt; to have derived classes.  &lt;/p&gt; &lt;p&gt;The Named Constructor Idiom can also be used to &lt;a title="[16.20] How can I force objects of my class to always be created via new rather than as locals or global/static objects?" href="freestore-mgmt.html#faq-16.20"&gt;make sure your objects are always created  via &lt;tt&gt;new&lt;/tt&gt;&lt;!--rawtext:[16.20]:rawtext--&gt;&lt;/a&gt;. &lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110713901650248058?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110713901650248058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110713901650248058' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110713901650248058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110713901650248058'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/c-named-constructor-idiom.html' title='C++: Named Constructor Idiom'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110713863042938930</id><published>2005-01-30T18:27:00.000-08:00</published><updated>2005-01-30T18:30:30.430-08:00</updated><title type='text'>C++: Warning: Derived::f(char) hides Base::f(double)</title><content type='html'> &lt;div class="FaqTitle"&gt; &lt;h3&gt;&lt;span style="font-weight: normal;font-size:85%;" &gt;(quoted from &lt;a href="http://www.parashift.com/c++-faq-lite/strange-inheritance.html"&gt;http://www.parashift.com/c++-faq-lite/strange-inheritance.html&lt;/a&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/h3&gt; &lt;h3&gt;&lt;br /&gt;&lt;/h3&gt; &lt;h3&gt; What's the meaning of, &lt;nobr&gt;&lt;tt&gt;Warning: Derived::f(char) hides  Base::f(double)&lt;/tt&gt;&lt;/nobr&gt;? &lt;span class="Updated"&gt; Updated! &lt;/span&gt;&lt;/h3&gt; &lt;/div&gt; &lt;small&gt;&lt;em&gt;[Recently included a new  example, changed the parameter types so the behavior seems more bizarre/ominous,  and added a note about warnings not being standardized, thanks to &lt;a title="(NOSPAM)daniel(DOT)kabs(AT)mobotix(DOT)com" href="mailto:%28NOSPAM%29daniel%28DOT%29kabs%28AT%29mobotix%28DOT%29com"&gt;Daniel Kabs&lt;/a&gt; (in  12/04). &lt;a title="[23.8] How can I set up my class so it won't be inherited from?" href="strange-inheritance.html#faq-23.8"&gt;Click here to go to the next FAQ in the  "chain" of recent changes&lt;!--rawtext:[23.8]:rawtext--&gt;&lt;/a&gt;.]&lt;/em&gt;&lt;/small&gt;  &lt;p&gt;It means you're going to die.  &lt;/p&gt; &lt;p&gt;Here's the mess you're in: if &lt;tt&gt;Base&lt;/tt&gt; declares a member function  &lt;nobr&gt;&lt;tt&gt;f(double x)&lt;/tt&gt;&lt;/nobr&gt;, and &lt;tt&gt;Derived&lt;/tt&gt; declares a member  function &lt;nobr&gt;&lt;tt&gt;f(char c)&lt;/tt&gt;&lt;/nobr&gt; (same name but different parameter  types and/or constness), then the &lt;tt&gt;Base&lt;/tt&gt; &lt;nobr&gt;&lt;tt&gt;f(double  x)&lt;/tt&gt;&lt;/nobr&gt; is "hidden" rather than "overloaded" or "overridden" (even if the  Base &lt;nobr&gt;&lt;tt&gt;f(double x)&lt;/tt&gt;&lt;/nobr&gt; is &lt;a title="[20] Inheritance -- virtual functions" href="virtual-functions.html"&gt;&lt;tt&gt;virtual&lt;/tt&gt;&lt;!--rawtext:[20]:rawtext--&gt;&lt;/a&gt;).  &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;div class="CodeBlock"&gt;&lt;tt&gt; class Base {&lt;br /&gt; public:&lt;br /&gt;   void f(double x);  &lt;/tt&gt;&lt;em&gt;&lt;small&gt;&lt;big&gt;←&lt;/big&gt; doesn't matter whether or not this is virtual&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt; };&lt;br /&gt;&lt;br /&gt; class Derived : public Base {&lt;br /&gt; public:&lt;br /&gt;   void f(char c);  &lt;/tt&gt;&lt;em&gt;&lt;small&gt;&lt;big&gt;←&lt;/big&gt; doesn't matter whether or not this is virtual&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt; };&lt;br /&gt;&lt;br /&gt; int main()&lt;br /&gt; {&lt;br /&gt;   Derived* d = new Derived();&lt;br /&gt;   Base* b = d;&lt;br /&gt;   b-&gt;f(65.3);  &lt;/tt&gt;&lt;em&gt;&lt;small&gt;&lt;big&gt;←&lt;/big&gt; okay: passes &lt;tt&gt;65.3&lt;/tt&gt; to &lt;nobr&gt;&lt;tt&gt;f(double x)&lt;/tt&gt;&lt;/nobr&gt;&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;   d-&gt;f(65.3);  &lt;/tt&gt;&lt;em&gt;&lt;small&gt;&lt;big&gt;←&lt;/big&gt; bizarre: converts &lt;tt&gt;65.3&lt;/tt&gt; to a &lt;tt&gt;char&lt;/tt&gt; (&lt;nobr&gt;&lt;tt&gt;'A'&lt;/tt&gt;&lt;/nobr&gt; if ASCII) and passes it to &lt;nobr&gt;&lt;tt&gt;f(char c)&lt;/tt&gt;&lt;/nobr&gt;; does NOT call &lt;nobr&gt;&lt;tt&gt;f(double x)&lt;/tt&gt;&lt;/nobr&gt;!!&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;   return 0;&lt;br /&gt; }  &lt;/tt&gt;&lt;/div&gt;  &lt;p&gt;Here's how you get out of the mess: &lt;tt&gt;Derived&lt;/tt&gt; must have a  &lt;tt&gt;using&lt;/tt&gt; declaration of the hidden member function. For example,  &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;div class="CodeBlock"&gt;&lt;tt&gt; class Base {&lt;br /&gt; public:&lt;br /&gt;   void f(double x);&lt;br /&gt; };&lt;br /&gt;&lt;br /&gt; class Derived : public Base {&lt;br /&gt; public:&lt;br /&gt;   using Base::f;  &lt;/tt&gt;&lt;em&gt;&lt;small&gt;&lt;big&gt;←&lt;/big&gt; This un-hides &lt;nobr&gt;&lt;tt&gt;Base::f(double x)&lt;/tt&gt;&lt;/nobr&gt;&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;   void f(char c);&lt;br /&gt; };  &lt;/tt&gt;&lt;/div&gt;  &lt;p&gt;If the &lt;tt&gt;using&lt;/tt&gt; syntax isn't supported by your compiler, redefine the  hidden &lt;tt&gt;Base&lt;/tt&gt; member function(s), &lt;a title="[23.5] Should a derived class redefine (&amp;quot;override&amp;quot;) a member function that is non-virtual in a base class?" href="strange-inheritance.html#faq-23.5"&gt;even if they are non-&lt;tt&gt;virtual&lt;/tt&gt;&lt;!--rawtext:[23.5]:rawtext--&gt;&lt;/a&gt;. Normally this  re-definition merely calls the hidden &lt;tt&gt;Base&lt;/tt&gt; member function using the  &lt;nobr&gt;&lt;tt&gt;::&lt;/tt&gt;&lt;/nobr&gt; syntax. E.g.,  &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;div class="CodeBlock"&gt;&lt;tt&gt; class Derived : public Base {&lt;br /&gt; public:&lt;br /&gt;   void f(double x) { Base::f(x); }  &lt;/tt&gt;&lt;em&gt;&lt;small&gt;&lt;big&gt;←&lt;/big&gt; The redefinition merely calls &lt;nobr&gt;&lt;tt&gt;Base::f(double x)&lt;/tt&gt;&lt;/nobr&gt;&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;   void f(char c);&lt;br /&gt; };  &lt;/tt&gt;&lt;/div&gt;  &lt;p&gt;Note: the hiding problem also occurs if class &lt;tt&gt;Base&lt;/tt&gt; declares a method  &lt;nobr&gt;&lt;tt&gt;f(char)&lt;/tt&gt;&lt;/nobr&gt;.  &lt;/p&gt; &lt;p&gt;Note: warnings are not part of the standard, so your compiler may or may not  give the above warning. &lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110713863042938930?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110713863042938930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110713863042938930' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110713863042938930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110713863042938930'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/c-warning-derivedfchar-hides.html' title='C++: Warning: Derived::f(char) hides Base::f(double)'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110713843926865535</id><published>2005-01-30T18:18:00.000-08:00</published><updated>2005-02-14T19:56:26.756-08:00</updated><title type='text'>Resolution to C++ "dreaded diamond"</title><content type='html'>(quoted from &lt;a href="http://www.parashift.com/"&gt;http://www.parashift.com&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The "dreaded diamond" refers to a class structure in which a particular class appears more than once in a class's inheritance hierarchy. For example, &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;div class="CodeBlock"&gt;&lt;tt&gt; class Base {&lt;br /&gt;public:&lt;br /&gt;  &lt;/tt&gt;&lt;em&gt;&lt;small&gt;...&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;protected:&lt;br /&gt;  int data_;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;class Der1 : public Base { ... };&lt;br /&gt;&lt;br /&gt;class Der2 : public Base { ... };&lt;br /&gt;&lt;br /&gt;class Join : public Der1, public Der2 {&lt;br /&gt;public:&lt;br /&gt;  void method()&lt;br /&gt;  {&lt;br /&gt;     data_ = 1;  &lt;/tt&gt;&lt;em&gt;&lt;small&gt;&lt;big&gt;←&lt;/big&gt; bad: this is ambiguous; see below&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;  }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;  Join* j = new Join();&lt;br /&gt;  Base* b = j;   &lt;/tt&gt;&lt;em&gt;&lt;small&gt;&lt;big&gt;←&lt;/big&gt; bad: this is ambiguous; see below&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;}  &lt;/tt&gt;&lt;/div&gt;  &lt;p&gt;Forgive the ASCII-art, but the inheritance hierarchy looks something like  this:  &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;div class="CodeBlock"&gt;&lt;tt&gt;  Base&lt;br /&gt;  /     /                          &lt;/tt&gt;&lt;tt&gt;/                                 Der1        Der2&lt;br /&gt;                       \             /&lt;br /&gt;                          \        /&lt;br /&gt;   \   /&lt;br /&gt;  Join&lt;/tt&gt;&lt;/div&gt;  &lt;p&gt;Before we explain why the dreaded diamond is dreaded, it is important to note that C++ provides techniques to deal with each of the "dreads." In other words, this structure is often &lt;em&gt;called&lt;/em&gt; the dreaded diamond, but it really isn't  dreaded; it's more just something to be aware of.  &lt;/p&gt; &lt;p&gt;The key is to realize that &lt;tt&gt;Base&lt;/tt&gt; is inherited twice, which means any  data members declared in &lt;tt&gt;Base&lt;/tt&gt;, such as &lt;tt&gt;data_&lt;/tt&gt; above, will  appear twice within a &lt;tt&gt;Join&lt;/tt&gt; object. This can create ambiguities: which  &lt;tt&gt;data_&lt;/tt&gt; did you want to change? For the same reason the conversion from  &lt;nobr&gt;&lt;tt&gt;Join*&lt;/tt&gt;&lt;/nobr&gt; to &lt;nobr&gt;&lt;tt&gt;Base*&lt;/tt&gt;&lt;/nobr&gt;, or from  &lt;nobr&gt;&lt;tt&gt;Join&amp;&lt;/tt&gt;&lt;/nobr&gt; to &lt;nobr&gt;&lt;tt&gt;Base&amp;amp;&lt;/tt&gt;&lt;/nobr&gt;, is  ambiguous: which &lt;tt&gt;Base&lt;/tt&gt; class subobject did you want?  &lt;/p&gt; &lt;p&gt;C++ lets you resolve the ambiguities. For example, instead of saying  &lt;nobr&gt;&lt;tt&gt;data_ = 1&lt;/tt&gt;&lt;/nobr&gt; you could say &lt;nobr&gt;&lt;tt&gt;Der2::data_ =  1&lt;/tt&gt;&lt;/nobr&gt;, or you could convert from &lt;nobr&gt;&lt;tt&gt;Join*&lt;/tt&gt;&lt;/nobr&gt; to a  &lt;nobr&gt;&lt;tt&gt;Der1*&lt;/tt&gt;&lt;/nobr&gt; and then to a &lt;nobr&gt;&lt;tt&gt;Base*&lt;/tt&gt;&lt;/nobr&gt;. However  please, Please, &lt;em&gt;PLEASE&lt;/em&gt; think before you do that. That is almost always  &lt;em&gt;not&lt;/em&gt; the best solution. The best solution is typically to tell the C++  compiler that only one &lt;tt&gt;Base&lt;/tt&gt; subobject should appear within a  &lt;tt&gt;Join&lt;/tt&gt; object, and that is described&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;Resolution&lt;br /&gt;----------&lt;br /&gt;&lt;/p&gt; &lt;p&gt;Just below the top of the diamond, &lt;em&gt;not&lt;/em&gt; at the join-class.  &lt;/p&gt; &lt;p&gt;To avoid the duplicated base class subobject that occurs with the "dreaded  diamond", you should use the &lt;tt&gt;virtual&lt;/tt&gt; keyword in the inheritance part of  the classes that derive directly from the top of the diamond:  &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;div class="CodeBlock"&gt;&lt;tt&gt; class Base {&lt;br /&gt;public:&lt;br /&gt;  &lt;/tt&gt;&lt;em&gt;&lt;small&gt;...&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;protected:&lt;br /&gt;  int data_;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;class Der1 : public virtual Base {&lt;br /&gt;public:             ^^^^^^^&lt;/tt&gt;&lt;em&gt;&lt;small&gt;—this is the key&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;  &lt;/tt&gt;&lt;em&gt;&lt;small&gt;...&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;class Der2 : public virtual Base {&lt;br /&gt;public:             ^^^^^^^&lt;/tt&gt;&lt;em&gt;&lt;small&gt;—this is the key&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;  &lt;/tt&gt;&lt;em&gt;&lt;small&gt;...&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;class Join : public Der1, public Der2 {&lt;br /&gt;public:&lt;br /&gt;  void method()&lt;br /&gt;  {&lt;br /&gt;     data_ = 1;  &lt;/tt&gt;&lt;em&gt;&lt;small&gt;&lt;big&gt;←&lt;/big&gt; good: this is now unambiguous&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;  }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;  Join* j = new Join();&lt;br /&gt;  Base* b = j;   &lt;/tt&gt;&lt;em&gt;&lt;small&gt;&lt;big&gt;←&lt;/big&gt; good: this is now unambiguous&lt;/small&gt;&lt;/em&gt;&lt;tt&gt;&lt;br /&gt;}  &lt;/tt&gt;&lt;/div&gt;  &lt;p&gt;Because of the &lt;tt&gt;virtual&lt;/tt&gt; keyword in the base-class portion of  &lt;tt&gt;Der1&lt;/tt&gt; and &lt;tt&gt;Der2&lt;/tt&gt;, an instance of &lt;tt&gt;Join&lt;/tt&gt; will have have  only a single &lt;tt&gt;Base&lt;/tt&gt; subobject. This eliminates the ambiguities. This is  usually better than using full qualification as described in &lt;a title="[25.8] What is the &amp;quot;dreaded diamond&amp;quot;?" href="http://www.blogger.com/multiple-inheritance.html#faq-25.8"&gt;the previous FAQ&lt;!--rawtext:[25.8]:rawtext--&gt;&lt;/a&gt;.  &lt;/p&gt; &lt;p&gt;For emphasis, the &lt;tt&gt;virtual&lt;/tt&gt; keyword goes in the hierarchy above  &lt;tt&gt;Der1&lt;/tt&gt; and &lt;tt&gt;Der2&lt;/tt&gt;. It doesn't help to put the &lt;tt&gt;virtual&lt;/tt&gt;  keyword in the &lt;tt&gt;Join&lt;/tt&gt; class itself. In other words, you have to know that  a join class will exist when you are creating class &lt;tt&gt;Der1&lt;/tt&gt; and  &lt;tt&gt;Der2&lt;/tt&gt;.  &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;div class="CodeBlock"&gt;&lt;tt&gt;   Base&lt;br /&gt;  /     /                          virtual  &lt;/tt&gt;&lt;tt&gt;virtual&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;/                                 Der1        Der2&lt;br /&gt;                       \             /&lt;br /&gt;                          \        /&lt;br /&gt;   \   /&lt;br /&gt;  Join&lt;/tt&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110713843926865535?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110713843926865535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110713843926865535' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110713843926865535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110713843926865535'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/resolution-to-c-dreaded-diamond.html' title='Resolution to C++ &quot;dreaded diamond&quot;'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110691386972021399</id><published>2005-01-28T04:03:00.000-08:00</published><updated>2005-01-28T04:04:29.720-08:00</updated><title type='text'>Wrapping .NET Framework SP1 into a installer</title><content type='html'>(Original : &lt;a href="http://www.mcse.ms/archive102-2004-9-1093014.html"&gt;http://www.mcse.ms/archive102-2004-9-1093014.html&lt;/a&gt;)&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;1. First download the .NET framework v1.1 re-distributable package, and run "dotnetfx.exe" with the "/C" switch (to extract contents).&lt;br /&gt;2. Then download the .NET fw v1.1 SP1 update, and run "NDP1.1sp1-KB867460-X86.exe" with the /XP" switch (to extract contents).&lt;br /&gt;3. A dialog box asking you where to save the MSP (update patch) comes up, choose where you want to save it (size 18,760 KB).&lt;br /&gt;4. Rename that MSP to SP1.MSP, and place the extracted contents of dotnetfx.exe (.NET framework installer) in the same directory.&lt;br /&gt;5. Clean the directory so sp1.msp, data1.cab, and netfx.msi are the only files (3 files) in the directory.&lt;br /&gt;6. Run the following commands (from a command prompt):&lt;br /&gt; &lt;br /&gt;CODE &lt;br /&gt;msiexec /a netfx.msi TARGETDIR="c:\netfx1"&lt;br /&gt;msiexec /p sp1.msp /a c:\netfx\netfx.msi&lt;br /&gt; &lt;br /&gt;7. Your c:\netfx directory should have 3 items in it after this operation: 2 directories - Program Files &amp; Win, and netfx.msi.&lt;br /&gt;8. Now you can compress it to SFX (if compressed it will be just 17.5 MB, if left uncompressed it is 56.2 MB). And set it to silently extract.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;;The comment below contains SFX script commands&lt;br /&gt; &lt;br /&gt;Setup=Netfx.msi /qn /norestart  &lt;br /&gt;TempMode&lt;br /&gt;Silent=1&lt;br /&gt;Overwrite=1&lt;br /&gt; &lt;br /&gt; With WinRAR:&lt;br /&gt;Choose SFX with best compression.&lt;br /&gt;Copy the above into the comment window. (last tab)&lt;br /&gt;Then ok to create a 17.5 Mb SFX.&lt;br /&gt; &lt;br /&gt; Contents (already patched with sp1.msp):&lt;br /&gt;netfx.msi&lt;br /&gt;\Program Files&lt;br /&gt;\Win&lt;br /&gt; &lt;br /&gt;Think I got it all?&lt;/blockquote&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110691386972021399?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110691386972021399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110691386972021399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110691386972021399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110691386972021399'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/wrapping-net-framework-sp1-into.html' title='Wrapping .NET Framework SP1 into a installer'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110690100877243452</id><published>2005-01-28T01:10:00.000-08:00</published><updated>2005-01-30T23:22:31.416-08:00</updated><title type='text'>Log4Net tutorial (my straightforward version)</title><content type='html'>After playing around with the Log4Net, this is my version of tutorial of Log4Net. (WinForm or console)&lt;br /&gt;&lt;br /&gt;I have come across a few tutorials but it seems that most of them are either not working or missing out some details that could lead to further waste of time in searching. Hence, my version is here. (in case in future I need to refer back again)&lt;br /&gt;&lt;br /&gt;1. Download latest Log4Net. Not the release version 1.1.1, it won't work in this tutorial. Actually, I haven't seen any tutorials works on 1.1.1 release with FileAppender, what an upset. You will need to download the 1.2.0 Beta8 or later.&lt;br /&gt;2. Start a .NET WinForm application or console application.&lt;br /&gt;3. Add reference to Log4Net.dll&lt;br /&gt;4.  Add codes below to AssemblyInfo.cs&lt;br /&gt;&lt;br /&gt;[assembly: log4net.Config.DOMConfigurator(ConfigFile="Logging", ConfigFileExtension="config",Watch=false)]&lt;br /&gt;&lt;br /&gt;5.  Add these two lines into your class.&lt;br /&gt;&lt;br /&gt;private static readonly ILog logger =&lt;br /&gt;    LogManager.GetLogger(typeof(YourClassName));&lt;br /&gt;&lt;br /&gt;static YourClassName()&lt;br /&gt;{&lt;br /&gt;    DOMConfigurator.Configure();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;6. Then, right click on your project at the Solution Explorer.&lt;br /&gt;- Add - Add New Item - Utility - Application Configuration File&lt;br /&gt;&lt;br /&gt;You will see a App.Config appears before you.&lt;br /&gt;&lt;br /&gt;7. Add in these lines into your App.Config&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;configSections&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/configSections&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;log4net&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;appender name= "LogFileAppender" type="log4net.Appender.FileAppender"&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;param name="File" value="LogTest2.txt" /&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;param name="AppendToFile" value="true" /&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&lt;br /&gt;&lt;br /&gt;           &amp;lt;param name="Header" value="[Header]\r\n" /&amp;gt;&lt;br /&gt;&lt;br /&gt;           &amp;lt;param name="Footer" value="[Footer]\r\n" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" /&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;/layout&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;/appender&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;root&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;level value="INFO" /&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;appender-ref ref="LogFileAppender" /&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;/root&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/log4net&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;br /&gt;8.  Then, at any point where you want to log to the file, just place codes like e.g. below, depends on priority and purpose.&lt;br /&gt;&lt;br /&gt;logger.Debug("Here is a debug log.");&lt;br /&gt;logger.Info("... and an Info log.");&lt;br /&gt;logger.Warn("... and a warning.");&lt;br /&gt;logger.Error("... and an error.");&lt;br /&gt;logger.Fatal("... and a fatal error.");&lt;br /&gt;&lt;br /&gt;For further  info on its usage, check the Log4Net project page.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(Content below quoted from &lt;a href="http://www.vipan.com/htdocs/log4jhelp.html"&gt;http://www.vipan.com/htdocs/log4jhelp.html)&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;Useful Layouts&lt;/h2&gt;   &lt;ul&gt; &lt;li&gt;Some layout classes are &lt;code&gt;TTCCLayout, &lt;span class="hlt"&gt;HTMLLayout, PatternLayout&lt;/span&gt;, SimpleLayout&lt;/code&gt; and &lt;code&gt;XMLLayout&lt;/code&gt;.  &lt;/li&gt;&lt;li&gt;&lt;span class="hlt"&gt;SimpleLayout and PatternLayout classes ignore Java &lt;code&gt;Throwable&lt;/code&gt; errors and exceptions.  HTMLLayout and XMLLayout handle them.&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;code&gt;SimpleLayout&lt;/code&gt; consists of the priority of the log statement, followed by " - " and then the log message itself. For example:&lt;pre&gt;DEBUG - Hello world&lt;/pre&gt;  &lt;/li&gt;&lt;li&gt;&lt;a href="http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html"&gt;&lt;code&gt;PatternLayout&lt;/code&gt;&lt;/a&gt; lets you specify the output format according to conversion patterns &lt;b&gt;similar to the C language printf function&lt;/b&gt;.  &lt;span class="hlt"&gt;For example, PatternLayout with the conversion pattern &lt;code&gt;%r [%t] %-5p %c - %m%n&lt;/code&gt; will output something like:&lt;pre&gt;176 [main] INFO  org.foo.Bar - Located nearest gas station.&lt;/pre&gt;    &lt;ul&gt;&lt;li&gt;The first field is the number of milliseconds elapsed since the start of the program.   &lt;/li&gt;&lt;li&gt;The second field is the thread making the log request.   &lt;/li&gt;&lt;li&gt;The third field is the priority of the log statement.   &lt;/li&gt;&lt;li&gt;The fourth field is the name of the category associated with the log request.   &lt;/li&gt;&lt;li&gt;The text after the '-' is the message of the statement.   &lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;You can insert any literal text within the conversion pattern.  &lt;/li&gt;&lt;li&gt;Conversion characters are:    &lt;ul&gt;&lt;span class="hlt"&gt;&lt;li&gt;&lt;b&gt;%m&lt;/b&gt;:  Outputs &lt;b&gt;your message&lt;/b&gt;.    &lt;/li&gt;&lt;li&gt;&lt;b&gt;%p&lt;/b&gt;:  Outputs the &lt;b&gt;priority&lt;/b&gt; of the logging event.    &lt;/li&gt;&lt;li&gt;&lt;b&gt;%r&lt;/b&gt;:  Outputs the &lt;b&gt;number of milliseconds elapsed since the start of the application&lt;/b&gt; until the creation of the logging event.&lt;/li&gt;&lt;/span&gt;&lt;li&gt;&lt;b&gt;%c&lt;/b&gt;: Outputs the &lt;b&gt;category&lt;/b&gt; of the logging event.  Example:  For the category name "a.b.c", the pattern &lt;code&gt;%c{2}&lt;/code&gt; will output "b.c".  &lt;code&gt;{2}&lt;/code&gt; means "output last two components of the dot-separated category name".  If no &lt;code&gt;{n}&lt;/code&gt; is there, full Category name is output by default.    &lt;/li&gt;&lt;li&gt;&lt;b&gt;%t&lt;/b&gt;:  Outputs the &lt;b&gt;name of the thread&lt;/b&gt; that generated the logging event.    &lt;/li&gt;&lt;li&gt;&lt;b&gt;%x&lt;/b&gt;:  Outputs the &lt;b&gt;nested diagnostic context (NDC)&lt;/b&gt; associated with the thread that generated the logging event. Useful when multiple clients are handled by separate threads such as in Java servlets. &lt;span class="hlt"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;%n&lt;/b&gt;:  Outputs the &lt;b&gt;platform-dependent newline&lt;/b&gt; character(s).  &lt;span class="hlt"&gt;Preferable to specifying "\n" or "\r\n" etc.&lt;/span&gt;    &lt;span class="hlt"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;%%&lt;/b&gt;:  Outputs a single &lt;b&gt;percent sign&lt;/b&gt;.    &lt;/li&gt;&lt;li&gt;&lt;b&gt;WARNING&lt;/b&gt;:  The patterns below will slow down the execution of your program somewhat. Avoid unless execution speed is not an issue.    &lt;/li&gt;&lt;li&gt;&lt;b&gt;%d&lt;/b&gt;: Outputs the date of the logging event. The date conversion specifier may be followed by a date format specifier enclosed between braces. Example: &lt;code&gt;%d{HH:mm:ss,SSS}&lt;/code&gt; or &lt;code&gt;%d{dd MMM yyyy HH:mm:ss,SSS}&lt;/code&gt;. If no date format specifier is given then ISO8601 format is assumed. The date format specifier admits the same syntax as the time pattern string of Java's &lt;code&gt;SimpleDateFormat&lt;/code&gt; which is slow.  &lt;span class="hlt"&gt;For faster performance, use &lt;code&gt;%d{ISO8601}&lt;/code&gt;&lt;/span&gt;, %d{ABSOLUTE}, %d{RELATIVE} (millisecs since program start, &lt;b&gt;fastest&lt;/b&gt;) or &lt;code&gt;%d{DATE}&lt;/code&gt; which use log4j's &lt;code&gt;ISO8601DateFormat, AbsoluteTimeDateFormat, RelativeTimeDateFormat&lt;/code&gt; and &lt;code&gt;DateTimeDateFormat&lt;/code&gt;  date formatters respectively.    &lt;span class="hlt"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;%l&lt;/b&gt;:  Outputs source code location information.  &lt;span class="hlt"&gt;Shortcut for &lt;code&gt;%C.%M(%F:%L)&lt;/code&gt;.&lt;/span&gt;    &lt;/li&gt;&lt;li&gt;&lt;b&gt;%C&lt;/b&gt;: Outputs the &lt;b&gt;fully-qualified class name of the caller&lt;/b&gt; issuing the logging request.  Example:  For the class name "org.apache.xyz.SomeClass", the pattern &lt;code&gt;%C{1}&lt;/code&gt; will output "SomeClass".  &lt;code&gt;{1}&lt;/code&gt; means "output last one component of the fully-qualified class name".  If no &lt;code&gt;{n}&lt;/code&gt; is there, full class name is output by default.    &lt;/li&gt;&lt;li&gt;&lt;b&gt;%M&lt;/b&gt;:  Outputs the &lt;b&gt;method name where the logging request was issued&lt;/b&gt;.    &lt;span class="hlt"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;%F&lt;/b&gt;:  Outputs the &lt;b&gt;file name&lt;/b&gt; where the logging request was issued.    &lt;/li&gt;&lt;li&gt;&lt;b&gt;%L&lt;/b&gt;:  Outputs the &lt;b&gt;line number&lt;/b&gt; from where the logging request was issued.    &lt;/li&gt;&lt;/ul&gt;   &lt;/li&gt;&lt;li&gt;Optionally, use format modifiers between the percent sign and the conversion character to change the minimum field width, the maximum field width and text justification within a field. &lt;ul&gt;&lt;li&gt;Use the &lt;span class="hlt"&gt;minus sign (&lt;code&gt;-&lt;/code&gt;) to left-justify within a field.  Default is to right-justify (pad on left).&lt;/span&gt;    &lt;/li&gt;&lt;li&gt;Use a &lt;span class="hlt"&gt;positive integer to specify the minimum field width.&lt;/span&gt; If the data item requires fewer characters, it is padded with space(s) on either the left or the right until the minimum width is reached. &lt;span class="hlt"&gt;&lt;b&gt;If the data item is larger than the minimum field width, the field is expanded to accommodate the data.&lt;/b&gt;&lt;/span&gt;    &lt;/li&gt;&lt;li&gt;Use a &lt;span class="hlt"&gt;period followed by a positive integer to specify the maximum field width. If the data item is longer than the maximum field, then the extra characters are removed &lt;b&gt;from the beginning of the data item and not from the end&lt;/b&gt;.&lt;/span&gt; For example, it the maximum field width is eight and the data item is ten characters long, then the first two characters of the data item are dropped. This behavior deviates from the printf function in C where truncation is done from the end. &lt;/li&gt;&lt;/ul&gt;  &lt;/li&gt;&lt;li&gt;Examples:   &lt;ul&gt;&lt;span class="hlt"&gt;&lt;li&gt;&lt;code&gt;%20c&lt;/code&gt;:  Right-justify (by default) the category name within 20 spaces minimum.   &lt;/li&gt;&lt;li&gt;&lt;code&gt;%-20c&lt;/code&gt;: Left-justify the category name within 20 spaces minimum.   &lt;/li&gt;&lt;li&gt;&lt;code&gt;%.30c&lt;/code&gt;: If the category name is longer than 30 characters, truncate (from the beginning). No minimum width and therefore, no padding if shorter than 30 characters. &lt;/li&gt;&lt;li&gt;&lt;code&gt;%20.30c&lt;/code&gt;: Right-justify if the category name is shorter than 20 characters. If category name is longer than 30 characters, then truncate from the beginning. &lt;/li&gt;&lt;li&gt;&lt;code&gt;%-20.30c&lt;/code&gt;: Left-justify if the category name is shorter than 20 characters. If category name is longer than 30 characters, then truncate from the beginning.&lt;/li&gt;&lt;/span&gt;&lt;li&gt;&lt;code&gt;%r [%t] %-5p %c %x - %m\n&lt;/code&gt;:  This is essentially the &lt;code&gt;TTCCLayout&lt;/code&gt;.   &lt;/li&gt;&lt;li&gt;&lt;code&gt;%-6r [%15.15t] %-5p %30.30c %x - %m\n&lt;/code&gt;:  Similar to the &lt;code&gt;TTCCLayout&lt;/code&gt; except that the relative time is right padded if less than 6 digits, thread name is right padded if less than 15 characters and truncated if longer, and the category name is left padded if shorter than 30 characters and truncated if longer. &lt;/li&gt;&lt;/ul&gt;   &lt;/li&gt;&lt;li&gt;ADVANCED:  You don't have to pass just Strings to log.  You can pass  your objects to the log method also.  Implement &lt;code&gt;ObjectRenderer&lt;/code&gt; to log a string representation of your object to the appender.   &lt;/li&gt; &lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110690100877243452?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110690100877243452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110690100877243452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110690100877243452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110690100877243452'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/log4net-tutorial-my-straightforward.html' title='Log4Net tutorial (my straightforward version)'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110689403636935188</id><published>2005-01-27T21:59:00.000-08:00</published><updated>2005-01-28T00:08:44.053-08:00</updated><title type='text'>Logger</title><content type='html'>It seems that Log4J is a de facto logger for the Java Developer community. Automatically, the Log4Net gets all the limelight since it is a direct port from Log4J.&lt;br /&gt;&lt;br /&gt;It is unbelievable that the project page (url below) does not provide helpful tutorials or something for people to kick start the logger. I suppose probably the developers of log4net assumed people who choose to use log4net are users from log4j. (well, at least not for me.)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://logging.apache.org/log4net/"&gt;http://logging.apache.org/log4net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Let see, after some search. These are what I found.&lt;br /&gt;&lt;br /&gt;(tutorial for ASP.NET users)&lt;br /&gt;&lt;a href="http://tom.gilki.org/programming/net/120604/"&gt;http://tom.gilki.org/programming/net/120604/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(explanation on the Log4Net, usage and design and structure)&lt;br /&gt;&lt;a href="http://www.ondotnet.com/pub/a/dotnet/2003/06/16/log4net.html?page=1"&gt;&lt;span style="text-decoration: underline;"&gt;URL&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(another explanation,in layman terms)&lt;br /&gt;&lt;a href="http://www.donews.net/shanyou/archive/2004/12/16/204289.aspx"&gt;http://www.donews.net/shanyou/archive/2004/12/16/204289.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(Console example)&lt;br /&gt;&lt;a href="http://www.codeproject.com/csharp/log4net_intro.asp"&gt;http://www.codeproject.com/csharp/log4net_intro.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/csharp/log4net_intro2.asp"&gt;http://www.codeproject.com/csharp/log4net_intro2.asp&lt;/a&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110689403636935188?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110689403636935188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110689403636935188' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110689403636935188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110689403636935188'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/logger.html' title='Logger'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110681784921168992</id><published>2005-01-27T01:22:00.000-08:00</published><updated>2005-01-27T01:24:09.210-08:00</updated><title type='text'>Coding Standard Enforcer Tool</title><content type='html'>&lt;a href="http://www.flexisoftsolutions.com./"&gt;http://www.flexisoftsolutions.com./&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Only for VS5/6 and VS.NET&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110681784921168992?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110681784921168992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110681784921168992' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110681784921168992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110681784921168992'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/coding-standard-enforcer-tool.html' title='Coding Standard Enforcer Tool'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110655548553042961</id><published>2005-01-24T01:28:00.000-08:00</published><updated>2005-01-27T23:06:55.970-08:00</updated><title type='text'>GOF Codesmith Template </title><content type='html'>&lt;span style="font-family:arial;"&gt;In refer to my previous post on the Jan 18, 2005.  One of the tools, codesmith,  and below a cool template for GOF. &lt;/span&gt;&lt;strong style="font-family: arial;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a style="font-family: arial;" href="http://www.ericjsmith.net/codesmith/forum/default.aspx?f=9&amp;m=4640"&gt;http://www.ericjsmith.net/codesmith/forum/default.aspx?f=9&amp;amp;m=4640&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110655548553042961?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110655548553042961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110655548553042961' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110655548553042961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110655548553042961'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/gof-codesmith-template.html' title='GOF Codesmith Template '/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110620616195546361</id><published>2005-01-19T23:00:00.000-08:00</published><updated>2005-01-24T00:33:24.486-08:00</updated><title type='text'>C# 2.0 language features</title><content type='html'>&lt;a href="http://www.ondotnet.com/pub/a/dotnet/2004/04/05/csharpwhidbeypt1.html"&gt;&lt;span style="font-size:85%;"&gt;http://www.ondotnet.com/pub/a/dotnet/2004/04/05/csharpwhidbeypt1.html&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ondotnet.com/pub/a/dotnet/2004/04/12/csharpwhidbeypt2.html"&gt;&lt;span style="font-size:85%;"&gt;http://www.ondotnet.com/pub/a/dotnet/2004/04/12/csharpwhidbeypt2.html&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/vcsharp/team/language/"&gt;http://msdn.microsoft.com/vcsharp/team/language/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Few major language refinement mentioned by Oreilly. &lt;/span&gt;&lt;br /&gt;&lt;ul style="font-family: arial;"&gt;   &lt;li&gt;     &lt;h3  style="font-weight: normal;font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;Anonymous Methods&lt;/span&gt;&lt;/h3&gt;   &lt;/li&gt;   &lt;li&gt;     &lt;h3  style="font-weight: normal;font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;Iterators&lt;/span&gt;&lt;/h3&gt;   &lt;/li&gt;   &lt;li  style="font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;Partial Classes&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;     &lt;h3  style="font-weight: normal;font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;Generics 101&lt;/span&gt;&lt;/h3&gt;   &lt;/li&gt; &lt;/ul&gt; &lt;h3&gt;&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110620616195546361?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110620616195546361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110620616195546361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110620616195546361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110620616195546361'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/c-20-language-features.html' title='C# 2.0 language features'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110612400317494308</id><published>2005-01-19T01:31:00.000-08:00</published><updated>2005-01-24T00:34:04.380-08:00</updated><title type='text'>A tutorial to connect to open source project with WinCVS.</title><content type='html'>(quoted from &lt;a href="http://www.compiere.org/technology/build.html"&gt;http://www.compiere.org/technology/build.html) &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Reason I copy all over to my blog is that overtime I notice many web sites will be either dissapeared, content changed or URL broken after some times. Just do not want to search here and there again for the same stuff. Therefore I just place the whole thing here for my sake of future references. The credit should still be all dued to the real authors.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;These are the steps to build Compiere from Source:&lt;/p&gt;         &lt;ol&gt; &lt;li&gt;Download the &lt;a href="http://sourceforge.net/cvs/?group_id=29057" target="sf"&gt;CVS&lt;/a&gt; &lt;strong&gt;compiere-all&lt;/strong&gt; module (details see below)&lt;/li&gt;&lt;li&gt;In the &lt;i&gt;utils-dev&lt;/i&gt; sub-directory           &lt;ul&gt;&lt;li&gt;customize the myDevEnv.bat file&lt;/li&gt;&lt;li&gt;execute  RUN_build.bat&lt;/li&gt;&lt;/ul&gt;         &lt;/li&gt; &lt;/ol&gt;         &lt;p&gt;We internally use Eclipse, but you are able to use any IDE or Java development environment to build Compiere form Source.&lt;/p&gt;         &lt;p&gt;Please note that there is a &lt;strong&gt;delay&lt;/strong&gt; between the CVS commit and it's availability in anomynous (general) CVS access - up to 24 hours according to SourceForge. Usually it does NOT create a problem, but it has resulted in compile errors. In that case, please re-download. &lt;/p&gt;         &lt;p&gt;Related links: &lt;/p&gt;         &lt;ul&gt; &lt;li&gt; &lt;a href="http://www.compiere.org/technology/multi/translation.html"&gt;Translation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.compiere.org/technology/integration/index.html"&gt;Integration&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.compiere.org/technology/integration/extend.html"&gt;Extending Compiere&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;         &lt;p&gt;See also Jaume's &lt;a href="http://www.rocacorbit.com/techdocs/compiere_linux_build.html" target="_blank"&gt;guide&lt;/a&gt;&lt;/p&gt;         &lt;h4&gt;CVS Download&lt;/h4&gt;         &lt;p&gt;If you are on the developer list (i.e. have CVS write privileges), you need to install ssh (see below). Here is are some helpful CVS links:&lt;/p&gt;         &lt;ul&gt; &lt;li&gt;&lt;a href="http://sourceforge.net/cvs/?group_id=29057" target="sf"&gt;Compiere                CVS settings&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://sourceforge.net/docman/?group_id=1" target="sf"&gt;SourceForge                CVS documentation (#6)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;If you have problems with CVS setup, please directly contact &lt;a href="https://sourceforge.net/tracker/?group_id=1&amp;atid=200001" target="sf"&gt;SorceForge&lt;/a&gt;                (not the Compiere project).&lt;/li&gt; &lt;/ul&gt;         &lt;h4&gt;General CVS (anonymous) Download&lt;/h4&gt;         &lt;p&gt;There is the general procedure to download the source:&lt;/p&gt;         &lt;ul&gt; &lt;li&gt;Get any CVS client&lt;/li&gt;&lt;li&gt;Execute&lt;br /&gt;         &lt;span style=""&gt;cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/compiere           login&lt;br /&gt;       cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/compiere         checkout compiere-all &lt;/span&gt;&lt;/li&gt; &lt;/ul&gt;         &lt;p&gt;Alternatively, you can&lt;/p&gt;         &lt;ul&gt; &lt;li&gt;follow the install steps below with the "pserver" connection option&lt;br /&gt;         (you can skip the ssh installation)&lt;/li&gt;&lt;li&gt;also download the nightly CVS Tree &lt;a href="http://cvs.sourceforge.net/cvstarballs/compiere-cvsroot.tar.gz"&gt;Tarball&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;download individual files via the CVS &lt;a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/compiere/" target="sf"&gt;web&lt;/a&gt; interface&lt;/li&gt; &lt;/ul&gt;         &lt;h4&gt;Developer &amp;amp; Anonymous CVS Download under Windows&lt;/h4&gt;         &lt;p&gt;If you are developing under Linux/Unix, things are a bit easier with CVS. Here one way to get CVS working on Windows 2000&lt;/p&gt;         &lt;h5&gt;Enabling SSH&lt;/h5&gt;         &lt;p&gt;You can skip this step, if you are not on the developer list and just want to download the source. One way is to install &lt;a href="http://www.cygwin.com/" target="_blank"&gt;Cygwin&lt;/a&gt; which gives you Unix utilities under Windows. Make sure, that you install OpenSSH (in the Net category).&lt;/p&gt;         &lt;p&gt;         Start Cygwin and connect to SourceForge:&lt;/p&gt;         &lt;p&gt;ssh -l &lt;sourceforgeuserid&gt; compiere.sorceforge.net&lt;br /&gt;       ssh -l &lt;sourceforgeuserid&gt; cvs.sorceforge.net&lt;/sourceforgeuserid&gt;&lt;/sourceforgeuserid&gt;&lt;/p&gt;         &lt;p&gt;(example: ssh -l jjanke compiere.sourceforge.net)&lt;/p&gt;         &lt;p&gt;This adds the SourceForge hosts to the list of known hosts and shows that you have a valid user ID. The connection to cvs.compiere.sorceforge.net is immediate closed, but this step is required to add it to the list of known hosts.&lt;/p&gt;         &lt;h5&gt;Install CVS Client&lt;/h5&gt;         &lt;p&gt;There are many CVS clients available. We use &lt;a href="http://www.wincvs.org/" target="_blank"&gt;WinCvs&lt;/a&gt; (if you have trouble connecting, download &lt;a href="http://prdownloads.sourceforge.net/cvsgui/WinCvs13b10.zip" target="_blank"&gt;directly&lt;/a&gt;).&lt;/p&gt;         &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You can use any CVS client (e.g. the command line option 'cvs' in Cygwin), when you set the environment variables CVSROOT (and CVS_RSH for SSH access).&lt;/p&gt;         &lt;p&gt;Check also the &lt;a href="http://sourceforge.net/cvs/?group_id=29057" target="sf"&gt;Compiere&lt;/a&gt; settings and the SourceForge CVS &lt;a href="http://sourceforge.net/docman/?group_id=1" target="sf"&gt;documentation&lt;/a&gt; (F). The WinCSV project has very good general CVS documentation.&lt;/p&gt;         &lt;h5&gt;General (anonymous) CVS Access:&lt;/h5&gt;         &lt;p&gt;CVSROOT=:pserver:anonymous@cvs.sourceforge.net:/cvsroot/compiere&lt;/p&gt;         &lt;p&gt;In WinCVS enter&lt;/p&gt;         &lt;p&gt;Authentication: pserver&lt;br /&gt;Path: /cvsroot/compiere&lt;br /&gt;Host address: cvs.sourceforge.net&lt;br /&gt;User name: anonymous&lt;/p&gt;         &lt;p&gt;Then checkout "compiere-all" via the menu Create &gt; Checkout module ... and enter&lt;/p&gt;         &lt;p&gt;Module name: compiere-all&lt;br /&gt;Location: &lt;some&gt;&lt;/some&gt;&lt;/p&gt;         &lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;         &lt;p&gt;&lt;img src="http://www.compiere.org/technology/images/wincvs_A1.jpg" alt="CVS Checkout" height="327" width="452" /&gt;&lt;/p&gt;         &lt;p&gt;&lt;img src="http://www.compiere.org/technology/images/wincvs_A2.jpg" alt="CVS Connection Settings" height="327" width="452" /&gt;&lt;/p&gt;         &lt;p&gt;&lt;img src="http://www.compiere.org/technology/images/wincvs_A3.jpg" alt="CVS PServer Settings" height="250" width="374" /&gt;&lt;/p&gt;         &lt;p&gt;The command line equivalent is:&lt;/p&gt;         &lt;p&gt;&lt;span style=""&gt;cvs -d:pserver:anonymous@cvs.compiere.sourceforge.net:/cvsroot/compiere login&lt;br /&gt;                 cvs  -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/compiere co compiere-all&lt;/span&gt;&lt;/p&gt;         &lt;h5&gt;For Developer CVS Access via SSH:&lt;/h5&gt;         &lt;p&gt;For this, you need to be on the Compiere Developer List. Follow the steps above, but note the following changes:&lt;/p&gt;         &lt;p&gt;Authentication: &lt;strong&gt;ssh&lt;/strong&gt;&lt;br /&gt;Path: /cvsroot/compiere&lt;br /&gt;Host address: cvs.sourceforge.net&lt;br /&gt;User name: &lt;strong&gt;&lt;your&gt;&lt;br /&gt;Select: Show CVS console&lt;br /&gt;In ssh Settings enable Additional ssh options: -v&lt;/your&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;         &lt;p&gt;Set the following System Environment Variables:&lt;/p&gt;         &lt;p&gt;CVS_RSH=C:\cygwin\bin\ssh.exe (or the location of the ssh executable)&lt;br /&gt;       CVSROOT=:ext:&lt;sourceforgeuserid&gt;@cvs.sourceforge.net:/cvsroot/compiere&lt;/sourceforgeuserid&gt;&lt;/p&gt;         &lt;p&gt;The command line equivalent is:&lt;/p&gt;         &lt;p&gt;&lt;span style=""&gt;cvs  -d:ext:&lt;sourceforgeuserid&gt;@cvs.sourceforge.net:/cvsroot/compiere co compiere-all&lt;/sourceforgeuserid&gt;&lt;/span&gt;&lt;/p&gt;         &lt;p&gt;&lt;span style=""&gt;e.g.&lt;br /&gt;       &lt;/span&gt;&lt;span style=""&gt;cvs  -d:ext:jjanke@cvs.sourceforge.net:/cvsroot/compiere co compiere-all&lt;/span&gt;&lt;/p&gt;         &lt;h4&gt;Compiling / Building Compiere &lt;/h4&gt;         &lt;p&gt;The CVS tree has all required libraries - you just need a Java 1.4.2 SDK&lt;/p&gt;         &lt;h5&gt;Customize myDevEnv.bat / myDevEnv.sh&lt;/h5&gt;         &lt;p&gt;The files are located in the utils_dev directory. Define the path of Java executable, source, and build area. Executing the script creates the keystore required for signing jar files for the use with WebStart. If you are distributing the build, you may want to get a Java code signing certificate. &lt;/p&gt;         &lt;h5&gt;Execute RUN_build.bat / RUN_build.sh&lt;/h5&gt;         &lt;p&gt;The files are located in the utils_dev directory. It compiles the sources and builds the distribution files.&lt;/p&gt;         &lt;p&gt;If you are using an IDE like Eclipse, you need to define projects.        &lt;br /&gt;     CVS contains the Eclipse .project files.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110612400317494308?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110612400317494308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110612400317494308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110612400317494308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110612400317494308'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/tutorial-to-connect-to-open-source.html' title='A tutorial to connect to open source project with WinCVS.'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110611679471445933</id><published>2005-01-18T22:31:00.000-08:00</published><updated>2005-01-30T23:05:21.963-08:00</updated><title type='text'>Ten Must-Have Tools Every Developer Should Download Now (.NET)</title><content type='html'>&lt;span style="font-size:85%;"&gt;The &lt;a href="http://msdn.microsoft.com/vstudio/default.aspx?pull=/msdnmag/issues/04/07/musthavetools/default.aspx"&gt;URL&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It basically introduces,&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;  &lt;ul&gt;    &lt;li&gt;&lt;span class="clsSubhead"&gt;Snippet Compiler &lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span class="clsSubhead"&gt;Regulator (regex tool)&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span class="clsSubhead"&gt;CodeSmith&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span class="clsSubhead"&gt;NUnit (unit tester.)&lt;/span&gt;&lt;/li&gt;   &lt;ul&gt;     &lt;li&gt;&lt;span class="clsSubhead"&gt;&lt;a href="http://www.nunit.org/"&gt;NUnit: http://www.nunit.org/&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;     &lt;li&gt;&lt;a class="external" href="http://www.csunit.org/" target="_blank"&gt;http://www.csunit.org/&lt;/a&gt; (an alternative to NUnit)&lt;/li&gt;     &lt;li&gt;&lt;span class="clsSubhead"&gt;&lt;a href="http://nmock.truemesh.com/"&gt;NMock : http://nmock.truemesh.com/&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;     &lt;li&gt;&lt;a class="external" href="http://sourceforge.net/projects/dotnetmock/" target="_blank"&gt;http://sourceforge.net/projects/dotnetmock/&lt;/a&gt;&lt;/li&gt;     &lt;li&gt;&lt;a class="external" href="http://www.mockobjects.com/" target="_blank"&gt;http://www.mockobjects.com/&lt;/a&gt;&lt;/li&gt;     &lt;li&gt;&lt;span class="clsSubhead"&gt;&lt;a href="http://nunitforms.sourceforge.net/download.html"&gt;NUnitForms http://nunitforms.sourceforge.net/download.html&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;     &lt;li&gt;&lt;span class="clsSubhead"&gt;&lt;a href="http://www.objectmentor.com/resources/articles/TheHumbleDialogBox.pdf"&gt;The Humble Dialog Box&lt;/a&gt;&lt;br /&gt;      &lt;/span&gt;&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a style="display: none;" name="S9"&gt;&lt;/a&gt;&lt;span class="clsSubhead"&gt;Lutz Roeder's .NET Reflector (ildasn advanced) &lt;a href="http://www.aisto.com/roeder/dotnet/"&gt;http://www.aisto.com/roeder/dotnet/&lt;/a&gt;&lt;br /&gt;  &lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span class="clsSubhead"&gt;FxCop&lt;br /&gt;  &lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span class="clsSubhead"&gt;NDoc&lt;br /&gt;  &lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span class="clsSubhead"&gt;NAnt (.NET based builder)&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;ASP.NET Version Switche&lt;/li&gt;   &lt;li&gt;&lt;span class="clsSubhead"&gt;Project Convertor&lt;br /&gt;  &lt;/span&gt;&lt;/li&gt;  &lt;/ul&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110611679471445933?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110611679471445933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110611679471445933' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110611679471445933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110611679471445933'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/ten-must-have-tools-every-developer.html' title='Ten Must-Have Tools Every Developer Should Download Now (.NET)'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110604396323271647</id><published>2005-01-18T02:24:00.000-08:00</published><updated>2005-01-18T02:26:03.233-08:00</updated><title type='text'>.NET Memory Profiler</title><content type='html'>&lt;span style="font-family: arial;"&gt;Found this &lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;a style="font-family: arial;" href="http://www.scitech.se/memprofiler/snapshotviews.htm"&gt;http://www.scitech.se/memprofiler/snapshotviews.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;in the forum. Seems like it capable to be used to optimize the .NET application.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110604396323271647?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110604396323271647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110604396323271647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110604396323271647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110604396323271647'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/net-memory-profiler.html' title='.NET Memory Profiler'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110594821420210230</id><published>2005-01-16T23:49:00.000-08:00</published><updated>2005-01-16T23:50:14.203-08:00</updated><title type='text'>Moving Forward &gt;&gt;&gt; .NET Reality Check</title><content type='html'>(quoted from &lt;a href="http://forums.sgdotnet.org/ShowPost.aspx?PostID=3281"&gt;http://forums.sgdotnet.org/ShowPost.aspx?PostID=3281&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-family: arial;"&gt;Hello,&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;To follow up with my previous email about the deprecation of SOAPFormatter in .NET 2.0, I am wondering how many ppl here uses heavy-duty remoting in their projects. If you are, how are you securing that channel ? Are you using Custom Sinks for that ? Or are you using Enterprise Services ? If you are using Custom Formatters and Sinks, please minimize the use of it as it is NOT a strategic step moving forward.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;The reason why i am asking is because Microsoft's focus is on Web services, Remoting is not getting a whole lot of new features going forward. Thus, it is not a long-term strategic technology. The deprecation of SOAPFormatters is just the beginning. To move forward to Indigo which will significantly change a lot of things (for the better...), it will also change the way you look at XML Services. Notice that I dropped the word "Web"...You may also need to change the way you look at communication...such as dumping the mindset of the RPC-ish way of communication, etc...&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;Indigo is something that has caught my excitment and is probably the only technology in recent years that is worth its money Smile In fact, its the only technology that has got me going for the last few months. It will really open up the way SOAP is supposed to be...and not the SOAP we are seeing today, which offers very little options of MEPs..which is why SOAP is no more an acronym for "Simple Object Access Protocol". In SOAP 1.2, SOAP is just SOAP.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;Therefore, shielding your code from specific implementations is of critical importance. I know it is a little bit tough but I recommend against using physical tiers to start with. Use layers - gain maintainability and reuse. But don't use tiers...Try NOT to anyways. Tiers are complex, expensive and slow and may not be as future-proof as you think. Networks deter performance more than you think. In fact, the costs of remoting across multiple machines outweigh the benefits of it.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;I took a few tips on moving expectations forward to Indigo. Please ping me if need further clarifications.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;1) Use ASMX enhanced with WSE if required. The key word is "If Required" WSE is supported and is the only supported Advanced Web Services Toolkit today. Even IBM's ETK is NOT suppported...However, compatibility is an issue with the different flavours of WSE as the standards are changing too fast today.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;By implementing your service in ASMX/WSE, your service will automatically have an explicit boundary, expressed in a standards-based schema, sharing standards-based schematized data documents and will communicate over open standards transports. This cannot be said of ES or Remoting components!&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;2) Inside my service, I need to spread my implementation across n physical tiers and therefore need to call objects on remote machines.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;If you can implement the logic on each of the physical tiers as individual services, do so! By implementing mini-services inside your larger service, you'll be more closely aligning yourself with Microsoft's entire Distributed Applications strategy and will reap great benefits when Indigo is released. And I add that we are NOT talking just about Microsoft, most major technology vendors will have their goals of Distributed Applications very much aligned with each other. The coming of WS-I and the rolling out of WS-BP1.0 is a major milestone to reach there.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;3) Operations within my Service involve retrieving, storing and processing high volumes of complex data and requires many traversals between objects.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;Consider consolidating the code which performs the highest number of communication traversals on the same physical box to avoid the penalty imposed by traversing the network. Architects and Designers need to take note of that as latency must be kept in check. Play within the sandbox wisely Smile&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;If you must physically separate components (ie: on separate boxes) which need to exhange large amounts of data or communicate intensively, use .NET Enterprise Services (ES) components on each tier. The reason we opt for ES here is that ES uses DCOM on the wire and is by far the fastest technology on the Microsoft platform for remoting object invocations and data exchanges. Again, consider wrapping access to this portion of your Service with ASMX.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;If you call ES components on the local box, consider configuring and activating them as Library (in-process) rather than Server (out-of-process) components wherever possible - especially if you are able to locate all on the same physical box.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;4) I need to communicate between two components in different AppDomains inside the same process&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;This is the second of the two scenarios where .NET Remoting is recommended. Remoting has explicit high-performance support for cross-AppDomain communications. Note that this is only for communications between AppDomains inside the same process. If you have two .NET components that must be hosted in two different processes (on the same machine), I recommend implementing the logic as .NET ES components hosted in COM+...Yes, use DCOM !!!&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;.NET Remoting is NOT the fastest way to call a remote object! .NET Enterprise Services is! Note that by remote, I mean an object that runs in a process remote from yours ... whether it's on a remote process or a remote machine! Google in MSDN for papers on performance comparisons between these two. I think you will be surprised how Remoting doesnt have much of a performance edge, if at all...&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;5) I believe that there are recent papers (one is published in .NET Asia) that does some performance comparisons between Binary and SOAP Calls and I think everyone is surprised at how fast SOAP, if designed properly, can be. The architects and the designers have to make their decisions based on their findings. If the interop benefits of SOAP greatly outweighs the performance lags of it (even if it is proven more and more these days), we have to sell the story of being more "future-proof" and "interop-proof".&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;To summarize, COM / COM+ will not disappear, it will be part of hybrid solutions, and transparent to the service interface.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;Remoting is useful for crossing app domains, but not for crossing machine boundaries. Use it for fault tolerance within a process (one app domain goes down, the main process stays alive). Again, I empahsize on the careful design implementations of it. It is NOT that "future-proof" !&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;Crossing machines and processes, with NO Doubt ! --- DCOM is fastest binary protocol, and can be secured, which means EnterpriseServices (ES). This means and facilitates transactions and guarantees message delivery. Your ES investment with COM+, MSMQ WILL be supported by the world of Indigo.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;On ASMX serialization vs. binary serialization with remoting, ASMX will be faster than .NET remoting. I will give a couple of presentations soon on the next generation of XML Serialization in .NET 2.0 explains it all and how performance (SGEN, Decompression on HTTP and TCP, etc) is the key thing the XML Serialization team is working on moving forward in .NET 2.0 to Indigo.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;Do take note that short term performance gains using remoting today will not position your applications for future releases (I.e., Indigo). Like I said above, you can expect better performance with ASMX in future as programming models change, and usually what impacts performance most is usually bad architecture, including hardware choices, physical tier distribution and bad designs that are NOT well thought of. Some issues that I have come across are the use of Datasets (a NO ! NO ! in distributed designs -- &gt; Interop is a big problem and Datasets are TOO verbose), the inclusions of Data Schemas at the wire level when traversing network calls, etc. One thing that will also support performance improvement at a more granular level is also XML parsers…There are better and more efficient XML Writers and Readers coming up, something the same XML Messaging and Serialization team is working on.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;How many WS* protocols do we need? Less. SOAP/XML is a great start. WS-Security is critical for end to end message integrity. We need standard protocols for interoperability, thus we need tools to assist with serialization, such as WSE 2.0.&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;WSE 2.0 gives us a chance to work with WS* protocols now, while waiting for Indigo. The important thing is to realize it is taking you in the right direction. These standards move fast, so does the WSE team. Indigo will just swallow it all making it even easier once standards are more stable.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;Thank you.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;~Softwaremaker (BLOG)&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;M. Twain: "I didn't have time to write a short letter, so I wrote a long one instead" &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110594821420210230?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110594821420210230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110594821420210230' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110594821420210230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110594821420210230'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/moving-forward-net-reality-check_16.html' title='Moving Forward &gt;&gt;&gt; .NET Reality Check'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110576350631720100</id><published>2005-01-14T20:28:00.000-08:00</published><updated>2005-01-18T02:37:59.710-08:00</updated><title type='text'>Ways to prevent virus (manually without AV)</title><content type='html'>&lt;span style="font-family: arial;"&gt;A hands-on knowledge for anyone who wants to prevent virus attack  manually.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/03/05/VirusHunting/default.aspx"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: arial;"&gt;http://msdn.microsoft.com/msdnmag/issues/03/05/VirusHunting/default.aspx&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110576350631720100?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110576350631720100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110576350631720100' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110576350631720100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110576350631720100'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/ways-to-prevent-virus-manually-without.html' title='Ways to prevent virus (manually without AV)'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110576228697871617</id><published>2005-01-14T20:10:00.000-08:00</published><updated>2005-01-14T20:11:26.976-08:00</updated><title type='text'>COM spying tool</title><content type='html'>&lt;a href="http://www.ddevel.com/DrCOM/DrCOMMonitor.asp"&gt;http://www.ddevel.com/DrCOM/DrCOMMonitor.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope this will solve some of my COM debugging problems.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9937599-110576228697871617?l=anthony-yio.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anthony-yio.blogspot.com/feeds/110576228697871617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9937599&amp;postID=110576228697871617' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110576228697871617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9937599/posts/default/110576228697871617'/><link rel='alternate' type='text/html' href='http://anthony-yio.blogspot.com/2005/01/com-spying-tool.html' title='COM spying tool'/><author><name>Anthony Yio</name><uri>http://www.blogger.com/profile/08355770488301690195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9937599.post-110570152159009509</id><published>2005-01-14T03:10:00.000-08:00</published><updated>2005-01-27T23:22:14.256-08:00</updated><title type='text'>From Microsoft Developer Guide - Signing Assembly</title><content type='html'>&lt;span style="font-family:arial;font-size:100%;"&gt;Happen to read the Microsoft Developer Guide that my colleague received in the Ms Technet in Sunway Pyramid. Found a few useful tips. (well, although this could be easily found in MSDN or by googling) But want to jot it down for my future references.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;font-family:arial;font-size:100%;"  &gt;Create a key pair and sign the assembly&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;Sign assembly. Run “sn” utility, add the key file by hand, or use IDE to generate strong name.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;1. In the solution explorer, double click on the AssemblyInfo.vb and edit.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;2. Modify AssemblyTitle and AssemblyDescription lines to be &lt;/span&gt;&lt;br /&gt;- &amp;lt; Assembly: AssemblyTitle(“ClassName”) &amp;gt;&lt;br /&gt;- &amp;lt; Assembly: AssemblyDescription(“.NET Version of PhysServer”) &amp;gt;&lt;br /&gt;&lt;assembly:&gt;&lt;assembly:&gt;&lt;assembly:&gt;&lt;/ASSEMBLY:&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;3. In the solution Explorer, right click project node, choose “Properties”. Click “Common Properties” folder and then “Strong Name” property page. Select box labeled “Generate Strong Name Using”. Click “Generate Key” to generate a key file and add to the project. Click OK then, build.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;font-family:arial;font-size:100%;"  &gt;Register Assembly and create type library&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;Go to Ms Visual Studio .NET tools shortcut – Command prompt&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;Type&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;Regasn /tlb:YourClassLib.tlb YourClassLib.dll&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;(for deploying application for COM access)&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;type&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;tlbexp YourClassLib.dll /out: YourClassLib.tlb&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;(for converting COM to .NET)&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;tlbimp MyCOM .dll /out:MyCOMNetSupport.dll&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;Add Assembly to Global Assembly Cache&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;Go to Ms Visual Studio .NET tools shortcut – Command prompt&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;Type&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:100%
