<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 11:36:58 +0000</lastBuildDate>
    <item>
      <title>(C#) C# Speech example - jimfred</title>
      <link>https://snipplr.com/view/59895/c-speech-example</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 18 Oct 2011 06:32:52 UTC</pubDate>
      <guid>https://snipplr.com/view/59895/c-speech-example</guid>
    </item>
    <item>
      <title>(C#) Get .CFG or .INI filename based on current application name - jimfred</title>
      <link>https://snipplr.com/view/59875/get-cfg-or-ini-filename-based-on-current-application-name</link>
      <description>&lt;p&gt;Single-line expression provides .CFG filename based on application name.&#13;
The .CFG file is in the same directory as the application.&#13;
Application.ExecutablePath returns the app's path, with directory, including the trailing .EXE.&#13;
Regex is used to replace the .EXE with a .CFG or .INI&lt;/p&gt;</description>
      <pubDate>Mon, 17 Oct 2011 07:39:33 UTC</pubDate>
      <guid>https://snipplr.com/view/59875/get-cfg-or-ini-filename-based-on-current-application-name</guid>
    </item>
    <item>
      <title>(SQL) split multiple columns into multiple rows - UNPIVOT - jimfred</title>
      <link>https://snipplr.com/view/57489/split-multiple-columns-into-multiple-rows--unpivot</link>
      <description>&lt;p&gt;&lt;p&gt;UNPIVOT a table to create more rows using two approaches&lt;/p&gt;&#13;
&#13;
&lt;p&gt;Convert this...&lt;/p&gt;&#13;
&#13;
&lt;pre&gt;&#13;
K   North   South   East    West&#13;
0   1   0   0   0&#13;
1   0   1   0   0&#13;
2   0   0   1   0&#13;
3   0   0   0   1&#13;
&lt;/pre&gt;&#13;
&#13;
&lt;p&gt;... to this...&lt;/p&gt;&#13;
&#13;
&lt;pre&gt;&#13;
K   PortName    PortOk&#13;
0   North   1&#13;
0   South   0&#13;
0   East    0&#13;
0   West    0&#13;
1   North   0&#13;
1   South   1&#13;
1   East    0&#13;
1   West    0&#13;
2   North   0&#13;
2   South   0&#13;
2   East    1&#13;
2   West    0&#13;
3   North   0&#13;
3   South   0&#13;
3   East    0&#13;
3   West    1&#13;
&lt;/pre&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 02 Aug 2011 05:59:14 UTC</pubDate>
      <guid>https://snipplr.com/view/57489/split-multiple-columns-into-multiple-rows--unpivot</guid>
    </item>
    <item>
      <title>(C#) Get a web page in a dot.net app. - jimfred</title>
      <link>https://snipplr.com/view/56071/get-a-web-page-in-a-dotnet-app</link>
      <description>&lt;p&gt;These static functions will execute an http GET and get the response as a string. The seconds function uses a user/password to login.&lt;/p&gt;</description>
      <pubDate>Mon, 04 Jul 2011 10:47:14 UTC</pubDate>
      <guid>https://snipplr.com/view/56071/get-a-web-page-in-a-dotnet-app</guid>
    </item>
    <item>
      <title>(C#) Get current function name - jimfred</title>
      <link>https://snipplr.com/view/54305/get-current-function-name</link>
      <description>&lt;p&gt;This is useful to get the name of the current function for trace purposes or to name a thread.&lt;/p&gt;</description>
      <pubDate>Tue, 24 May 2011 09:12:25 UTC</pubDate>
      <guid>https://snipplr.com/view/54305/get-current-function-name</guid>
    </item>
    <item>
      <title>(C++) MFC, Determine if \'this\' app has focus - jimfred</title>
      <link>https://snipplr.com/view/53574/mfc-determine-if-this-app-has-focus</link>
      <description>&lt;p&gt;Determine if 'this' app has focus.&#13;
Using MFC.&lt;/p&gt;</description>
      <pubDate>Sat, 14 May 2011 07:00:39 UTC</pubDate>
      <guid>https://snipplr.com/view/53574/mfc-determine-if-this-app-has-focus</guid>
    </item>
    <item>
      <title>(C++) MFC, Text to clipboard - jimfred</title>
      <link>https://snipplr.com/view/51796/mfc-text-to-clipboard</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 09 Apr 2011 02:19:26 UTC</pubDate>
      <guid>https://snipplr.com/view/51796/mfc-text-to-clipboard</guid>
    </item>
    <item>
      <title>(C#) Get assembly name and version into a string. - jimfred</title>
      <link>https://snipplr.com/view/50768/get-assembly-name-and-version-into-a-string</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 17 Mar 2011 09:57:45 UTC</pubDate>
      <guid>https://snipplr.com/view/50768/get-assembly-name-and-version-into-a-string</guid>
    </item>
    <item>
      <title>(C#) Launch File Explorer for application\'s current working directory - jimfred</title>
      <link>https://snipplr.com/view/50761/launch-file-explorer-for-applications-current-working-directory</link>
      <description>&lt;p&gt;I frequently add a link to utilities to open the app's CWD.&lt;/p&gt;</description>
      <pubDate>Thu, 17 Mar 2011 08:21:29 UTC</pubDate>
      <guid>https://snipplr.com/view/50761/launch-file-explorer-for-applications-current-working-directory</guid>
    </item>
    <item>
      <title>(C#) Scroll multiple RichTextBoxes (or TextBoxes) in unison (synchronized scrolling). - jimfred</title>
      <link>https://snipplr.com/view/50758/scroll-multiple-richtextboxes-or-textboxes-in-unison-synchronized-scrolling</link>
      <description>&lt;p&gt;This is useful for WinForm apps with multiple TextBoxes that need to be scrolled in unison. Similar applications are diff GUIs that show 2 or more files side-by-side, where each window needs to be scrolled in unison.&#13;
&#13;
The approach below is a simpler alternative to http://stackoverflow.com/questions/1827323/c-synchronize-scroll-position-of-two-richtextboxes&lt;/p&gt;</description>
      <pubDate>Thu, 17 Mar 2011 06:30:15 UTC</pubDate>
      <guid>https://snipplr.com/view/50758/scroll-multiple-richtextboxes-or-textboxes-in-unison-synchronized-scrolling</guid>
    </item>
    <item>
      <title>(C#) RichTextBox, append a text string and high-light portions of the string that don\'t match a reference string. - jimfred</title>
      <link>https://snipplr.com/view/50731/richtextbox-append-a-text-string-and-highlight-portions-of-the-string-that-dont-match-a-reference-string</link>
      <description>&lt;p&gt;This static function will append a string to a RichTextBox while high-lighting characters that don't match a reference string. It's similar to a file-compare GUI that high-lights mis-matched characters.&#13;
&#13;
![alt text](https://docs.google.com/uc?id=0Bw1KoEBfCFrEMmY1ZmVjZjUtMGE4Ny00OWE0LTg1YWItNDkzNzljMWZiYTA2&amp;export=download&amp;authkey=CNOQvbwI&amp;hl=en)&lt;/p&gt;</description>
      <pubDate>Wed, 16 Mar 2011 14:34:01 UTC</pubDate>
      <guid>https://snipplr.com/view/50731/richtextbox-append-a-text-string-and-highlight-portions-of-the-string-that-dont-match-a-reference-string</guid>
    </item>
    <item>
      <title>(C#) C#, getting a reference to a property such as CheckBox.Checked - jimfred</title>
      <link>https://snipplr.com/view/40343/c-getting-a-reference-to-a-property-such-as-checkboxchecked</link>
      <description>&lt;p&gt;It\'s not possible to get a reference to a property in C#. A reference would allow getting/setting a property inside another function or while enumerating a list. The infoof operator would work but it doesn\'t exist yet. This code shows several ways to get a PropertyInfo for a given property. #4 is the simplest but has the disadvantage that the string will not auto-rename.&lt;/p&gt;</description>
      <pubDate>Sun, 12 Sep 2010 11:18:48 UTC</pubDate>
      <guid>https://snipplr.com/view/40343/c-getting-a-reference-to-a-property-such-as-checkboxchecked</guid>
    </item>
    <item>
      <title>(C#) C#, Bind a list of value-name pairs to a combobox - jimfred</title>
      <link>https://snipplr.com/view/40319/c-bind-a-list-of-valuename-pairs-to-a-combobox</link>
      <description>&lt;p&gt;This example shows how to bind a combobox to a list of value-name pairs. Selecting a value results in the appropriate text being displayed. This example uses both a Dictionary and an enum.&lt;/p&gt;</description>
      <pubDate>Sat, 11 Sep 2010 06:32:42 UTC</pubDate>
      <guid>https://snipplr.com/view/40319/c-bind-a-list-of-valuename-pairs-to-a-combobox</guid>
    </item>
    <item>
      <title>(C#) \'which\' command, in C# - jimfred</title>
      <link>https://snipplr.com/view/38735/which-command-in-c</link>
      <description>&lt;p&gt;This code came from the cs-script project. It\'s a C# implementation of the which command.&lt;/p&gt;</description>
      <pubDate>Mon, 09 Aug 2010 07:04:48 UTC</pubDate>
      <guid>https://snipplr.com/view/38735/which-command-in-c</guid>
    </item>
    <item>
      <title>(C#) C# WinForm, subclass a Checkbox control to create a better two-state button (Adds Checkbox within a Button) - jimfred</title>
      <link>https://snipplr.com/view/38657/c-winform-subclass-a-checkbox-control-to-create-a-better-twostate-button-adds-checkbox-within-a-button</link>
      <description>&lt;p&gt;See comments in code.&lt;/p&gt;</description>
      <pubDate>Sat, 07 Aug 2010 05:43:08 UTC</pubDate>
      <guid>https://snipplr.com/view/38657/c-winform-subclass-a-checkbox-control-to-create-a-better-twostate-button-adds-checkbox-within-a-button</guid>
    </item>
    <item>
      <title>(DOS Batch) Recursively clean Visual Studio SLN files - jimfred</title>
      <link>https://snipplr.com/view/38288/recursively-clean-visual-studio-sln-files</link>
      <description>&lt;p&gt;Simple batch file to recursively do a Clean for Visual Studio .SLN files.&lt;/p&gt;</description>
      <pubDate>Wed, 04 Aug 2010 01:32:10 UTC</pubDate>
      <guid>https://snipplr.com/view/38288/recursively-clean-visual-studio-sln-files</guid>
    </item>
    <item>
      <title>(C#) c#, deep compare - jimfred</title>
      <link>https://snipplr.com/view/37436/c-deep-compare</link>
      <description>&lt;p&gt;SequenceEqual&lt;/p&gt;</description>
      <pubDate>Thu, 15 Jul 2010 06:12:18 UTC</pubDate>
      <guid>https://snipplr.com/view/37436/c-deep-compare</guid>
    </item>
    <item>
      <title>(C#) Modal Progress dialog with cancel for time-consuming operations, C#, WinForms - jimfred</title>
      <link>https://snipplr.com/view/36749/modal-progress-dialog-with-cancel-for-timeconsuming-operations-c-winforms</link>
      <description>&lt;p&gt;Features/Requirements:\r\n\r\n[1] lightweight, easy-to-add\r\n[2] Display progress of long operation using (a) progress bar and (b) user-text.\r\n[3] Close dialog upon (a) Normal completion of long operation or (b) Cancel button used for early cancellation of long operation\r\n[4] GUI not hung/hourglassing during long operation. This can be done using threads or DoEvents. This example uses the BackgroundWorker class as a member of a Form.\r\n[5] Synchronized with no race conditions.\r\n\r\nThe form displayed consists of three elements: label, progress bar and a cancel button.  The label auto-sizes so that user text will be displayed.  The application constructs the dialog with parameters for titlebar text and a delegate for the long operation. The long operation reports progress using BackgroundWorker.ReportProgress. The long operation checks for cancellation using BackgroundWorker.CancellationPending\r\n\r\nSee code for example usage.&lt;/p&gt;</description>
      <pubDate>Tue, 06 Jul 2010 13:23:35 UTC</pubDate>
      <guid>https://snipplr.com/view/36749/modal-progress-dialog-with-cancel-for-timeconsuming-operations-c-winforms</guid>
    </item>
    <item>
      <title>(C++) MFC, Get default browser using AssocQueryString - jimfred</title>
      <link>https://snipplr.com/view/35940/mfc-get-default-browser-using-assocquerystring</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 21 Jun 2010 14:09:28 UTC</pubDate>
      <guid>https://snipplr.com/view/35940/mfc-get-default-browser-using-assocquerystring</guid>
    </item>
    <item>
      <title>(C++) Get a Registry string value as a CString, MFC. Examples to get version of browsers. - jimfred</title>
      <link>https://snipplr.com/view/35938/get-a-registry-string-value-as-a-cstring-mfc-examples-to-get-version-of-browsers</link>
      <description>&lt;p&gt;RegGetValue apparently isn't available in XP SP2. I tried and got an error. MSDN implied it wasn't available.&#13;
&#13;
Example usage to get versions of browsers:&#13;
&#13;
GetRegString( HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Internet Explorer", "Version" );&#13;
&#13;
GetRegString( HKEY_LOCAL_MACHINE, "Software\\Mozilla\\Mozilla Firefox", "CurrentVersion" );&lt;/p&gt;</description>
      <pubDate>Mon, 21 Jun 2010 13:44:22 UTC</pubDate>
      <guid>https://snipplr.com/view/35938/get-a-registry-string-value-as-a-cstring-mfc-examples-to-get-version-of-browsers</guid>
    </item>
    <item>
      <title>(C++) MFC, run command such as "ping 127.0.0.1" and get stdout in a CString. - jimfred</title>
      <link>https://snipplr.com/view/35935/mfc-run-command-such-as-ping-127001-and-get-stdout-in-a-cstring</link>
      <description>&lt;p&gt;Do the equivalent of ShellExecute or the Win16-compatible WinExec: Run a command. But, get the command's stdout output in a CString.&lt;/p&gt;</description>
      <pubDate>Mon, 21 Jun 2010 12:22:27 UTC</pubDate>
      <guid>https://snipplr.com/view/35935/mfc-run-command-such-as-ping-127001-and-get-stdout-in-a-cstring</guid>
    </item>
    <item>
      <title>(DOS Batch) Windows .LNK shortcut files, start application using relative rather than absolute paths. - jimfred</title>
      <link>https://snipplr.com/view/34415/windows-lnk-shortcut-files-start-application-using-relative-rather-than-absolute-paths</link>
      <description>&lt;p&gt;.LNK files only support absolute paths even when using IWshRuntimeLibrary.IWshShortcut.&#13;
&#13;
Early versions of Windows, such as XP, don't support symLinks unless CygWin is used.&#13;
&#13;
Q: How can a .LNK be created to start an app 'nearby' via a relative path? &#13;
&#13;
A: Use a regular .LNK shortcut file and pre-pend "cmd.exe /c start /d. " before the command. &#13;
&#13;
The 'cmd.exe' (should be in the path) starts a cmd window (similar to a .BAT file)&#13;
The '/c' (passed to cmd.exe) carries out the command and then terminates async.&#13;
The 'start' allows cmd to terminate - otherwise a cmd window would remain open.&#13;
The '/d .' (note the dot) will use the current directory as the default directory.&#13;
&#13;
&#13;
Example usage: &#13;
[1] On USB flash drives or CDs, start an app in a sub-directory.&#13;
[2] In software project directories, create for example, __projectFile__.lnk to point to the .SLN file. Such a .LNK file could be checked-in to SVN or SourceSafe etc.&#13;
&#13;
Variations:&#13;
Using a command of . (a single dot) will open a cmd window in the current directory where the .LNK is. &#13;
The '&amp;' cmd operator can string several commands together.&#13;
&#13;
Other options:&#13;
[1] batch file. With or without 'Bat To Exe Converter'. In fact, the only advantages of .LNK over a .BAT is that the .LNK doesn't pop-up a black CMD window (if  Run Minimized is used) and an icon can be used.&#13;
[2] shortcut.exe or scut.exe (3rd party tools I haven't tried)&#13;
[3] hex-edit the binary .LNK shortcut file (I haven't tried). Renaming and editing a .LNK can be tricky. The proprietary binary format is subject to change.&#13;
[4] menu utilities intended for USB flash drives (I haven't tried)&#13;
&#13;
How to modify the .LNK shortcut:&#13;
[1] right click on the shortcut. Expect context menu. Select Properties. Expect Properties dialog.&#13;
[2] Set 'Run Minimized' otherwise a black CMD window will briefly appear when the .LNK is used.&#13;
[3] Set target to:&#13;
    cmd.exe /c start /d. ..\a\a.txt&#13;
where ..\a\a.txt represents a relative path to your target.&#13;
[4] Optionally set an icon.&#13;
[5] 'Start in' can be blank.&#13;
Note: Windows will automatically replace, say, cmd.exe with C:\Windows\system32\cmd.exe which could break on another PC so, instead, use %windir%\system32\cmd.exe. &#13;
&#13;
Rant:&#13;
Symlinks are simpler, proven and intuitive. It's a major annoyance that the 'helpful' auto-modification of the .LNK by Windows complicates an otherwise conceptually simple objective. Microsoft finally added symlinks to later versions of NTFS which begs the question: what took so long especially since a good working model existed and could have been plagiarized earlier? &#13;
&#13;
This all becomes unnecessary with newer version of NTFS (after XP's version of NTFS) because newer versions of NTFS have symlinks. Somewhat related, in XP, this command shows the NTFS version: 'fsutil fsinfo ntfsinfo c:'&lt;/p&gt;</description>
      <pubDate>Thu, 13 May 2010 10:03:44 UTC</pubDate>
      <guid>https://snipplr.com/view/34415/windows-lnk-shortcut-files-start-application-using-relative-rather-than-absolute-paths</guid>
    </item>
    <item>
      <title>(C#) Read all bytes from a file. - jimfred</title>
      <link>https://snipplr.com/view/29339/read-all-bytes-from-a-file</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 05 Mar 2010 11:08:10 UTC</pubDate>
      <guid>https://snipplr.com/view/29339/read-all-bytes-from-a-file</guid>
    </item>
    <item>
      <title>(C++) C++, DLL, shared memory using pragma without touching .DEF file - jimfred</title>
      <link>https://snipplr.com/view/29140/c-dll-shared-memory-using-pragma-without-touching-def-file</link>
      <description>&lt;p&gt;myShared is an arbitrary name. It must not collide with names .bss etc (see /SECTION in MSDN).&#13;
&#13;
RWS indicates Read/Write/Shared. (See /SECTION in MSDN)&#13;
&#13;
Avoid sharing process-specific info such as pointers, HANDLEs etc.&#13;
&#13;
Won't work with Vista Services.&lt;/p&gt;</description>
      <pubDate>Tue, 02 Mar 2010 13:37:49 UTC</pubDate>
      <guid>https://snipplr.com/view/29140/c-dll-shared-memory-using-pragma-without-touching-def-file</guid>
    </item>
    <item>
      <title>(C++) MFC, edit INI file using ShellExecute - jimfred</title>
      <link>https://snipplr.com/view/29055/mfc-edit-ini-file-using-shellexecute</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 01 Mar 2010 12:06:52 UTC</pubDate>
      <guid>https://snipplr.com/view/29055/mfc-edit-ini-file-using-shellexecute</guid>
    </item>
    <item>
      <title>(C++) trivial example, C++, gcc, using simpleIni.h - jimfred</title>
      <link>https://snipplr.com/view/28877/trivial-example-c-gcc-using-simpleinih</link>
      <description>&lt;p&gt;http://stackoverflow.com/questions/12633/what-is-the-easiest-way-to-parse-an-ini-file-in-c&lt;/p&gt;</description>
      <pubDate>Wed, 24 Feb 2010 17:13:19 UTC</pubDate>
      <guid>https://snipplr.com/view/28877/trivial-example-c-gcc-using-simpleinih</guid>
    </item>
    <item>
      <title>(C#) C# WinForm, cause 'close' ('X') to hide instead of disposing by handling the WM_CLOSE message in WndProc. - jimfred</title>
      <link>https://snipplr.com/view/28143/c-winform-cause-close-x-to-hide-instead-of-disposing-by-handling-the-wmclose-message-in-wndproc</link>
      <description>&lt;p&gt;Typical scenario: app pops up a dialog, user clicks 'X' and the dialog disposes. If the app attempts to access the dialog then runtime errors occur. This approach allows the app to retain access to the dialog to re-show the dialog.&#13;
&#13;
An alternative would be for the app to check the disposed state of the dialog but this  Close--&gt;Hide approach is simpler and more transparent.&#13;
&#13;
http://www.pixvillage.com/blogs/devblog/archive/2005/03/26/174.aspx&#13;
&#13;
Source contains a simple WndProc that handles WM_CLOSE by calling Hide().&lt;/p&gt;</description>
      <pubDate>Wed, 10 Feb 2010 16:21:58 UTC</pubDate>
      <guid>https://snipplr.com/view/28143/c-winform-cause-close-x-to-hide-instead-of-disposing-by-handling-the-wmclose-message-in-wndproc</guid>
    </item>
    <item>
      <title>(C#) C#, draw sine wave on Bitmap and save to a file - jimfred</title>
      <link>https://snipplr.com/view/27706/c-draw-sine-wave-on-bitmap-and-save-to-a-file</link>
      <description>&lt;p&gt;For MFC, see: http://snipplr.com/view/24917/mfc-cimage-cmitmap-draw-a-sine-wave-and-save-to-a-bmp-file/&lt;/p&gt;</description>
      <pubDate>Thu, 04 Feb 2010 16:25:21 UTC</pubDate>
      <guid>https://snipplr.com/view/27706/c-draw-sine-wave-on-bitmap-and-save-to-a-file</guid>
    </item>
    <item>
      <title>(C#) C#, convert a double-null-terminated string to an array of strings. - jimfred</title>
      <link>https://snipplr.com/view/27336/c-convert-a-doublenullterminated-string-to-an-array-of-strings</link>
      <description>&lt;p&gt;Double-null-terminated strings are sometimes referred to as multistrings - \r\nhttp://stackoverflow.com/questions/268899/how-do-you-convert-multistring-to-from-c-string-collection\r\n\r\nmultistrings used in...\r\nOPENFILENAME::lpstrFilter  in common dialogs\r\nRegQueryStringValue\r\nChangeServiceConfig\r\n\r\nThis works somewhat...\r\nstring[] a2 = (new string(Buff)).TrimEnd(\'\\0\').Split(\'\\0\');\r\n...but includes junk after a double-null.&lt;/p&gt;</description>
      <pubDate>Fri, 29 Jan 2010 17:32:34 UTC</pubDate>
      <guid>https://snipplr.com/view/27336/c-convert-a-doublenullterminated-string-to-an-array-of-strings</guid>
    </item>
    <item>
      <title>(C#) #if defined( DEBUG) in C# - use [Conditional("DEBUG")] - jimfred</title>
      <link>https://snipplr.com/view/27333/if-defined-debug-in-c--use-conditionaldebug</link>
      <description>&lt;p&gt;System.Diagnostics.Debug uses [Conditional("DEBUG")].&#13;
&#13;
ILDASM.EXE shows that no code is generated.&lt;/p&gt;</description>
      <pubDate>Fri, 29 Jan 2010 16:38:17 UTC</pubDate>
      <guid>https://snipplr.com/view/27333/if-defined-debug-in-c--use-conditionaldebug</guid>
    </item>
    <item>
      <title>(C) Crystalfontz 533 code using Keil C51 - jimfred</title>
      <link>https://snipplr.com/view/26101/crystalfontz-533-code-using-keil-c51</link>
      <description>&lt;p&gt;Example code to exercise a Crystalfontz 533 display from a 8051 using Keil C51.&lt;/p&gt;</description>
      <pubDate>Thu, 07 Jan 2010 19:43:06 UTC</pubDate>
      <guid>https://snipplr.com/view/26101/crystalfontz-533-code-using-keil-c51</guid>
    </item>
    <item>
      <title>(C) Keil C51 character echo test for UART1 - jimfred</title>
      <link>https://snipplr.com/view/26029/keil-c51-character-echo-test-for-uart1</link>
      <description>&lt;p&gt;From Keil C51 examples, TEST.C:  ISD51 Demo for TI MSC 1210.&#13;
Polled (non-interrupt) mode.&#13;
&#13;
Work-around for dropped-characters related to stop-bit problem: Clear SCON1.5 (or SM2_1).&lt;/p&gt;</description>
      <pubDate>Wed, 06 Jan 2010 16:54:48 UTC</pubDate>
      <guid>https://snipplr.com/view/26029/keil-c51-character-echo-test-for-uart1</guid>
    </item>
    <item>
      <title>(C#) DataVisualization.Charting.Chart simple example - jimfred</title>
      <link>https://snipplr.com/view/25227/datavisualizationchartingchart-simple-example</link>
      <description>&lt;p&gt;For error...&#13;
&lt;code&gt;&#13;
 'The type or namespace name 'DataVisualization' does not exist in the namespace 'System.Windows.Forms' (are you missing an assembly reference?)&#13;
&lt;/code&gt;&#13;
...Here's how to install:&#13;
* Search for: download "Microsoft Chart Controls for Microsoft .NET Framework 3.5" and expect to find MSChart.exe. Download and install.&#13;
* Make sure the proj has a reference to System.Windows.Forms.DataVisualization.&#13;
&#13;
For an example (.SLN) that demonstrates usage of mschart, see http://code.msdn.microsoft.com/mschart or, search for "Samples Environment for Microsoft Chart Controls" on MSDN&lt;/p&gt;</description>
      <pubDate>Tue, 22 Dec 2009 11:27:30 UTC</pubDate>
      <guid>https://snipplr.com/view/25227/datavisualizationchartingchart-simple-example</guid>
    </item>
    <item>
      <title>(C#) Linear interpolation, C# - jimfred</title>
      <link>https://snipplr.com/view/25188/linear-interpolation-c</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 21 Dec 2009 18:38:43 UTC</pubDate>
      <guid>https://snipplr.com/view/25188/linear-interpolation-c</guid>
    </item>
    <item>
      <title>(C++) MFC, append text to textbox - jimfred</title>
      <link>https://snipplr.com/view/25041/mfc-append-text-to-textbox</link>
      <description>&lt;p&gt;Set textbox to multi-line. ASSERT statement verifies.&#13;
&#13;
Apparently executes quicker than GetWindowText, Append, SetWindowText.&#13;
&#13;
Appears to auto-scroll otherwise, use this to scroll to bottom:&#13;
edit.SendMessage(WM_VSCROLL, SB_BOTTOM, 0 );&#13;
&#13;
Haven't figured out how to stop scrolling when it's not already at the bottom.&lt;/p&gt;</description>
      <pubDate>Fri, 18 Dec 2009 18:17:18 UTC</pubDate>
      <guid>https://snipplr.com/view/25041/mfc-append-text-to-textbox</guid>
    </item>
    <item>
      <title>(C++) MFC, CImage, CMitmap, draw a sine wave and save to a BMP file. - jimfred</title>
      <link>https://snipplr.com/view/24917/mfc-cimage-cmitmap-draw-a-sine-wave-and-save-to-a-bmp-file</link>
      <description>&lt;p&gt;For C#, see http://snipplr.com/view/27706/c-draw-sine-wave-on-bitmap-and-save-to-a-file/&#13;
&#13;
Most examples seem to include a DC but I needed simple code to store MICR data to a BMP file.&lt;/p&gt;</description>
      <pubDate>Wed, 16 Dec 2009 16:09:21 UTC</pubDate>
      <guid>https://snipplr.com/view/24917/mfc-cimage-cmitmap-draw-a-sine-wave-and-save-to-a-bmp-file</guid>
    </item>
    <item>
      <title>(C++) MFC, browse CWD - jimfred</title>
      <link>https://snipplr.com/view/24854/mfc-browse-cwd</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 15 Dec 2009 17:30:30 UTC</pubDate>
      <guid>https://snipplr.com/view/24854/mfc-browse-cwd</guid>
    </item>
    <item>
      <title>(C#) Google Protocol Buffers, usage in C#, using Jon Skeet's protobuf-csharp-port - jimfred</title>
      <link>https://snipplr.com/view/24475/google-protocol-buffers-usage-in-c-using-jon-skeets-protobufcsharpport</link>
      <description>&lt;p&gt;This is a simple demo of Google Protocol Buffers in C# using Jon Skeet's protobuf C# port. The sample data type includes an array/list and nested types. The binary data is a smaller, faster alternative to XML or JSON. The C# built-in binary serializers created massive buffers that were 4x the size of JSON buffers.&lt;/p&gt;</description>
      <pubDate>Tue, 08 Dec 2009 16:30:52 UTC</pubDate>
      <guid>https://snipplr.com/view/24475/google-protocol-buffers-usage-in-c-using-jon-skeets-protobufcsharpport</guid>
    </item>
    <item>
      <title>(C#) Trivial  JSON example, serialization and deserialization - jimfred</title>
      <link>https://snipplr.com/view/24158/trivial--json-example-serialization-and-deserialization</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 02 Dec 2009 18:34:50 UTC</pubDate>
      <guid>https://snipplr.com/view/24158/trivial--json-example-serialization-and-deserialization</guid>
    </item>
    <item>
      <title>(C#) C# Cypress EEPROM Utility with interop calls to deviceIoControl for access to USB driver. - jimfred</title>
      <link>https://snipplr.com/view/23880/c-cypress-eeprom-utility-with-interop-calls-to-deviceiocontrol-for-access-to-usb-driver</link>
      <description>&lt;p&gt;Cypress FX2 EEPROM utility implemented in C#.net with interop calls to deviceIoControl for access to the USB driver. This utility reads, writes, verifies and erases the EEPROM. It embeds the vend_ax.hex firmware in a byte array and automatically downloads the firmware if it isn't detected in internal RAM. Some of the code was borrowed from the EzUsb or CyConsole utility. Some code was taken from the EzUsbSys.h file and re-defined for use in c#.&lt;/p&gt;</description>
      <pubDate>Sat, 28 Nov 2009 23:37:29 UTC</pubDate>
      <guid>https://snipplr.com/view/23880/c-cypress-eeprom-utility-with-interop-calls-to-deviceiocontrol-for-access-to-usb-driver</guid>
    </item>
    <item>
      <title>(C#) Input Box, similar to MessageBox, displays a prompt and accepts a string from the user. - jimfred</title>
      <link>https://snipplr.com/view/23494/input-box-similar-to-messagebox-displays-a-prompt-and-accepts-a-string-from-the-user</link>
      <description>&lt;p&gt;The URL has code for an InputBoxDialog class that implements a simple input dialog.&#13;
&#13;
The button flatstyle property might need to be changed to match the default.&lt;/p&gt;</description>
      <pubDate>Fri, 20 Nov 2009 12:21:09 UTC</pubDate>
      <guid>https://snipplr.com/view/23494/input-box-similar-to-messagebox-displays-a-prompt-and-accepts-a-string-from-the-user</guid>
    </item>
    <item>
      <title>(C++) MFC, How to avoid closing of the dialog boxes when ESCAPE key or ENTER key is pressed. - jimfred</title>
      <link>https://snipplr.com/view/22740/mfc-how-to-avoid-closing-of-the-dialog-boxes-when-escape-key-or-enter-key-is-pressed</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 08 Nov 2009 09:22:45 UTC</pubDate>
      <guid>https://snipplr.com/view/22740/mfc-how-to-avoid-closing-of-the-dialog-boxes-when-escape-key-or-enter-key-is-pressed</guid>
    </item>
    <item>
      <title>(C#) c#, resize dialog while maintaining aspect ratio by intercepting the WM_SIZING method in WndProc - jimfred</title>
      <link>https://snipplr.com/view/20721/c-resize-dialog-while-maintaining-aspect-ratio-by-intercepting-the-wmsizing-method-in-wndproc</link>
      <description>&lt;p&gt;This resizes the whole form.&#13;
In the case of PictureBoxes, consider resizing the picture box by subclassing PictureBox.&lt;/p&gt;</description>
      <pubDate>Tue, 06 Oct 2009 13:01:00 UTC</pubDate>
      <guid>https://snipplr.com/view/20721/c-resize-dialog-while-maintaining-aspect-ratio-by-intercepting-the-wmsizing-method-in-wndproc</guid>
    </item>
    <item>
      <title>(C#) Render names of C# bitfields using enums and  FlagsAttribute. Also, adjusting size of enum using, like ushort, for marshalling p - jimfred</title>
      <link>https://snipplr.com/view/19703/render-names-of-c-bitfields-using-enums-and--flagsattribute-also-adjusting-size-of-enum-using-like-ushort-for-marshalling-p</link>
      <description>&lt;p&gt;FlagsAttribute is useful to render a string indicating which status bits or flag bits are turned on. The resulting string will contain the name of the enum bit that is turned on without needed to maintain a separate string table.&#13;
&#13;
Note the inheritance-like syntax that determines the size of the enum. This is useful to adjust the size of enum structure members for marshaling with C.&lt;/p&gt;</description>
      <pubDate>Mon, 14 Sep 2009 13:23:52 UTC</pubDate>
      <guid>https://snipplr.com/view/19703/render-names-of-c-bitfields-using-enums-and--flagsattribute-also-adjusting-size-of-enum-using-like-ushort-for-marshalling-p</guid>
    </item>
    <item>
      <title>(C#) C#, single-instance-check using mutex. Implements a static function to be called in Program::Main(). - jimfred</title>
      <link>https://snipplr.com/view/19272/c-singleinstancecheck-using-mutex-implements-a-static-function-to-be-called-in-programmain</link>
      <description>&lt;p&gt;Scott Hanselman describes a method of using VB libraries to handle single-instance checking to prevent multiple instances of an app from starting. A mutex seems to be a simpler solution.\r\n\r\nAdd this class as a sibling to Main and then, inside Main, call this static member: SingleInstanceCheck.Check();&lt;/p&gt;</description>
      <pubDate>Fri, 04 Sep 2009 15:01:20 UTC</pubDate>
      <guid>https://snipplr.com/view/19272/c-singleinstancecheck-using-mutex-implements-a-static-function-to-be-called-in-programmain</guid>
    </item>
    <item>
      <title>(C#) C#, Get application name - jimfred</title>
      <link>https://snipplr.com/view/19269/c-get-application-name</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 04 Sep 2009 11:35:39 UTC</pubDate>
      <guid>https://snipplr.com/view/19269/c-get-application-name</guid>
    </item>
    <item>
      <title>(C#) C# reflection to display a struct's members with their descriptions - jimfred</title>
      <link>https://snipplr.com/view/18969/c-reflection-to-display-a-structs-members-with-their-descriptions</link>
      <description>&lt;p&gt;I frequently need to create a struct to be displayed in an app. The DescriptionAttribute is used to display a member's description.&#13;
&#13;
Room for improvement:&#13;
* nested structs/enums&#13;
* Implement a TreeViewAble Interface&lt;/p&gt;</description>
      <pubDate>Fri, 28 Aug 2009 18:06:09 UTC</pubDate>
      <guid>https://snipplr.com/view/18969/c-reflection-to-display-a-structs-members-with-their-descriptions</guid>
    </item>
    <item>
      <title>(C#) Simple enumeration of fields of a struct in C# using reflection - jimfred</title>
      <link>https://snipplr.com/view/18944/simple-enumeration-of-fields-of-a-struct-in-c-using-reflection</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 28 Aug 2009 03:30:42 UTC</pubDate>
      <guid>https://snipplr.com/view/18944/simple-enumeration-of-fields-of-a-struct-in-c-using-reflection</guid>
    </item>
    <item>
      <title>(SQL) MS Access, SQL JOIN syntax for 3-way table join - jimfred</title>
      <link>https://snipplr.com/view/18926/ms-access-sql-join-syntax-for-3way-table-join</link>
      <description>&lt;p&gt;In Microsoft Access, if you want to do more than one LEFT JOIN, you have to use parenthesis in the FROM clause otherwise, you get a "Missing Operator" error.&lt;/p&gt;</description>
      <pubDate>Thu, 27 Aug 2009 22:21:13 UTC</pubDate>
      <guid>https://snipplr.com/view/18926/ms-access-sql-join-syntax-for-3way-table-join</guid>
    </item>
    <item>
      <title>(C++) embed an MFC dialog-based app in a DLL and run using RunDll32 - jimfred</title>
      <link>https://snipplr.com/view/18801/embed-an-mfc-dialogbased-app-in-a-dll-and-run-using-rundll32</link>
      <description>&lt;p&gt;This approach allows an application to be embedded in a DLL. This is handy for diagnostic/maintenance utilities that are used with the DLL.&#13;
&#13;
Steps to create:&#13;
* Create a MFC DLL project&#13;
* Add a dialog&#13;
* Add an entry point function such as void CALLBACK AppInDll_Entry(HWND hwnd, HINSTANCE hinst, LPCSTR lpCmdLine, int nCmdShow)&#13;
* In this new function, do this:&#13;
	CDlgInDll dlg;&#13;
   theApp.m_pMainWnd = &amp;dlg;&#13;
	INT_PTR nResponse = dlg.DoModal();&#13;
* in CAppInDllApp::InitInstance(), do this&#13;
	INITCOMMONCONTROLSEX InitCtrls;&#13;
	InitCtrls.dwSize = sizeof(InitCtrls);&#13;
	InitCtrls.dwICC = ICC_WIN95_CLASSES;&#13;
	InitCommonControlsEx(&amp;InitCtrls);&#13;
&#13;
	SetRegistryKey(_T("Local AppWizard-Generated Applications"));&#13;
&#13;
   CWinApp::InitInstance();&#13;
* Launch the 'app' using runDll32, for example:&#13;
rundll32 AppInDll.dll AppInDll_Entry a b c&#13;
or &#13;
ShellExecute( NULL, "open", "c:\\windows\\system32\\rundll32.exe", "AppInDll.dll AppInDll_Entry a b c", NULL, SW_SHOWNORMAL) ;&lt;/p&gt;</description>
      <pubDate>Mon, 24 Aug 2009 18:52:02 UTC</pubDate>
      <guid>https://snipplr.com/view/18801/embed-an-mfc-dialogbased-app-in-a-dll-and-run-using-rundll32</guid>
    </item>
  </channel>
</rss>
