Sign in
Calvin Hsia's WebLog
thoughts from a professional developer
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Email Blog Author
RSS for posts
Atom
RSS for comments
OK
Search
Tags
64bit
C++
CSharp
Debugging
FunGames
History
LINQ
Memory
Mesh
Miscellaneous
Pictures
Programming
SmartPhone
Testing
VB
Vista
Visual FoxPro
Visual Studio
Web
Windows API
WPF
Archive
Archives
April 2013
(2)
March 2013
(1)
February 2013
(1)
January 2013
(1)
December 2012
(1)
November 2012
(1)
October 2012
(1)
September 2012
(1)
August 2012
(1)
July 2012
(1)
June 2012
(1)
May 2012
(2)
March 2012
(1)
February 2012
(1)
January 2012
(1)
December 2011
(1)
November 2011
(1)
October 2011
(1)
September 2011
(1)
August 2011
(1)
July 2011
(1)
June 2011
(1)
May 2011
(1)
April 2011
(1)
March 2011
(1)
February 2011
(1)
January 2011
(1)
December 2010
(2)
November 2010
(1)
October 2010
(1)
September 2010
(1)
August 2010
(1)
July 2010
(1)
June 2010
(1)
May 2010
(1)
April 2010
(1)
March 2010
(2)
February 2010
(1)
January 2010
(1)
December 2009
(1)
November 2009
(1)
October 2009
(1)
September 2009
(1)
August 2009
(1)
July 2009
(1)
June 2009
(1)
May 2009
(1)
April 2009
(1)
March 2009
(2)
February 2009
(1)
January 2009
(2)
December 2008
(1)
November 2008
(1)
October 2008
(1)
September 2008
(1)
August 2008
(1)
July 2008
(3)
June 2008
(2)
May 2008
(2)
April 2008
(2)
March 2008
(2)
February 2008
(2)
January 2008
(2)
December 2007
(3)
November 2007
(8)
October 2007
(6)
September 2007
(4)
August 2007
(9)
July 2007
(2)
June 2007
(2)
May 2007
(11)
April 2007
(5)
March 2007
(2)
February 2007
(2)
January 2007
(1)
December 2006
(2)
November 2006
(1)
October 2006
(4)
September 2006
(6)
August 2006
(10)
July 2006
(13)
June 2006
(11)
May 2006
(7)
April 2006
(8)
March 2006
(14)
February 2006
(5)
January 2006
(21)
December 2005
(9)
November 2005
(19)
October 2005
(20)
September 2005
(12)
August 2005
(23)
July 2005
(12)
June 2005
(8)
May 2005
(7)
April 2005
(4)
March 2005
(1)
February 2005
(2)
January 2005
(13)
December 2004
(9)
November 2004
(4)
October 2004
(10)
September 2004
(4)
August 2004
(8)
July 2004
(1)
June 2004
(10)
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Calvin Hsia's WebLog
Reboot from remote desktop
Posted
over 9 years ago
by
CalvinH
64
Comments
Remote Desktop (mstsc.exe) is great: it allows me to access another remote machine as if I were sitting at its keyboard and seeing its screen. My web server sits on top of a 7 foot tall bookcase but I have no need to touch it: I can use RD from other...
Calvin Hsia's WebLog
What is a C0000005 crash?
Posted
over 9 years ago
by
CalvinH
35
Comments
In my blog about Dr. Watson I talked about product crashes. What is an example of a crash? How destructive is it? Here’s a simple example. MyFunction takes a string parameter and calculates its length MyFunction ( char * StringParam...
Calvin Hsia's WebLog
Creating a VFP application as a service:
Posted
over 9 years ago
by
CalvinH
29
Comments
Sometimes it’s useful to make your application run as a service. A service can run without any user logged in, can automatically start upon reboot, and can survive user logoffs. It can also run as a different user with different access rights. Normally...
Calvin Hsia's WebLog
Watch the Autocomplete values change as you enter data
Posted
over 8 years ago
by
CalvinH
7
Comments
Here is some code to demonstrate the AutoComplete property Its behavior is very similar to Outlook 2003 or the Internet Explorer Address URL entry control. It prompts the user with possible entries in a drop down like Intellisense. The code creates...
Calvin Hsia's WebLog
Add a manifest to control your application Vista UAC behavior
Posted
over 6 years ago
by
CalvinH
14
Comments
Try this on Windows XP or Vista (I don’t remember if manifests are allowed on Win2000: can someone confirm please? Thanks) Start Notepad, then choose File->Open and navigate to c:\windows\system32\notepad.exe and click Open. Hit Ctrl-F to...
Calvin Hsia's WebLog
Word to audible speech
Posted
over 8 years ago
by
CalvinH
54
Comments
Here’s some interesting code to run. It starts Microsoft Word and binds some Fox code to some Word events. Type some text into the document. Select some text. When the Selection Change event occurs, the Foxpro code creates the speech API object...
Calvin Hsia's WebLog
Enable crop and zooming in on your digital photograph display form
Posted
over 8 years ago
by
CalvinH
22
Comments
I wanted to add the ability to zoom into a portion of a photograph on my photo viewer. Below is some code that processes the MouseUp, MouseDown and MouseMove events to add a yellow dotted-dash selection rectangle using a Shape control that the mouse can...
Calvin Hsia's WebLog
Create an ActiveX control using ATL that you can use from Fox, Excel, VB6, VB.Net
Posted
over 7 years ago
by
CalvinH
21
Comments
Creating an ActiveX control is a good exercise in understanding how one works. It also helps to have full control over its source code for learning and testing purposes. A customer asked about migrating legacy ActiveX controls over to .Net. Many controls...
Calvin Hsia's WebLog
Foxpro Performance tip: field name lookup for tables
Posted
over 9 years ago
by
CalvinH
11
Comments
When FoxPro opens or uses a table or cursor, internally we have to keep track of the field names used in that table. For example, this statement creates a table with 3 fields. CREATE TABLE foo ( lastname c( 10 ), firstname c( 10 ),address c( 20 )) When...
Calvin Hsia's WebLog
I want my own email! MSN Premium
Posted
over 9 years ago
by
CalvinH
177
Comments
My 7 year old daughter Wendy has been clamoring for her own email account, among other things (like her own cell phone). She’s been using a computer for years, and has been using my old web server laptop as her main machine, mainly to surf kids...
Calvin Hsia's WebLog
Use a simple XSLT to read the RSS feed from a blog
Posted
over 8 years ago
by
CalvinH
13
Comments
On most Blogs, there is a link called “Syndication”,”RSS”, or “XML” that is the RSS feed. Click on that, and you see an XML document that contains some recent blog posts. This simple code reads the RSS feed for my blog, does an XSLT transform of the XML...
Calvin Hsia's WebLog
Disappearing Window Contents while dragging the mouse
Posted
over 9 years ago
by
CalvinH
14
Comments
We have heard a couple reports of strange behavior in Visual FoxPro if you click on a thumb button in a scrollbar, drag it up or down a little, then pause for 6 seconds or so. The contents of the window would disappear, leaving a blank editing window...
Calvin Hsia's WebLog
Out of memory? Easy ways to increase the memory available to your program
Posted
over 3 years ago
by
CalvinH
11
Comments
When you run your VB or C# application, you might get an OutOfMemoryException thrown, even if your machine has lots of memory. Every 32 bit process has a 2^32 bit (4 Gig) address space. That means every pointer has a size of 32 bits (4 bytes) and...
Calvin Hsia's WebLog
Use conditional build events to freshen zip files in Visual Studio
Posted
over 7 years ago
by
CalvinH
40
Comments
I wanted to update a couple zip files of the VB version of my Blog Crawler (to be posted soon) with the latest and greatest when I built the Release version of a project. I used the XCOPY command with the /D option to update only if changed. Copying to...
Calvin Hsia's WebLog
Relaxen und watchen das blinkenlights. What lights?
Posted
over 8 years ago
by
CalvinH
25
Comments
In the old days, computers had blinking lights. Indeed, old movies used to show computers working with blinking lights and tape reels moving back and forth. My school computer was a PDP-8/L with a whopping memory of 4K 12 bit words back in 1971. (Here...
Calvin Hsia's WebLog
A Visual Basic COM object is simple to create, call and debug from Excel
Posted
over 8 years ago
by
CalvinH
8
Comments
At the SouthWest Fox conference in Phoenix I asked “How many people have Visual Studio?” Almost everybody raised their hand. Then I asked “How many people have used it?” Very few hands were raised. Here’s a simple way to create some VB.Net code and call...
Calvin Hsia's WebLog
Undocumented APIs and 16 bit DLLs
Posted
over 8 years ago
by
CalvinH
18
Comments
As a long time software company, Microsoft has certain procedures to follow when releasing software to the public. A change to the policy was instituted at Microsoft last year. A brand new tool would scan all released software to see if any “undocumented...
Calvin Hsia's WebLog
Make your code more maintainable: The evils of the Return statement
Posted
over 5 years ago
by
CalvinH
9
Comments
What does it mean to make code more maintainable? Certainly obfuscated code is hard to understand, by definition. A big part of maintainability is making it easier for others to read and understand what the code is doing. Your code may have been...
Calvin Hsia's WebLog
Host the CLR and Generate IL to call a MessageBox
Posted
over 7 years ago
by
CalvinH
6
Comments
Here’s some C++ code to host the CLR. It’s an alternative to using COM Interop (s ee A Visual Basic COM object is simple to create, call and debug from Excel ), or using a User Control (see Create a .Net UserControl that calls a web service that acts...
Calvin Hsia's WebLog
SQL Select data from a text file
Posted
over 8 years ago
by
CalvinH
2
Comments
It’s often very useful to be able to execute a SQL SELECT statement on a text file. I was debugging a multiprocess multithread Foxpro COM DLL problem in a COM+ application . To help diagnose the problem, I wanted to figure out the sequence...
Calvin Hsia's WebLog
Start your Screen Saver NOW!
Posted
over 9 years ago
by
CalvinH
7
Comments
Now that Las Vegas Devcon is over, I’ll be posting some of my sample code from the keynote and my session here. I demonstrated how to make a simple VFP screen saver. To test it, invoking it immediately is useful. Windows XP allows you to have a screen...
Calvin Hsia's WebLog
Strongly typed methods and properties
Posted
over 8 years ago
by
CalvinH
12
Comments
VFP allows you to generate COM servers using the OLEPUBLIC keyword. These objects can have custom properties. For example, a Customer object can have an Address property of type string. Other client applications (VFP, Excel, VB.Net, VB Script) can...
Calvin Hsia's WebLog
Magnify your pictures using a PictureBox so that you can zoom with the Mouse Wheel
Posted
over 5 years ago
by
CalvinH
15
Comments
Today’s digital cameras take pictures with much higher resolution than many computer screens. My Canon PowerShot SD800 IS camera takes pictures at 3072 x 2204 resolution. One of my laptops died recently, and I noticed that local laptop retailers...
Calvin Hsia's WebLog
Create a .Net UserControl that calls a web service that acts as an ActiveX control to use in Excel, VB6, Foxpro
Posted
over 7 years ago
by
CalvinH
23
Comments
Here’s how you can use Visual Studio to create a .Net User Control that will act as an ActiveX control that can be used in Excel (or other Office application), VB6 or Foxpro. This will bring the power of the entire.Net Framework to your program. This...
Calvin Hsia's WebLog
Turtle Graphics Logo Program
Posted
over 7 years ago
by
CalvinH
14
Comments
Warning: this simple program produces mesmerizing spirographic images that seem hallucinatory in nature! Discretion is advised! Do not drive while watching these graphics! Almost 30 years ago, I had heard about a concept developed by Professor...
Page 1 of 17 (410 items)
1
2
3
4
5
»