|Code Sample Page||View
Everything here compiles with Visual C++ 6 and probably
Visual C++ .NET also.
March 4th 2004
- Support for CFormView
- Now using CSubclassWnd
Nov. 7th 2003
|Changes to Cool
- Using OBM_COMBO bitmap arrow
- Enabled use of popup menu resource
- Popup menu using keyboard (VK_DOWN)
|CFormMDIChildWnd / CFormView_Indirect||Download: formview.zip
June 18th 2003
|Fun with CFormView!
Paul DiLascia described how to center CFormView in MSJ (Oct. 1996). I take it a little further here:
- Added scroll bars!
- Moved code from CFrameWnd to CMDIChildWnd
In this sample I also show how to create a formview with no dialog template (CFormView_Indirect).
May 23th 2002
|Adjustments to Onscreen
Keyboard by Randy More
- Special edit control focus handling
- Prepared for modeless keyboard dialog variant
- Programmatically creating dialog template
|CZip / CUnzip / CMFCZip / CMFCUnzip||Download: zip.zip
August 3rd 2004
Simple C++ wrapping of Gilles
zip code (version 1.01).
- Extended C++ wrapper using MFC (CFile/CMemFile)
- Simplified interface to crypt.c (contrib/cryptx.h) + demonstration (app.cpp)
- Implementation of proposal: unzAttach/unzDetach
- Demonstrates decompression of memory-based zipfiles (iomem.c/iomem_simple.c)
- Implementation of proposal: unzValidate (with crc-check)
- Implementation of proposal: 64 bit file operations (ZPOS_T,ioapi64.c,iowin64.zip)
- Academic exercise: ioapi-wrapper for zipWriteInFileInZip/zipCloseFileInZip and unzReadCurrentFile/unztell/unzCloseCurrentFile
Note: Debug build is 64 bits (sets ZPOS_T=ZOFF_T=fpos_t), other builds are default (ZPOS_T=uLong)
|CEditView / CRichEditView||Download: edit.zip
dec. 14th 2001
|The edit-views are easy
to use, but lacks some
basic functionality. This sample demonstrates a few CEditView and
- Plain text in CRichEditView
- CFontDialog (enhanced)
nov. 6th 2001
|If you don't like CStatusBarCtrl::SetIcon, then
this might be for you.
sept. 27th 2001
|Based on http://www.bcgsoft.com
Simple bitmap editor. Also capable of editing "sub-bitmaps".
aug. 16th 2001
|Straight MFC telnet server implementation. Unicode-enabled.|
aug. 17th 2001
|Based on http://codeguru.earthweb.com/misc/console2.shtml
Console app using CWinApp/CCommandLineInfo. Unicode-enabled.
aug. 17th 2001
|Based on http://www.codeproject.com/gdi/flickerfree.asp
CxMemDC class, derived from slightly modified CMemDC, can act as a memory-based bitmap DC. Sample program makes a drawing in memory and paste it to the clipboard.
Changes in CMemDC (base) class:
CHexDoc / View
Size: 22 KB
nov. 20th 2001
|Jeff Prosises simple hex-viewer (MSJ Apr. 1996). Brushed up. Utilizing more of the basic MFC facilites.|
|Info-ZIP's match||Download: match.zip
June 19th 2003
|Wildcard string match might not
useful to all and everybody, but it was a lifesaver for me...
Here's a little test program.
I do a little dance around match.c to make it understand Unicode.
ioapi is ultimate code in respect of versatility and simplicity, the
finest of code qualities. Please study it. Say goodbye to CreateFile,
_lopen, CFile.Open, CStdioFile.Open, fopen, _open and the rest...
Here I supply an Unicode variant of ioapi. Plus a few new functions: zgetlength_file, zgets_file. And a wrapper class (ioapi.hpp).
I also introduce a new interface: The Find file API (ffapi). Generic _findfirst/_findnext interface, implemented much like ioapi.
You can get the basic idea from reading these files:
ioapi: ioapi.h ioapi.c
ffapi: ffapi.h ffapi.c
More ioapi right below...
| Here Robert Jung's unarj
given the ioapi treatment (see above).
- Uniform file access: ioapi is also used to access the compressed files, inside the archive.
- Utilizing ffapi (see above).
Aug. 17th 2001
|Kernighan & Ritchie-derived qsort implementation, with a few more parameters. Win32+MSDOS projects.|
April 14th 2004
|An alternative take on the Win32
function StrFormatByteSize64, ie. format the value 1440000 as "1.37MB".
You can specify
number of significant digits. It's implemented using regular C runtime
library calls, using the double type. Did I get it right I wonder?
Please drop me a word if you know how to implement it using plain
April 14th 2004
generic profile interface. Access ini-files and registry profiles using
a single API.
|Portable Object Orientation in plain C||Download: ooinc.zip
April 29th 2003
|Do you recognize the examples to the
right? Using "handles" is neat - and it greatly facilitates creating
C++ wrappers later on.
See in this code example how the I like it done...
stream = NULL;
if (-1 != handle)
handle = NULL;
file = CreateFile()
if (file != INVALID_HANDLE_VALUE)
CloseHandle(file); file = NULL;
m_hWnd = CreateWindow();
m_hWnd = NULL;
July 13th 2004
Oblomov's .iso image reader is open-source, but tied in with Total
I think it deserves to be a lib, for C programmers to use in their programs.
- Replaced Windows heap allocation with regular C allocation.
- #pragma pack() protection of structures
- Ported from .cpp to .c
- CreateFile -> fopen (-> ioapi later)
- Fixed a bug (marked with BUG)
- Utilizing ffapi (see above)
- Unicode - no file name string conversions at all in Unicode build
- Added demo program (C++)
Future: I might give it the ioapi-treatment. Perhaps add writing capability.
CONTRIBUTIONS TO OPEN SOURCE PROJECTS
Size: 1.58 MB
May 9th 2005
|Added project files for MSVC and Code::Blocks. Renamed .cc files to .cpp.|
Size: 413 KB
Dec. 12th 2003
to the FreeExtractor.
Copyright 2000-2001 Andrew Fawcett.
Changes to MakeSFX:
- ini-file on command line. Took Default.ini and extended it a bit.
- Upgraded components (upx, zlib, unzip) to current versions
- Shortcut option: added an extra pipe: "app.lnk|app.exe|parameters"
- changed directory structure, to make backup excluding temporary files slightly easier (.\obj, .\output -> .\bin,.\debug,.\release)
|Arnold||Extensions to the Arnold CPC emulator.
Kevin Thacker 1995-2001.
Follow this link.
Size: 1.31 MB
aug. 28th 2001
on http://www.codeproject.com/bitmap/cximage.asp by Davide Pizzolato et al, version 1.01.
Superseeded by http://www.codeproject.com/bitmap/trans_cimage.asp
Unicode in Windows:
From the dawn of man and up till Windows 9X, Disk Operating Systems (and windowing systems) used 8 bit character strings (char in C), internally and externally, for filenames and everything else. This, I can tell you, caused some grief in countries with 'national' characters, i.e. the entire non-English-speaking world. Windows NT/2000/XP uses 16-bit character strings (wchar_t in C), internally and externally (Unicode), but continues to have complete support for 8 bit character strings, for applications that uses char. I know of very few applications that are actually using wchar_t, but when writing reusable code you can at least keep the window open for the foreigners. If you don't provide dual APIs (char + wchar_t), then at least replace char with the TCHAR macro (and use sizeof(TCHAR) a bit). Then people will have the option. Don’t forget the coders out in China and Japan!
Why do I care? Well, I just like generic code. Who doesn't? And I would like the days when national characters got garbled all the time to be long gone and never ever return...
Note: STL/MFC/ATL are Unicode enabled. COM is inherently Unicode.
HTML is not Unicode.
More... Unicode in Linux...
This page © Troels K. Updated May 9th 2005