<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>.:Doing my little part, changing the world:. &#187; Visual C++</title>
	<atom:link href="http://bono02.wordpress.com/category/visual-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://bono02.wordpress.com</link>
	<description>I want to change the world! I have my part!</description>
	<lastBuildDate>Sun, 23 Aug 2009 08:03:21 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='bono02.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/d6b49e06335a94b8ce6115b9d1952986?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>.:Doing my little part, changing the world:. &#187; Visual C++</title>
		<link>http://bono02.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://bono02.wordpress.com/osd.xml" title=".:Doing my little part, changing the world:." />
		<item>
		<title>Several small but important functions</title>
		<link>http://bono02.wordpress.com/2007/01/25/several-small-but-important-functions/</link>
		<comments>http://bono02.wordpress.com/2007/01/25/several-small-but-important-functions/#comments</comments>
		<pubDate>Thu, 25 Jan 2007 17:33:05 +0000</pubDate>
		<dc:creator>Bondhan Novandy</dc:creator>
				<category><![CDATA[Visual C++]]></category>

		<guid isPermaLink="false">http://bono02.wordpress.com/2007/01/25/several-small-but-important-functions/</guid>
		<description><![CDATA[Well, at this moment I am doing a small project, writing a GUI for Mitsubishi MoveMasterEx-1, robot arm. It is quite old but still good enough for lab practice or for learning. I am now writing some code for the GUI. The GUI itself will talk to a microcontroller, and I am using AVR ATMega16. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bono02.wordpress.com&blog=532246&post=7&subd=bono02&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>W</strong>ell, at this moment I am doing a small project, writing a GUI for Mitsubishi MoveMasterEx-1, robot arm. It is quite old but still good enough for lab practice or for learning. I am now writing some code for the GUI. The GUI itself will talk to a microcontroller, and I am using AVR ATMega16. The controller then will send signal to the driver then to the DC motor. The DC Motor will return encoder pulse to the circuit. I will need to find the value of the degree rotation . Actually, I haven&#8217;t gone that far <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p align="center"><a href="http://bono02.files.wordpress.com/2007/01/cimg0155_resized.jpg" title="Mitsubishi MoveMasterEx-1"><img src="http://bono02.files.wordpress.com/2007/01/cimg0155_resized.jpg?w=462&#038;h=347" alt="Mitsubishi MoveMasterEx-1" height="347" width="462" /></a></p>
<p>FYI, I am new in VC++, that&#8217;s why I would like to share several small functions but important. Here we go:</p>
<p><strong>Converting int to CString or LPCTSTR:</strong></p>
<p>CString CMOVEMASTERDlg::IntToString(int Nilai)<br />
{</p>
<blockquote><p>//refer to MSDN:     ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vccrt/html/eb746581-bff3-48b5-a973-bfc0a4478ecf.htm</p></blockquote>
<blockquote><p>char charBuffer[65];</p>
<p>CString temp;</p>
<p>if ( _itoa_s(Nilai, charBuffer, 65, 10)  !=  0) //if conversion goes wrong<br />
{<br />
AfxMessageBox(_T(&#8220;Error converting int to LPCTSTR or CString&#8221;), MB_ICONERROR | MB_OK);<br />
::MessageBeep(MB_ICONEXCLAMATION);<br />
}</p>
<p>temp = charBuffer;</p>
<p>return temp;</p></blockquote>
<p>}</p>
<p>Though this function is really simple, but if you have read the UNICODE things, or wide character sometimes as a newbie you will get confused <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><strong>Auto Scrolling in CEdit Class:</strong></p>
<p>//The Scroll to the last line<br />
this-&gt;LineScroll (GetLineCount(), 0);</p>
<p>For automatic scrolling, you need to add this line on your code after you add/insert string in the CEdit control.</p>
<p><strong>Readonly Text Edit (CEdit Class):</strong></p>
<p>m_EditOutput.SetBackColor(RGB(255,255,255));<br />
m_EditOutput.SetTextColor(RGB(0,0,0));</p>
<p>The secret for any Text Edit control with the same background and text color is that you set the background and textcolor manuall. Add these 2 lines on your code (on the OnInitDialog())</p>
<p>Guess, If there&#8217;s any new things I learned, I will share in this blog <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/bono02.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/bono02.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bono02.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bono02.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bono02.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bono02.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bono02.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bono02.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bono02.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bono02.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bono02.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bono02.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bono02.wordpress.com&blog=532246&post=7&subd=bono02&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bono02.wordpress.com/2007/01/25/several-small-but-important-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce973d04c8a663398081f5f440344518?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">bondan</media:title>
		</media:content>

		<media:content url="http://bono02.files.wordpress.com/2007/01/cimg0155_resized.jpg" medium="image">
			<media:title type="html">Mitsubishi MoveMasterEx-1</media:title>
		</media:content>
	</item>
	</channel>
</rss>