Calvin Hsia's WebLog
thoughts from a professional developer
Customer question: what does the crash call stack mean
A customer asks: I read your article "Intentionally crash your program". I have some questions that...
Author: CalvinH Date: 12/07/2006
Timestamp digital pictures
I was given several dozen digital photos that I wanted to add to my collection. However, the camera...
Author: CalvinH Date: 12/04/2006
The preservation of numerical precision
A customer reported a difference in behavior when executing some code in the design time and in a...
Author: CalvinH Date: 10/24/2006
The return value of a method can be intercepted using BindEvent
Here’s a blog post that I wrote a long time ago, but forgot to publish. Marco Cenzato commented on...
Author: CalvinH Date: 10/20/2006
Is this a Vista bug?
A customer reported a crash of a VFP application while running under the new version of Windows:...
Author: CalvinH Date: 10/19/2006
Write your own hangman game
Many years ago (1985) I wrote a C program to play Hangman. I had decoded a word processor spelling...
Author: CalvinH Date: 10/09/2006
Play movies with an ActiveX control
I’ve been using Canon Powershot cameras for years, and they take movies in AVI format as well as...
Author: CalvinH Date: 09/28/2006
Strange collection class behavior with objects
Alan Stevens asks: Doug Kimzey discovered an odd behavior in the VFP collection class today. It only...
Author: CalvinH Date: 09/27/2006
Playing with NTFS File Streams
I was browsing MSDN, and I came across this article: A Programmer's Perspective on NTFS 2000 Part 1:...
Author: CalvinH Date: 09/26/2006
Visual Sorting Algorithm comparison
When I bought my first IBM PC around 1981, I wrote a program to demonstrate the speed of various...
Author: CalvinH Date: 09/19/2006
The Nametag Game
When I took my 3 year old son for the first day of preschool, there was a table with several...
Author: CalvinH Date: 09/14/2006
Does the VFP ODBC driver support subdirectories?
I received a question from a customer: I don't know how to search for this but does ODBC,...
Author: CalvinH Date: 08/29/2006
Create an ActiveX control using ATL that you can use from Fox, Excel, VB6, VB.Net
Creating an ActiveX control is a good exercise in understanding how one works. It also helps to have...
Author: CalvinH Date: 08/28/2006
Dynamically attaching a debugger
Sometimes something goes wrong with your program and you want to investigate why. You can start...
Author: CalvinH Date: 08/25/2006
Various ways to display multiple photographs: on a Fox form
My prior 2 posts show how to display multiple photos on a VB.Net form, first using the PictureBox...
Author: CalvinH Date: 08/24/2006
Various ways to display multiple photographs: Using Rects and thumbs
My prior post showed how to use an array of PictureBox controls to display multiple photographs on a...
Author: CalvinH Date: 08/22/2006
Various ways to display multiple photographs
You can use an array of PictureBox controls to display multiple photographs or other images. The...
Author: CalvinH Date: 08/18/2006
Bug: a readonly left-aligned textbox has a floating point number whose value changes
Here’s an interesting bug report. The code below shows two readonly textboxes on a form, both...
Author: CalvinH Date: 08/14/2006
Host the CLR and Generate IL to call a MessageBox
Here’s some C++ code to host the CLR. It’s an alternative to using COM Interop (see A Visual Basic...
Author: CalvinH Date: 08/07/2006
How to display a list of files in a grid
I received a question from a customer: I am trying to find a way to display a grid of files...
Author: CalvinH Date: 08/01/2006
Playing around with custom mouse cursors
Try running the code below. It creates a form and adds all the various types of baseclass controls...
Author: CalvinH Date: 07/28/2006
What was that strange character? The mystery deepens
In my last post, What's that funny character?, I asked about a particular character. In fact,...
Author: CalvinH Date: 07/27/2006
What's that funny character?
Run this code: CREATE CURSOR foo (line c(100)) LIST STRUCTURE TO t.txt APPEND FROM t.txt sdf GO...
Author: CalvinH Date: 07/26/2006
National Public Radio Car Talk
You may have heard a radio show on National Public Radio called Car Talk hosted by Tom and Ray...
Author: CalvinH Date: 07/25/2006
Off to the races!
One of our customers writes software for drag racers (see Fox helps drag racer win Microsoft Start...
Author: CalvinH Date: 07/24/2006
Analyzing Blog hit statistics
It takes a lot of work to create the blog posts and code samples that I put in my blog, and I was...
Author: CalvinH Date: 07/20/2006
Add a slider control to your TreeMap to vary how much detail is shown
I was running really low on disk space on one of my machines, so I ran my Treemap utility on it (see...
Author: CalvinH Date: 07/19/2006
Use a different kind of grid in your applications
My prior post (Create a .Net UserControl that calls a web service that acts as an ActiveX control to...
Author: CalvinH Date: 07/18/2006
Create a .Net UserControl that calls a web service that acts as an ActiveX control to use in Excel, VB6, Foxpro
Here’s how you can use Visual Studio to create a .Net User Control that will act as an ActiveX...
Author: CalvinH Date: 07/14/2006
SmartPhone running low on memory due to Storage Card recognition
For some reason, my SmartPhone was giving me a message that memory was full. I hadn’t done anything...
Author: CalvinH Date: 07/14/2006
Handling arbitrary strings in URLs: Escape, InternetCanonicalizeUrl, WinHttpCrackUrl and URI.EscapeUriString
Sometimes a web application might want to put arbitrary strings into a URL, and make it a valid URL....
Author: CalvinH Date: 07/07/2006
Check for a valid datasource from within the correct datasession
Here’s an interesting one. You can use hotkey’s to type in certain strings for quick data entry. I...
Author: CalvinH Date: 06/26/2006
Can you read or seek from an embedded file?
Sometimes you might want to embed a file inside an exe. For example, if you add a file into a...
Author: CalvinH Date: 06/23/2006
Why doesn't my form close?
If you run the code below, you’ll get an error message. The grid height is being set to 19, which is...
Author: CalvinH Date: 06/22/2006
Use temporary projects in Visual Studio
I like experimenting with code. I typically have no idea what my experiment will be called or what...
Author: CalvinH Date: 06/20/2006
Specifying the size of the program cache
A customer asked 1) Is it better to set it to 0 (Auto) or some "larger" number, such as -16...
Author: CalvinH Date: 06/16/2006
Customizing the Blog Crawler for different formats
I’ve had several requests that require customizing the Blog Crawler. The entire source code of the...
Author: CalvinH Date: 06/15/2006
How does EventHandler work? IConnectionPoint!
The EventHandler function allows you to connect some code to an object’s event interface. For...
Author: CalvinH Date: 06/14/2006
The VB version of the Blog Crawler
This is the VB.Net 2005 version of the Blog Crawler. It’s based on the Foxpro version, but.it uses...
Author: CalvinH Date: 06/12/2006
If your machine freezes, maybe you can reboot it gracefully from another machine
For some reason, one of my machines running Windows XP seemed to die while I was away at a meeting....
Author: CalvinH Date: 06/09/2006
Use conditional build events to freshen zip files in Visual Studio
I wanted to update a couple zip files of the VB version of my Blog Crawler (to be posted soon) with...
Author: CalvinH Date: 06/06/2006
Error Reading File infinite loop if drive disabled while file open and Data Session window open
If you have a file open on some drive (perhaps a USB or network drive) and the Data Session window...
Author: CalvinH Date: 06/05/2006
Webcrawl a blog to retrieve all entries locally: RSS on steroids
Today’s sample shows how to create a web crawler in the background. This crawler starts with a web...
Author: CalvinH Date: 05/25/2006
More Multithread capabilities: interthread synchronization, error checking
In a prior post: Create multiple threads from within your application, there is a sample Thread...
Author: CalvinH Date: 05/23/2006
Meeting with some customers, manipulating SQL Server with Stored Procs
I met with some customers today from one company. They took time from their busy schedule to travel...
Author: CalvinH Date: 05/19/2006