<?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-2704602415454722420</id><updated>2012-02-16T01:07:34.343-08:00</updated><category term='Compact the text to fit in a rectangle'/><title type='text'>C/C++, MFC and WinAPI programming</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mfcprogramming.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2704602415454722420.post-3718757738091431904</id><published>2010-10-20T01:06:00.000-07:00</published><updated>2010-10-20T01:19:19.992-07:00</updated><title type='text'>Modify the pasting text of edit control in the clipboard</title><content type='html'>The steps are:&lt;br /&gt;1. Inherit CEdit. For example CMyEdit&lt;br /&gt;&lt;br /&gt;2. Handle WM_PASTE message&lt;br /&gt;BEGIN_MESSAGE_MAP(CMyEdit, CEdit)&lt;br /&gt;ON_MESSAGE(WM_PASTE, OnEditPaste)&lt;br /&gt;END_MESSAGE_MAP()&lt;br /&gt;&lt;br /&gt;3. OnEditPaste() method&lt;br /&gt;- Open the clip board&lt;br /&gt;- Read the clip board text&lt;br /&gt;- Modify the text&lt;br /&gt;- Write the text in the clip board&lt;br /&gt;&lt;br /&gt;LRESULT CMyEdit::OnEditPaste(WPARAM /*wParam*/, LPARAM /*lParam*/)&lt;br /&gt;{&lt;br /&gt;#ifdef UNICODE&lt;br /&gt;UINT nFlag = CF_UNICODETEXT;&lt;br /&gt;#else&lt;br /&gt;UINT nFlag = CF_TEXT;&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;if(!IsClipboardFormatAvailable(nFlag))&lt;br /&gt;return 1;&lt;br /&gt;&lt;br /&gt;if(!OpenClipboard())&lt;br /&gt;return 1;&lt;br /&gt;&lt;br /&gt;HGLOBAL hData = GetClipboardData(nFlag);&lt;br /&gt;if(hData != NULL)&lt;br /&gt;{&lt;br /&gt;CString strText;&lt;br /&gt;LPTSTR lptstr = (LPTSTR)GlobalLock(hData);&lt;br /&gt;if(lptstr != NULL)&lt;br /&gt;{&lt;br /&gt;strText = lptstr;&lt;br /&gt;// Modify the text&lt;br /&gt;}&lt;br /&gt;GlobalUnlock(hData);&lt;br /&gt;&lt;br /&gt;EmptyClipboard();&lt;br /&gt;&lt;br /&gt;HGLOBAL buff = GlobalAlloc(GMEM_DDESHARE, (strText.GetLength() + 1) * sizeof(TCHAR));&lt;br /&gt;if(buff != NULL)&lt;br /&gt;{&lt;br /&gt;lptstr = (LPTSTR)GlobalLock(buff);&lt;br /&gt;_tcscpy(lptstr, strText.GetBuffer());&lt;br /&gt;strText.ReleaseBuffer();&lt;br /&gt;GlobalUnlock(buff);&lt;br /&gt;SetClipboardData(nFlag, buff);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;CloseClipboard();&lt;br /&gt;&lt;br /&gt;Default();&lt;br /&gt;&lt;br /&gt;return 1;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2704602415454722420-3718757738091431904?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/3718757738091431904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/3718757738091431904'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2010/10/modify-pasting-text-of-edit-control-in.html' title='Modify the pasting text of edit control in the clipboard'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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></entry><entry><id>tag:blogger.com,1999:blog-2704602415454722420.post-8990760478300656116</id><published>2010-07-07T06:13:00.000-07:00</published><updated>2010-07-07T06:28:08.535-07:00</updated><title type='text'>Unicode file encryption/decryption</title><content type='html'>Here is an overview of how we will encrypt/decrypt an unicode file&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Encryption:&lt;br /&gt;&lt;br /&gt;1. Open the file as binary mode and read the content of file to a byte array.&lt;br /&gt;&lt;br /&gt;2. Encrypt the byte array.&lt;br /&gt;&lt;br /&gt;3. Write the byte array to a file.&lt;br /&gt;&lt;br /&gt;Decryption:&lt;br /&gt;&lt;br /&gt;1.  Open the encrypted file as binary mode and read content of the file to a byte array.&lt;br /&gt;&lt;br /&gt;2. Decrypt the byte array.&lt;br /&gt;&lt;br /&gt;3. Write the byte array to a file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The encryption and decryption functions are:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void EncryptBytes&lt;br /&gt;(&lt;br /&gt;   unsigned char*  pByte,  // Bytes passed in, encrypted bytes passed out.&lt;br /&gt;   int      iSize,         // Size of the byte array   &lt;br /&gt;   int*   pKey             // Encrypting key. (in/out)&lt;br /&gt;&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;    int   ii = 0; &lt;br /&gt;    unsigned char iNew = 0;&lt;br /&gt;    for(ii = 0; ii &lt; iSize; ii++)&lt;br /&gt;    {&lt;br /&gt;        // Encrypt the character.&lt;br /&gt;        iNew = pByte[ii] ^ ((*pKey &gt;&gt; 8));&lt;br /&gt;        *pKey = ((iNew + *pKey) &amp; 0xFFFF)*EncryptConst1 - EncryptConst2;&lt;br /&gt;        pByte[ii] = iNew;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void  DecryptBytes&lt;br /&gt;(&lt;br /&gt;   unsigned char*  pByte,     // Bytes passed in, decrypted bytes passed out.&lt;br /&gt;   int      iSize,            // Size of the byte array  &lt;br /&gt;   int*   pKey                // Encrypting key. (in/out)&lt;br /&gt;&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;    int  ii = 0;&lt;br /&gt;    unsigned char iNew = 0, iVal;&lt;br /&gt;&lt;br /&gt;    for(ii = 0; ii &lt; iSize; ii++)&lt;br /&gt;    {&lt;br /&gt;        iVal = pByte[ii];&lt;br /&gt;        iNew = iVal ^ ((*pKey &gt;&gt; 8));&lt;br /&gt;&lt;br /&gt;        *pKey = ((iVal + *pKey) &amp; 0xFFFF)*EncryptConst1 - EncryptConst2;&lt;br /&gt;        pByte[ii] = iNew;&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/2704602415454722420-8990760478300656116?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/8990760478300656116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/8990760478300656116'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2010/07/unicode-file-encryptiondecryption.html' title='Unicode file encryption/decryption'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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></entry><entry><id>tag:blogger.com,1999:blog-2704602415454722420.post-7155659591647473361</id><published>2010-06-21T22:48:00.000-07:00</published><updated>2010-06-21T22:49:55.245-07:00</updated><title type='text'>The goldmine for mfc, atl, java</title><content type='html'>http://mfcgoldmine.uuuq.com/Convert/index.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2704602415454722420-7155659591647473361?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/7155659591647473361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/7155659591647473361'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2010/06/goldmine-for-mfc-atl-java.html' title='The goldmine for mfc, atl, java'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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></entry><entry><id>tag:blogger.com,1999:blog-2704602415454722420.post-2447292080999626750</id><published>2010-06-14T05:01:00.000-07:00</published><updated>2010-06-14T05:02:48.878-07:00</updated><title type='text'>Syntax coloring text editor</title><content type='html'>www.scintilla.org&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2704602415454722420-2447292080999626750?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/2447292080999626750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/2447292080999626750'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2010/06/syntax-coloring-text-editor.html' title='Syntax coloring text editor'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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></entry><entry><id>tag:blogger.com,1999:blog-2704602415454722420.post-2180169062557386486</id><published>2010-06-10T05:24:00.000-07:00</published><updated>2010-06-10T05:25:37.514-07:00</updated><title type='text'>Sample Batch file</title><content type='html'>::&lt;br /&gt;::&lt;br /&gt;::&lt;br /&gt;@setlocal&lt;br /&gt;@echo on&lt;br /&gt;::&lt;br /&gt;set DIRNAME=%~dp0&lt;br /&gt;::&lt;br /&gt;::&lt;br /&gt;echo Creating Shortcut&lt;br /&gt;&lt;br /&gt;:: To Show all param just echo %*&lt;br /&gt;&lt;br /&gt;echo %DIRNAME%VisualHost_CreateShortcut.bat %*&lt;br /&gt;::&lt;br /&gt;&lt;br /&gt;PAUSE&lt;br /&gt;::&lt;br /&gt;::&lt;br /&gt;endlocal&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;@echo off&lt;br /&gt;echo -----------------------------------&lt;br /&gt;echo Shortcut Name     : %1&lt;br /&gt;echo Shortcut Path     : %2&lt;br /&gt;echo Icon Path         : %3&lt;br /&gt;echo Launcher File     : %4&lt;br /&gt;echo ActiveConfig      : %5&lt;br /&gt;echo ActiveConfig Name : %6&lt;br /&gt;echo ActiveContext     : %7&lt;br /&gt;echo ActiveContext Name: %8&lt;br /&gt;echo -----------------------------------&lt;br /&gt;set /p name= What is your name?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2704602415454722420-2180169062557386486?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/2180169062557386486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/2180169062557386486'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2010/06/sample-batch-file.html' title='Sample Batch file'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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></entry><entry><id>tag:blogger.com,1999:blog-2704602415454722420.post-7608696735874937427</id><published>2010-06-09T23:51:00.000-07:00</published><updated>2010-06-10T00:02:22.151-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Compact the text to fit in a rectangle'/><title type='text'>Compact the text to fit in a rectangle</title><content type='html'>void CompactText(CFont* pFont, CRect rcText, CString&amp;amp; strText)&lt;br /&gt;{&lt;br /&gt;CRect rcClient;&lt;br /&gt;CClientDC clientDC(NULL);&lt;br /&gt;CDC memDC;&lt;br /&gt;CBitmap bmp;&lt;br /&gt;CBitmap* pBmpOld;&lt;br /&gt;CFont* pFontOld;&lt;br /&gt;&lt;br /&gt;if(pFont == NULL)&lt;br /&gt;return;&lt;br /&gt;&lt;br /&gt;memDC.CreateCompatibleDC(&amp;amp;clientDC);&lt;br /&gt;bmp.CreateCompatibleBitmap(&amp;amp;clientDC, rcText.Width(), rcText.Height());&lt;br /&gt;&lt;br /&gt;pBmpOld = memDC.SelectObject(&amp;amp;bmp);&lt;br /&gt;pFontOld = memDC.SelectObject(pFont);&lt;br /&gt;&lt;br /&gt;UINT nFlag = DT_NOPREFIX DT_MODIFYSTRING DT_END_ELLIPSIS DT_SINGLELINE;&lt;br /&gt;memDC.DrawText(strText, rcText, nFlag);&lt;br /&gt;&lt;br /&gt;if(pBmpOld != NULL)&lt;br /&gt;memDC.SelectObject(pBmpOld);&lt;br /&gt;&lt;br /&gt;if(pFontOld != NULL)&lt;br /&gt;memDC.SelectObject(pFontOld);&lt;br /&gt;}&lt;br /&gt;Others API releted to it:&lt;br /&gt;&lt;strong&gt;PathCompactPath&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;CDC::GetTextExtent&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2704602415454722420-7608696735874937427?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/7608696735874937427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/7608696735874937427'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2010/06/compact-text-to-fit-in-rectangle.html' title='Compact the text to fit in a rectangle'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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></entry><entry><id>tag:blogger.com,1999:blog-2704602415454722420.post-7259919904244407614</id><published>2010-02-02T03:10:00.000-08:00</published><updated>2010-02-02T03:15:16.596-08:00</updated><title type='text'>Do something while executing a process</title><content type='html'>// Create the process&lt;br /&gt;    STARTUPINFO si;&lt;br /&gt;    PROCESS_INFORMATION pi;&lt;br /&gt;&lt;br /&gt;    ZeroMemory( &amp;si, sizeof(si) );&lt;br /&gt;    si.cb = sizeof(si);&lt;br /&gt;    ZeroMemory( &amp;pi, sizeof(pi) );&lt;br /&gt;&lt;br /&gt;    BOOL bCreate;&lt;br /&gt;    &lt;br /&gt;    bCreate = CreateProcess(szProcessName, szCmdLine, NULL, NULL, TRUE, &lt;br /&gt;        CREATE_NO_WINDOW | NORMAL_PRIORITY_CLASS,NULL, szProcessPath, &amp;si, &amp;pi);&lt;br /&gt;  &lt;br /&gt;    // Wait for the end of the process&lt;br /&gt;    while(WaitForSingleObject(pi.hProcess, 250) == WAIT_TIMEOUT)&lt;br /&gt;    {&lt;br /&gt;       //Do something here&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // Terminate the process&lt;br /&gt;    CloseHandle(pi.hProcess);&lt;br /&gt;    CloseHandle(pi.hThread);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2704602415454722420-7259919904244407614?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/7259919904244407614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/7259919904244407614'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2010/02/do-something-while-executing-process.html' title='Do something while executing a process'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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></entry><entry><id>tag:blogger.com,1999:blog-2704602415454722420.post-8821487767234466801</id><published>2009-12-29T04:12:00.000-08:00</published><updated>2009-12-29T04:13:15.451-08:00</updated><title type='text'>Create window at maximized or minimized state</title><content type='html'>BOOL CMainFrame::PreCreateWindow(CREATESTRUCT&amp; cs)&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt; if( !CMDIFrameWnd::PreCreateWindow(cs) )&lt;br /&gt;  return FALSE;&lt;br /&gt; // TODO: Modify the Window class or styles here by modifying&lt;br /&gt; //  the CREATESTRUCT cs&lt;br /&gt; cs.style |= WS_MAXIMIZE; // for minimized WS_MINIMIZE&lt;br /&gt; return TRUE;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2704602415454722420-8821487767234466801?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/8821487767234466801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/8821487767234466801'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2009/12/create-window-at-maximized-or-minimized.html' title='Create window at maximized or minimized state'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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></entry><entry><id>tag:blogger.com,1999:blog-2704602415454722420.post-1813416020064763956</id><published>2009-09-16T23:04:00.000-07:00</published><updated>2009-09-16T23:15:35.370-07:00</updated><title type='text'>Retrieve icon from an exe file</title><content type='html'>&lt;p align="left"&gt;Retrieve icon from an exe file:&lt;br /&gt;&lt;br /&gt;void GetProgramInfo(const CString&amp;amp; strProgramPath, SHFILEINFO* psfi)&lt;br /&gt;{&lt;br /&gt;         if(psfi == NULL)&lt;br /&gt;                 return;&lt;br /&gt;ZeroMemory(psfi, sizeof(SHFILEINFO));&lt;br /&gt;HIMAGELIST hImageList = (HIMAGELIST)SHGetFileInfo((LPCTSTR)strProgramPath, FILE_ATTRIBUTE_NORMAL,&lt;br /&gt;psfi, sizeof(SHFILEINFO),SHGFI_SMALLICON SHGFI_SYSICONINDEX&lt;br /&gt;SHGFI_DISPLAYNAME SHGFI_USEFILEATTRIBUTES);&lt;br /&gt;if(psfi-&gt;iIcon != 0)&lt;br /&gt;psfi-&gt;hIcon = ImageList_GetIcon(hImageList, psfi-&gt;iIcon, ILD_NORMAL);&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/2704602415454722420-1813416020064763956?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/1813416020064763956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/1813416020064763956'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2009/09/retrieve-icon-from-exe-file.html' title='Retrieve icon from an exe file'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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></entry><entry><id>tag:blogger.com,1999:blog-2704602415454722420.post-7863774493427742155</id><published>2009-09-16T22:59:00.000-07:00</published><updated>2009-09-16T23:03:44.929-07:00</updated><title type='text'>Insert Item in tree without image</title><content type='html'>HTREEITEM treeItemRoot = m_treePrograms.InsertItem(_T("ROOT"), -2, -2); // I_IMAGENONE&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2704602415454722420-7863774493427742155?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/7863774493427742155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/7863774493427742155'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2009/09/insert-item-in-tree-without-image.html' title='Insert Item in tree without image'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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></entry><entry><id>tag:blogger.com,1999:blog-2704602415454722420.post-7957436937655852952</id><published>2009-01-05T01:54:00.000-08:00</published><updated>2009-01-05T02:00:55.106-08:00</updated><title type='text'>Validating Edit Control</title><content type='html'>void CLongEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)&lt;br /&gt;{&lt;br /&gt;switch(nChar)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;case _T('+'):&lt;br /&gt;case _T('-'):&lt;br /&gt;case _T('1'):&lt;br /&gt;case _T('2'):&lt;br /&gt;case _T('3'):&lt;br /&gt;case _T('4'):&lt;br /&gt;case _T('5'):&lt;br /&gt;case _T('6'):&lt;br /&gt;case _T('7'):&lt;br /&gt;case _T('8'):&lt;br /&gt;case _T('9'):&lt;br /&gt;case _T('\b'):&lt;br /&gt;break;&lt;br /&gt;default:&lt;br /&gt;MessageBeep(0);&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;CEdit::OnChar(nChar, nRepCnt, nFlags);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;for more further deatil &lt;a href="http://www.flounder.com/validating_edit_control.htm"&gt;http://www.flounder.com/validating_edit_control.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2704602415454722420-7957436937655852952?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mfcprogramming.blogspot.com/feeds/7957436937655852952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2704602415454722420&amp;postID=7957436937655852952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/7957436937655852952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/7957436937655852952'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2009/01/validating-edit-control.html' title='Validating Edit Control'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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-2704602415454722420.post-1018418342659331564</id><published>2008-08-05T23:42:00.000-07:00</published><updated>2008-08-05T23:47:29.809-07:00</updated><title type='text'>enums and namespaces</title><content type='html'>In standard C++, enumeration constants are accessible&lt;br /&gt;within the scope that contains the enum. The enum itself&lt;br /&gt;does not define a scope.&lt;br /&gt;&lt;br /&gt;class CTopicBuilder&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;          enum SearchFileType&lt;br /&gt;         {&lt;br /&gt;                 FileTypeSource,&lt;br /&gt;                 FileTypeTopic&lt;br /&gt;          };&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;So the valid syntax to access enum is CTopicBuilder::FileTypeSource&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2704602415454722420-1018418342659331564?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mfcprogramming.blogspot.com/feeds/1018418342659331564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2704602415454722420&amp;postID=1018418342659331564' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/1018418342659331564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/1018418342659331564'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2008/08/enums-and-namespaces.html' title='enums and namespaces'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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-2704602415454722420.post-8552019893541522231</id><published>2008-08-05T22:49:00.000-07:00</published><updated>2008-08-05T22:54:02.121-07:00</updated><title type='text'>Formatted output C++</title><content type='html'>&lt;h1&gt;PRINTF - formatted output to standard output.&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;(ANSI Standard) &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Usage:&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;Nout = printf(format[,arg1,arg2,...]);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Where:&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;dl&gt;&lt;br /&gt;  &lt;dt&gt;const char *format;&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;tells how to format the various arguments (see below). &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;arg1,arg2,...&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;is a variable argument list of expressions whose values should be printed according to&lt;br /&gt;    the placeholders in the &amp;quot;format&amp;quot; string. If there are more placeholders than&lt;br /&gt;    supplied arguments, the result is undefined. If there are more arguments than&lt;br /&gt;    placeholders, the excess arguments are simply ignored. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;int Nout;&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;is the number of characters &amp;quot;printf&amp;quot; actually printed out. &lt;/dd&gt;&lt;br /&gt;&lt;/dl&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Description:&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;quot;printf&amp;quot; writes formatted output to &amp;quot;stdout&amp;quot;. The result of&lt;br /&gt;&amp;quot;printf&amp;quot; is the number of characters written. If a write error occurs,&lt;br /&gt;&amp;quot;printf&amp;quot; returns a negative number. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The output is formatted according to the &amp;quot;format&amp;quot; string. This string may&lt;br /&gt;contain two kinds of objects: &lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;ordinary characters which are simply copied to &amp;quot;stdout&amp;quot;; &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;placeholders, which tell &amp;quot;printf&amp;quot; how to format arguments in the variable&lt;br /&gt;    argument list. &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Each placeholder starts with the character '%' and ends with one or two letters that&lt;br /&gt;indicate what &amp;quot;type&amp;quot; of formatting is necessary. Between the '%' and the&lt;br /&gt;&amp;quot;type&amp;quot; field may appear &amp;quot;modifiers&amp;quot;, &amp;quot;width&amp;quot;, and&lt;br /&gt;&amp;quot;precision&amp;quot; fields. An ANSI placeholder has the form &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;%[modifiers][width][.precision]type&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;where square brackets indicate that a field is optional. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Because '%' has a special meaning to &amp;quot;printf&amp;quot;, you must use two of them to&lt;br /&gt;stand for a literal per cent character. For example, you would use &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;printf(&amp;quot;We had 100%% attendance!\n&amp;quot;);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;to print out the line &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;We had 100% attendance!&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;The Type Field&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Below we list the recognized &amp;quot;type&amp;quot; fields. Note that each &amp;quot;type&amp;quot;&lt;br /&gt;requires that the output value associated with the placeholder have a particular data&lt;br /&gt;type. Note also that the standard rules for passing arguments in a variable argument list&lt;br /&gt;automatically convert &amp;quot;char&amp;quot; and &amp;quot;short&amp;quot; values to &amp;quot;int&amp;quot;,&lt;br /&gt;and &amp;quot;float&amp;quot; values to &amp;quot;double&amp;quot;, so &amp;quot;char&amp;quot;,&lt;br /&gt;&amp;quot;short&amp;quot;, and &amp;quot;float&amp;quot; arguments are not possible. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The following types are recognized by the ANSI standard and can therefore be expected&lt;br /&gt;to be portable. &lt;br /&gt;&lt;br /&gt;&lt;dl&gt;&lt;br /&gt;  &lt;dt&gt;a&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;double&amp;quot; argument is displayed in one of the following formats: &lt;pre&gt;&lt;br /&gt; 0xh.hhhhp+d&lt;br /&gt; 0xh.hhhhp-d&lt;br /&gt;-0xh.hhhhp+d&lt;br /&gt;-0xh.hhhhp-d&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;    &lt;p&gt;where the &amp;quot;h&amp;quot; characters are lower case hexadecimal digits. This gives a&lt;br /&gt;    hexadecimal representation of the floating point number, where the exponent&lt;br /&gt;    (&amp;quot;+d&amp;quot; or &amp;quot;-d&amp;quot;) is a decimal number giving a power of two. &lt;/p&gt;&lt;br /&gt;    &lt;p&gt;The number of hexadecimal digits after the decimal point is equal to the precision. If&lt;br /&gt;    you do not specify a precision, the number of digits after the decimal point is sufficient&lt;br /&gt;    to give an exact representation of the value. &lt;/p&gt;&lt;br /&gt;    &lt;p&gt;On GCOS8, the first bit of the &amp;quot;double&amp;quot; value is the sign bit. The next three&lt;br /&gt;    bits are used for the hex digit that comes before the decimal point. Since GCOS8 always&lt;br /&gt;    normalizes the floating point value, the first of these three bits is always turned on.&lt;br /&gt;    Therefore, the number before the decimal point will always be 4, 5, 6, or 7. &lt;/p&gt;&lt;br /&gt;    &lt;p&gt;The exponent always contains at least one digit; it is longer if more digits are&lt;br /&gt;    required to express the exponent value. As a special case, the exponent for 0.0 is always&lt;br /&gt;    zero. &lt;/p&gt;&lt;br /&gt;    &lt;p&gt;As an example of &amp;quot;%a&amp;quot; format, the floating point value 1.0 would be displayed&lt;br /&gt;    as &lt;/p&gt;&lt;br /&gt;    &lt;pre&gt;&lt;br /&gt;0x4.00p-2&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;A&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;is the same as &amp;quot;%a&amp;quot; except that hexadecimal digits are shown in upper case and&lt;br /&gt;    the number begins with &amp;quot;0X&amp;quot; instead of &amp;quot;0x&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;c&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;int&amp;quot; argument is converted to &amp;quot;unsigned char&amp;quot;, and then output.&lt;br /&gt;    Note that this only writes a single character, even if the original &amp;quot;int&amp;quot; value&lt;br /&gt;    held more than one character. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;d&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;int&amp;quot; argument is output as a signed decimal integer. If the number is&lt;br /&gt;    positive, a '+' sign may or may not be output, depending on the value of the modifiers&lt;br /&gt;    field. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;e&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;double&amp;quot; argument is output in scientific notation &lt;pre&gt;&lt;br /&gt;[-]m.nnnnnne+xx&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;    &lt;p&gt;with one digit before the decimal point. The default number of digits after the decimal&lt;br /&gt;    point is six, but this can be changed with a precision field. The &amp;quot;double&amp;quot; value&lt;br /&gt;    is rounded to the correct number of decimal places. The exponent always contains two&lt;br /&gt;    digits. &lt;/p&gt;&lt;br /&gt;  &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;E&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%e&amp;quot; format, except that the 'E' will be in upper case instead of&lt;br /&gt;    lower. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;f&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;double&amp;quot; argument is output in conventional form, i.e. &lt;pre&gt;&lt;br /&gt;[-]mmmm.nnnnnn&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;    &lt;p&gt;The default number of digits after the decimal point is six, but this can be changed&lt;br /&gt;    with a precision field. If a decimal point appears, at least one digit appears before it.&lt;br /&gt;    The &amp;quot;double&amp;quot; value is rounded to the correct number of decimal places. &lt;/p&gt;&lt;br /&gt;  &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;g&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;double&amp;quot; argument is output in scientific or standard format. Scientific&lt;br /&gt;    notation is only used if the exponent resulting from the conversion is less than -4 or&lt;br /&gt;    greater than the precision; otherwise standard representation is used. With scientific&lt;br /&gt;    notation, the 'e' to mark the exponent is in lower case. The precision is taken to mean&lt;br /&gt;    the number of significant digits required (not necessarily the number of decimal places).&lt;br /&gt;    Trailing zeros are removed from the result, and a decimal point only appears if it is&lt;br /&gt;    followed by a digit. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;G&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%g&amp;quot; format, except that the 'E' to mark the exponent in scientific&lt;br /&gt;    notation is in upper case. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;i&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%d&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;n&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;(int *)&amp;quot; argument is taken to point to integer. &amp;quot;printf&amp;quot; assigns&lt;br /&gt;    this integer the number of characters that have been written to the output stream so far&lt;br /&gt;    by this call to &amp;quot;printf&amp;quot;. No output is written for this placeholder. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;o&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;int&amp;quot; argument is output as an unsigned integer written with octal digits.&lt;br /&gt;    This will not have a leading zero, unless the # &amp;quot;modifier&amp;quot; is used (see below). &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;p&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;corresponding argument is assumed to be &amp;quot;(const void *)&amp;quot; value. The value of&lt;br /&gt;    the pointer is converted to a sequence of printable characters in an&lt;br /&gt;    implementation-defined manner. SS mode C displays the value of the pointer as an octal&lt;br /&gt;    integer. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;s&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;(const char *)&amp;quot; argument is taken as pointer to ASCII string. Characters in&lt;br /&gt;    this string will be output until a '\0' character is found or the number of characters&lt;br /&gt;    indicated by the precision field has been printed. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;u&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;int&amp;quot; argument is output as an unsigned decimal integer. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;x&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;int&amp;quot; argument is output as an unsigned integer written with hexadecimal&lt;br /&gt;    digits, using the letters 'a' to 'f' for hex digits greater than 9. This will not have a&lt;br /&gt;    leading '0x' unless the # &amp;quot;modifier&amp;quot; is used (see below). &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;X&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%x&amp;quot; except that the letters 'A' to 'F' are used for hex digits&lt;br /&gt;    greater than 9. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;hd&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%d&amp;quot; except that &amp;quot;int&amp;quot; argument is converted to&lt;br /&gt;    &amp;quot;short&amp;quot; before formatting and printing. Since &amp;quot;short&amp;quot; is the same as&lt;br /&gt;    &amp;quot;int&amp;quot; on GCOS8, this is the same as &amp;quot;%d&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;hi&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%hd&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;ho&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%o&amp;quot; except that the &amp;quot;int&amp;quot; argument is converted to&lt;br /&gt;    &amp;quot;unsigned short&amp;quot; before formatting and printing. Since &amp;quot;unsigned&lt;br /&gt;    short&amp;quot; is the same as &amp;quot;unsigned&amp;quot; on GCOS8, this is the same as&lt;br /&gt;    &amp;quot;%o&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;hu&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%u&amp;quot; except that the &amp;quot;int&amp;quot; argument is converted to&lt;br /&gt;    &amp;quot;unsigned short&amp;quot; before formatting and printing. Since &amp;quot;unsigned&lt;br /&gt;    short&amp;quot; is the same as &amp;quot;unsigned&amp;quot; on GCOS8, this is the same as&lt;br /&gt;    &amp;quot;%u&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;hx&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%x&amp;quot; except that the &amp;quot;int&amp;quot; argument is converted to&lt;br /&gt;    &amp;quot;unsigned short&amp;quot; before formatting and printing. Since &amp;quot;unsigned&lt;br /&gt;    short&amp;quot; is the same as &amp;quot;unsigned&amp;quot; on GCOS8, this is the same as&lt;br /&gt;    &amp;quot;%x&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;hX&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%X&amp;quot; except that the &amp;quot;int&amp;quot; argument is converted to&lt;br /&gt;    &amp;quot;unsigned short&amp;quot; before formatting and printing. Since &amp;quot;unsigned&lt;br /&gt;    short&amp;quot; is the same as &amp;quot;unsigned&amp;quot; on GCOS8, this is the same as&lt;br /&gt;    &amp;quot;%X&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;hhd&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%d&amp;quot; except that &amp;quot;int&amp;quot; argument is converted to &amp;quot;signed&lt;br /&gt;    char&amp;quot; before formatting and printing. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;hi&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%hhd&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;ho&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%o&amp;quot; except that the &amp;quot;int&amp;quot; argument is converted to&lt;br /&gt;    &amp;quot;unsigned char&amp;quot; before formatting and printing. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;hu&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%u&amp;quot; except that the &amp;quot;int&amp;quot; argument is converted to&lt;br /&gt;    &amp;quot;unsigned char&amp;quot; before formatting and printing. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;hx&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%x&amp;quot; except that the &amp;quot;int&amp;quot; argument is converted to&lt;br /&gt;    &amp;quot;unsigned char&amp;quot; before formatting and printing. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;hX&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%X&amp;quot; except that the &amp;quot;int&amp;quot; argument is converted to&lt;br /&gt;    &amp;quot;unsigned char&amp;quot; before formatting and printing. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;ld&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%d&amp;quot; except argument is &amp;quot;long&amp;quot; integer. Since&lt;br /&gt;    &amp;quot;long&amp;quot; is the same as &amp;quot;int&amp;quot; on GCOS8, this is the same as&lt;br /&gt;    &amp;quot;%d&amp;quot;. However, the compiler will warn you if you specify &amp;quot;%ld&amp;quot; but&lt;br /&gt;    pass a normal &amp;quot;int&amp;quot;, or specify &amp;quot;%d&amp;quot; but pass a &amp;quot;long&amp;quot;.&lt;br /&gt;    Similar warnings are issued for all the other &amp;quot;%l&amp;quot; placeholders described below.&lt;br /&gt;  &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;li&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%ld&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;lo&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%o&amp;quot; except argument is &amp;quot;unsigned long&amp;quot; integer. Since&lt;br /&gt;    &amp;quot;unsigned long&amp;quot; is the same as &amp;quot;unsigned&amp;quot; on GCOS8, this is equivalent&lt;br /&gt;    to &amp;quot;%o&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;lu&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%u&amp;quot; except argument is &amp;quot;unsigned long&amp;quot; integer. Since&lt;br /&gt;    &amp;quot;unsigned long&amp;quot; is the same as &amp;quot;unsigned&amp;quot; on GCOS8, this is equivalent&lt;br /&gt;    to &amp;quot;%u&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;lx&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%x&amp;quot; except argument is &amp;quot;unsigned long&amp;quot; integer. Since&lt;br /&gt;    &amp;quot;unsigned long&amp;quot; is the same as &amp;quot;unsigned&amp;quot; on GCOS8, this is equivalent&lt;br /&gt;    to &amp;quot;%x&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;lX&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%X&amp;quot; except argument is &amp;quot;unsigned long&amp;quot; integer. Since&lt;br /&gt;    &amp;quot;unsigned long&amp;quot; is the same as &amp;quot;unsigned&amp;quot; on GCOS8, this is equivalent&lt;br /&gt;    to &amp;quot;%X&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;Le&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%e&amp;quot; except argument is &amp;quot;long double&amp;quot;. Since &amp;quot;long&lt;br /&gt;    double&amp;quot; is the same as &amp;quot;double&amp;quot; on GCOS8, this is the same as&lt;br /&gt;    &amp;quot;%e&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;LE&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%E&amp;quot; except argument is &amp;quot;long double&amp;quot;. Since &amp;quot;long&lt;br /&gt;    double&amp;quot; is the same as &amp;quot;double&amp;quot; on GCOS8, this is the same as&lt;br /&gt;    &amp;quot;%E&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;Lf&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%f&amp;quot; except argument is &amp;quot;long double&amp;quot;. Since &amp;quot;long&lt;br /&gt;    double&amp;quot; is the same as &amp;quot;double&amp;quot; on GCOS8, this is the same as&lt;br /&gt;    &amp;quot;%f&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;Lg&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%g&amp;quot; except argument is &amp;quot;long double&amp;quot;. Since &amp;quot;long&lt;br /&gt;    double&amp;quot; is the same as &amp;quot;double&amp;quot; on GCOS8, this is the same as&lt;br /&gt;    &amp;quot;%g&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;LG&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%G&amp;quot; except argument is &amp;quot;long double&amp;quot;. Since &amp;quot;long&lt;br /&gt;    double&amp;quot; is the same as &amp;quot;double&amp;quot; on GCOS8, this is the same as&lt;br /&gt;    &amp;quot;%G&amp;quot;. &lt;/dd&gt;&lt;br /&gt;&lt;/dl&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In addition to the types recognized by the ANSI standard, this version of C supports a&lt;br /&gt;number of extensions: &lt;br /&gt;&lt;br /&gt;&lt;dl&gt;&lt;br /&gt;  &lt;dt&gt;&lt;a name="undera"&gt;_a&lt;/a&gt;&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;accepts a &amp;quot;char *&amp;quot; string pointer as its corresponding argument. The string&lt;br /&gt;    will be printed in a manner that resembles strings in C source code: non-printable&lt;br /&gt;    characters will be printed as escape sequences. For example, a new-line character will be&lt;br /&gt;    printed as '\n'; a non-standard character will be printed as a blackslash followed by&lt;br /&gt;    three octal digits. The width gives the minimum number of characters in the output field;&lt;br /&gt;    the precision gives the number of characters to be printed from the string. If there is no&lt;br /&gt;    precision specified, the entire string is printed (up to but not including the terminating&lt;br /&gt;    '\0' character). If you specify the '#' modifier, double quotes will be printed to enclose&lt;br /&gt;    the output string. If you specify the '-' modifier, output will be left-justified;&lt;br /&gt;    otherwise, it will be right-justified. If you specify the '+' modifier, '\0' characters&lt;br /&gt;    will not be considered to be the end of the string; in this case, a precision must be&lt;br /&gt;    specified to tell &amp;quot;printf&amp;quot; how many characters to print. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;b&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as the &amp;quot;%b&amp;quot; placeholder of the &amp;quot;printf&amp;quot; in the UW Tools&lt;br /&gt;    package. See &amp;quot;&lt;a href="../../b/lib/printf.html"&gt;expl b lib printf&lt;/a&gt;&amp;quot;. This is&lt;br /&gt;    supported for compatibility with previous versions of C. It should not be used, since&lt;br /&gt;    &amp;quot;%b&amp;quot; is reserved for future use by the ANSI standard. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;B&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as the &amp;quot;%B&amp;quot; placeholder of the &amp;quot;printf&amp;quot; in the UW Tools&lt;br /&gt;    package. See &amp;quot;&lt;a href="../../b/lib/printf.html"&gt;expl b lib printf&lt;/a&gt;&amp;quot;. This is&lt;br /&gt;    supported for compatibility with previous versions of C. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;_c&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;int&amp;quot; argument is taken to contain BCD characters. These are output as their&lt;br /&gt;    ASCII equivalents; letters are output in lower case. If you specify a precision of zero,&lt;br /&gt;    PRINTF will strip off high order zeroes at the beginning of the argument word and&lt;br /&gt;    interpret the rest as BCD characters. If you specify a width, the precision is&lt;br /&gt;    automatically set to the same value. If you do not specify either a precision or width,&lt;br /&gt;    the default is &amp;quot;%6.0_c&amp;quot;. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;_C&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;is the same as &amp;quot;%_c&amp;quot;, except that letters are output in upper case. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;_e&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;double&amp;quot; argument is output in scientific notation. This is almost like&lt;br /&gt;    &amp;quot;%e&amp;quot;, except that the width field takes precedence over the precision. Thus if&lt;br /&gt;    the requested width is too small to provide the requested precision, a smaller precision&lt;br /&gt;    will be used. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;_E&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%_e&amp;quot; format except that the 'E' for the exponent will be in upper&lt;br /&gt;    case instead of lower. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;_f&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;double&amp;quot; argument is output in &amp;quot;optimal&amp;quot; format. If the specified&lt;br /&gt;    width is sufficient to hold the value with the requested precision in standard format&lt;br /&gt;    (nnn.nnn), the value will be printed in standard format. If the width is not sufficient,&lt;br /&gt;    &amp;quot;printf&amp;quot; will use either standard format or scientific notation, whichever&lt;br /&gt;    provides the requested precision with the fewer characters. If no width or precision is&lt;br /&gt;    specified, the number will be output with the greatest available precision. If a width is&lt;br /&gt;    specified, but not a precision, the number will be rounded to the appropriate width. If&lt;br /&gt;    the fractional part of the number is zero, no zeros will be printed after the decimal&lt;br /&gt;    place. Thus there is a difference between &lt;pre&gt;&lt;br /&gt;1.&lt;br /&gt;1.000000&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;    &lt;p&gt;The first number is a true 1.0. The second is not 1.0, but has a fractional part that&lt;br /&gt;    is too small to show in the given precision. When scientific notation is used, the 'e' to&lt;br /&gt;    mark the exponent is in lower case. &lt;/p&gt;&lt;br /&gt;  &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;_F&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%_f&amp;quot;, except that when scientific notation is used, the 'E' to mark&lt;br /&gt;    the exponent is in upper case. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;_g&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%_f&amp;quot; format, except that the precision is interpreted as the number&lt;br /&gt;    of significant digits, not the number of decimal places. This means that very small&lt;br /&gt;    numbers will be printed in scientific notation instead of rounded to a .000000 form. When&lt;br /&gt;    scientific notation is used, the 'e' to mark the exponent is in lower case. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;_G&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%_g&amp;quot; format, except that when scientific notation is used, the 'E' to&lt;br /&gt;    mark the exponent is in upper case. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;_s&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;&amp;quot;(void *)&amp;quot; argument is taken as a BCD pointer. See &amp;quot;&lt;a&lt;br /&gt;    href="../../nsc/lib/_bcdpt.html"&gt;expl nsc lib _bcdptr&lt;/a&gt;&amp;quot; for more on BCD pointers.&lt;br /&gt;    If only a width is specified, the string will be assumed to have that number of BCD&lt;br /&gt;    characters, and the corresponding ASCII characters are output (with letters in lower case&lt;br /&gt;    and trailing blanks removed). If a width and a precision field are specified, the&lt;br /&gt;    precision is taken to be the number of BCD characters in the string and the width is the&lt;br /&gt;    size of the output field. If no width is given, the default is six. Trailing blanks are&lt;br /&gt;    stripped, unless the '#' modifier is specified. By default, the output is right-justified;&lt;br /&gt;    if the modifier '-' is given, the output will be left-justified. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;_S&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;same as &amp;quot;%_s&amp;quot; except that letters are output in upper case. &lt;/dd&gt;&lt;br /&gt;  &lt;dt&gt;_v&lt;/dt&gt;&lt;br /&gt;  &lt;dd&gt;has two corresponding arguments: a &amp;quot;const char *&amp;quot; format string in the same&lt;br /&gt;    format as a normal &amp;quot;printf&amp;quot; format string; and a &amp;quot;va_list&amp;quot; argument,&lt;br /&gt;    as declared in &amp;lt;stdarg.h&amp;gt;. The &amp;quot;va_list&amp;quot; argument is presumed to indicate&lt;br /&gt;    all or part of a variable argument list (i.e. the argument has been set up with&lt;br /&gt;    &amp;quot;va_start&amp;quot;). The arguments remaining in this variable argument list are&lt;br /&gt;    formatted and output according to the given format string. For more information on&lt;br /&gt;    variable argument lists, see &amp;quot;&lt;a href="../incl/stdarg.html"&gt;expl c include stdarg&lt;/a&gt;&amp;quot;.&lt;br /&gt;  &lt;/dd&gt;&lt;br /&gt;&lt;/dl&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;The Modifiers Field&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The modifiers field consists of zero or more characters that indicate how output should&lt;br /&gt;be padded (e.g. whether numbers are preceded by blanks or leading zeros), and whether or&lt;br /&gt;not '+' or '-' signs are printed. Below we list the possible &amp;quot;modifier&amp;quot;&lt;br /&gt;characters. - (minus) indicates that values should be left-justified in the output field.&lt;br /&gt;The default action is to right-justify them. + (plus) is relevant only for signed numeric&lt;br /&gt;output values and &amp;quot;%_a&amp;quot;. This &amp;quot;modifier&amp;quot; character tells&lt;br /&gt;&amp;quot;printf&amp;quot; to put a sign in front of the number, whether or not it is negative.&lt;br /&gt;Thus negative numbers will be preceded by '-' while zero and positive numbers will be&lt;br /&gt;preceded by '+'. The default is to add the sign only if the number is negative. See the&lt;br /&gt;description of &amp;quot;&lt;a href="#undera"&gt;%_a&lt;/a&gt;&amp;quot; for the effect of '+' with that&lt;br /&gt;placeholder. &amp;nbsp; (blank) is relevant only for signed numeric output values. This&lt;br /&gt;&amp;quot;modifier&amp;quot; character tells &amp;quot;printf&amp;quot; to put a sign in front of numbers&lt;br /&gt;only if they are negative. If the number is non-negative, &amp;quot;printf&amp;quot; will put in a&lt;br /&gt;blank instead of a sign. The default is not to put a blank in front of non-negative&lt;br /&gt;number. If both '+' and '&amp;nbsp;' are specified as &amp;quot;modifier&amp;quot; characters, the '+'&lt;br /&gt;overrides the '&amp;nbsp;'. # (sharp) is relevant only for some output types. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If &amp;quot;type&amp;quot; is 'o', all non-zero values will have a leading 0; normally, octal&lt;br /&gt;output has no leading zero. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If &amp;quot;type&amp;quot; is 'x' or 'X', all non-zero values will have a leading 0x or 0X&lt;br /&gt;respectively; normally, such prefixes are omitted. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If &amp;quot;type&amp;quot; is 'e', 'E' or 'f', &amp;quot;printf&amp;quot; will always print out a&lt;br /&gt;decimal point (normally, the decimal point is omitted if the number has no fractional&lt;br /&gt;part). &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If &amp;quot;type&amp;quot; is '_f', trailing zeros are printed after a decimal point, even if&lt;br /&gt;the fractional part of the number is zero. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If &amp;quot;type&amp;quot; is 'g' or 'G', &amp;quot;printf&amp;quot; will always print out a decimal&lt;br /&gt;point and trailing zeros will not be removed; usually 'g' and 'G' remove trailing zeros. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If &amp;quot;type&amp;quot; is '_s' or '_S', trailing blanks are not trimmed. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If &amp;quot;type&amp;quot; is '_a', the output is enclosed in double quotes. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;The Width Field&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The width field is a non-negative decimal integer giving the minimum number of&lt;br /&gt;characters to be printed. If the output value is shorter than the given width, it is&lt;br /&gt;padded to the appropriate width by putting blanks on the right (or on the left, if the '-'&lt;br /&gt;&amp;quot;modifier&amp;quot; character is specified). &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;With numeric placeholders, the number in the width field may have a leading 0. With&lt;br /&gt;this, the output value will be expanded with zeros to give the number the specified width.&lt;br /&gt;For example, with &amp;quot;%05d&amp;quot; the value -1 will be printed as &amp;quot;-0001&amp;quot;. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The width field can also be the character '*', in which case &amp;quot;printf&amp;quot; will&lt;br /&gt;take the next argument in the argument list and take that as the width value. For example,&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;printf(&amp;quot;%*d&amp;quot;,4,X);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;prints the value of X with a width of 4. Note that the width value is obtained from the&lt;br /&gt;argument list BEFORE the output value is obtained. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The width field specifies the MINIMUM number of characters to be output. If more&lt;br /&gt;characters are needed, the output will be wider than width (unless the precision value&lt;br /&gt;dictates otherwise). &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;The Precision Field&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The precision field is a dot '.' followed by a non-negative decimal integer. Its&lt;br /&gt;meaning depends on the &amp;quot;type&amp;quot; field as given below. &lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;If the &amp;quot;type&amp;quot; is 'd', 'o', 'u', 'x' or 'X', the precision number is the&lt;br /&gt;    smallest number of digits that may appear in the output value. If necessary, the number&lt;br /&gt;    will be padded on the left with leading zeros. If the precision number is 0 or the field&lt;br /&gt;    is just a '.' with no number following, an output value of 0 will result in no characters&lt;br /&gt;    being printed. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;If the &amp;quot;type&amp;quot; is 'e', 'E', or 'f', the precision number is the number of&lt;br /&gt;    digits printed after the decimal point. If the precision number is 0 or the field is just&lt;br /&gt;    a '.' with no number following, no decimal point is printed. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;If the &amp;quot;type&amp;quot; is 'g' or 'G', the precision number is the maximum number of&lt;br /&gt;    significant digits to be printed. If no precision field is specified, six significant&lt;br /&gt;    digits are printed. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;If the &amp;quot;type&amp;quot; is 's', the precision number gives the maximum number of&lt;br /&gt;    characters to be printed. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;If the &amp;quot;type&amp;quot; is an 'h', 'hh', 'l' or 'L' type, the precision field has the&lt;br /&gt;    same effect as it has for the type without the 'h', 'hh', 'l' or 'L'. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;If the &amp;quot;type&amp;quot; is '_e', '_E', '_f', or '_F', the precision number is the number&lt;br /&gt;    of digits printed after the decimal point. If no precision is specified, the width will&lt;br /&gt;    dictate the precision. If no width is specified either, the value will be printed to full&lt;br /&gt;    precision. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;If the &amp;quot;type&amp;quot; is '_g' or '_G', the precision is the maximum number of&lt;br /&gt;    significant digits to be printed. If no precision field is specified, all significant&lt;br /&gt;    digits are printed. &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The precision field can also be the character '*', in which case &amp;quot;printf&amp;quot;&lt;br /&gt;will take the next argument in the argument list and take that as the precision value. For&lt;br /&gt;example, &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;printf(&amp;quot;%*.*f&amp;quot;,8,3,Y);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;prints the value of Y with a width of 8 and a precision of 3. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Fill Characters&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;As a non-ANSI extension, all placeholders may specify a &amp;quot;fill character&amp;quot; by&lt;br /&gt;putting &amp;quot;,F&amp;quot; in front of the type designator (where F is any character). In any&lt;br /&gt;situation where &amp;quot;printf&amp;quot; would normally fill out a field with blanks, the fill&lt;br /&gt;character will be used instead. For example, with &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;printf(&amp;quot;%5,#d&amp;quot;,20);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;the output would be &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;###20&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The &amp;quot;#&amp;quot; after the comma is used as a fill character. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;As with width and precision, the fill field can also be the character '*', in which&lt;br /&gt;case &amp;quot;printf&amp;quot; will take the next argument in the argument list and take that as&lt;br /&gt;the fill value. For example, &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;printf(&amp;quot;%,*d&amp;quot;,'*',20);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;will fill with asterisks. If you want to fill with asterisks, you have to take this&lt;br /&gt;approach. A question mark '?' as the fill field has the same meaning as '*'. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Defaults&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Below we list the defaults when width and/or precision fields are omitted. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;quot;%1c&amp;quot;     &amp;quot;%1.1d&amp;quot;    &amp;quot;%11.6e&amp;quot;   &amp;quot;%11.6E&amp;quot;&lt;br /&gt;&amp;quot;%8.6f&amp;quot;   &amp;quot;%1.6g&amp;quot;    &amp;quot;%1.6G&amp;quot;    &amp;quot;%1.1o&amp;quot;&lt;br /&gt;&amp;quot;%0s&amp;quot;     &amp;quot;%1.1x&amp;quot;    &amp;quot;%1.1X&amp;quot;    &amp;quot;%1.1ld&amp;quot;&lt;br /&gt;&amp;quot;%1.1lo&amp;quot;  &amp;quot;%1.1lx&amp;quot;   &amp;quot;%1.1lX&amp;quot;   &amp;quot;%6.6Le&amp;quot;&lt;br /&gt;&amp;quot;%6.6LE&amp;quot;  &amp;quot;%6.6Lf&amp;quot;   &amp;quot;%6.6Lg&amp;quot;   &amp;quot;%6.6LG&amp;quot;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Examples:&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;int i = 3, j = -1, k = 4;&lt;br /&gt;char *s = &amp;quot;string&amp;quot;;&lt;br /&gt;float x = 3.14159265;&lt;br /&gt;printf(&amp;quot;j = %.*d, %.3s x = %10.*f&amp;quot;,i,j,s,k,x);&lt;br /&gt;/* prints:  j = -001, str x =     3.1416 */&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In the next examples, we use the letter 'b' to show where spaces are printed out. In&lt;br /&gt;all cases, the value printed is the integer -1. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Format     Output&lt;br /&gt; %5d       bbb-1&lt;br /&gt; %05d      -0001&lt;br /&gt; %5.5d     -00001 (precision requires 5 sig. digits)&lt;br /&gt; %5,0d     000-1  (zero is fill character)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Notes:&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The single segment C version of &amp;quot;printf&amp;quot; is the same as the&lt;br /&gt;&amp;quot;printf&amp;quot; function in the UW Tools library. Therefore you do not have to worry&lt;br /&gt;about programs that combine the B and C versions of &amp;quot;printf&amp;quot;. If the&lt;br /&gt;&amp;quot;format&amp;quot; string is passed as a B pointer (in the lower 18 bits of the word, with&lt;br /&gt;zeroes in the upper half of the word), &amp;quot;printf&amp;quot; behaves like the UW Tools&lt;br /&gt;function. Otherwise, it behaves like the C version of the function. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The &amp;quot;printf&amp;quot; function does almost no validity checking on the format string.&lt;br /&gt;Therefore, if you specify an invalid format, you will probably get invalid output without&lt;br /&gt;any diagnostic message. You may also get more serious errors (e.g. memory faults). &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Most users will find that &amp;quot;%g&amp;quot; is the best format for printing out single&lt;br /&gt;floating point numbers, since it tries to choose the most readable format. For columns of&lt;br /&gt;floating point numbers, &amp;quot;%_f&amp;quot; is usually better than &amp;quot;%f&amp;quot; because&lt;br /&gt;&amp;quot;%_f&amp;quot; makes more of an effort to provide the precise width requested (or as&lt;br /&gt;close as possible to that width). &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2704602415454722420-8552019893541522231?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mfcprogramming.blogspot.com/feeds/8552019893541522231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2704602415454722420&amp;postID=8552019893541522231' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/8552019893541522231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/8552019893541522231'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2008/08/formatted-output-c.html' title='Formatted output C++'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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-2704602415454722420.post-3412815702853454931</id><published>2008-05-11T05:07:00.000-07:00</published><updated>2008-05-11T05:11:39.871-07:00</updated><title type='text'>Change the status bar text</title><content type='html'>include afxpriv.h header&lt;br /&gt;&lt;br /&gt;Then send the WM_SETMESSAGESTRING message&lt;br /&gt;pWnd-&gt;SendMessage(WM_SETMESSAGESTRING, 0, (LPARAM)(lpszMsg));&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2704602415454722420-3412815702853454931?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mfcprogramming.blogspot.com/feeds/3412815702853454931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2704602415454722420&amp;postID=3412815702853454931' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/3412815702853454931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/3412815702853454931'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2008/05/change-status-bar-text.html' title='Change the status bar text'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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-2704602415454722420.post-3713088016906985480</id><published>2008-05-04T05:23:00.000-07:00</published><updated>2009-01-05T02:02:52.151-08:00</updated><title type='text'>MFC links</title><content type='html'>&lt;a href="http://www.ucancode.net/Visual_C_Tutorials-Articles.htm"&gt;http://www.ucancode.net/Visual_C_Tutorials-Articles.htm&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ucancode.net/Visual_C_Tutorials-Articles.htm"&gt;http://www.ucancode.net/Visual_C_Tutorials-Articles.htm&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ucancode.net/Visual_C_MFC_Example/CListCtrl-Print-Custom-Draw-VC-Tutorial.htm"&gt;http://www.ucancode.net/Visual_C_MFC_Example/CListCtrl-Print-Custom-Draw-VC-Tutorial.htm&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.flounder.com/mvp_tips.htm#Controls%20series"&gt;http://www.flounder.com/mvp_tips.htm#Controls%20series&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2704602415454722420-3713088016906985480?l=mfcprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mfcprogramming.blogspot.com/feeds/3713088016906985480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2704602415454722420&amp;postID=3713088016906985480' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/3713088016906985480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2704602415454722420/posts/default/3713088016906985480'/><link rel='alternate' type='text/html' href='http://mfcprogramming.blogspot.com/2008/05/mfc-links.html' title='MFC links'/><author><name>Ayub Khan</name><uri>http://www.blogger.com/profile/06093287726854317581</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></feed>
