Calvin Hsia's WebLog

thoughts from a professional developer

  • 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

    • 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

    Sample program to create multiple threads

    • 41 Comments
    I used the CreateThread call and the Heap functions to create a simple sample program that spawns a separate thread that displays a MessageBox Try running it and you will see a MessageBox. However, unlike a normal MessageBox in your application, this...
  • Calvin Hsia's WebLog

    Turtle Graphics Logo Program

    • 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...
  • Calvin Hsia's WebLog

    Customize the VS debugger display of your data

    • 15 Comments
    As a software developer, I spend much of my time looking at code, learning how it works, and figuring out how to modify or fix it. A very good tool to help examine code is the Visual Studio debugger. (Even if you’re not a hard core programmer, the...
  • Calvin Hsia's WebLog

    What is taking up the space on your hard disk? TreeMap it!

    • 21 Comments
    Several years ago, I saw a presentation from Microsoft Research about online communication in communities . In particular, a group was studying online communities based on NewsGroup message traffic volume. One of the results was a graphical view of the...
  • Calvin Hsia's WebLog

    What is an index anyway?

    • 12 Comments
    Foxpro’s legendary speed is due in part to its index technology. About 14 years ago, the speed of Foxpro was demonstrated to live audiences around the country. A table (places.dbf) of almost 3 million streets in the US was used as the demo data (about...
  • Calvin Hsia's WebLog

    Very Advanced Debugging tips

    • 9 Comments
    While debugging code, it might take very many complicated steps to reproduce an issue. The following applies to debugging both Visual FoxPro and Visual Studio Native code debugging, except where noted. The VFP debugger is modeled after the VS debugger...
  • Calvin Hsia's WebLog

    How to schedule your computer to run tasks automatically

    • 7 Comments
    Our building will have a power failure at a particular time. You may want your computer to stay on til just before the power goes out due to various reasons: It may be a web or file server serving other clients around the world. You may want...
  • Calvin Hsia's WebLog

    Why was the original IBM PC 4.77 Megahertz?

    • 34 Comments
    In 1979, I had a summer job on Long Island , NY designing a circuit board for the front panel of a satellite control system. That was the time Apple II and Radio Shack were top selling computers. We were designing a circuit board that had an embedded...
  • Calvin Hsia's WebLog

    Sudoku puzzles screen capture

    • 17 Comments
    I love doing crossword puzzles: I’m a huge fan of Merle Reagle (I have all his books www.sundaycrosswords.com ) and I love the NY Times Sunday puzzles, both of which come in the Seattle Times. We also love listening to the NPR Sunday Puzzle by Puzzlemaster...
  • Calvin Hsia's WebLog

    Create your own Word Search puzzles

    • 27 Comments
    I wrote a Word Search generating program in C++ (308 lines) years ago: my brother used it to generate a puzzle including all the girls in his 8 th grade class, which was 22 years ago: about 1984 (sounds Orwellian<g>). I wrote one in C# (456 lines...
  • Calvin Hsia's WebLog

    How fast is interop code?

    • 22 Comments
    How fast is interop code? If you’re in one kind of code and your calling another, what is the cost of the interop? For example, .Net code can call native C++ code (like Windows APIs) and vice versa. Similarly with Foxpro and C++ code. .Net code...
  • Calvin Hsia's WebLog

    Run your code in response to a new drive being inserted

    • 6 Comments
    At the Las Vegas Devcon last month I used a digital camera to take a picture, then I plugged the camera media into my Tablet PC which was running the Visual Foxpro code below. The pictures on the media were automatically detected by the event handler...
  • Calvin Hsia's WebLog

    Examine .Net Memory Leaks

    • 8 Comments
    Writing programs using .Net is very productive. One reason is because much of memory management is “managed” for you. In C, C++ and other “native” languages, if you allocate memory, you’re responsible for freeing it. There were stopgap measures, like...
  • Calvin Hsia's WebLog

    Dr. Watson: Please send in your error report

    • 29 Comments
    I bet you’ve seen dialogs similar to this: We at Microsoft refer to this dialog/technology as Dr. Watson (after the famous Sherlock Holmes assistant). Before Watson, computer users would get the BSOD (The Blue Screen of Death)...
  • Calvin Hsia's WebLog

    Enable people to run your programs without installing anything

    • 8 Comments
    Sometimes friends or relatives might hear that you’re an expert with using computers, and might ask you to help them solve a problem. Indeed, when I moved from Boston to Hawaii to be with my family in 1984, people heard that I was a graduate of...
  • Calvin Hsia's WebLog

    Start using XML and XSLT to create HTML

    • 18 Comments
    Tonight at the Seattle Visual Foxpro user group meeting Richard Stanton gave a great presentation of the new reporting features of VFP9, which is currently available in beta . The question came up about how to use XSLT to create HTML from XML. I...
  • Calvin Hsia's WebLog

    Blogs get 300 hits per hour: Visual FoxPro can count.

    • 17 Comments
    I wanted to get a picture into my blog, which isn’t run by my web site. It actually gets posted to 2 URLs: http://blogs.msdn.com/calvin_hsia or at http://weblogs.asp.net/calvin_hsia I can view and edit my entry in HTML, so I just added an...
  • Calvin Hsia's WebLog

    Designing User Interface for car keys

    • 14 Comments
    Here at Microsoft we have people called Program Managers (PMs) whose job is to design a product. They’re the ones that make a feature usable to the customer. A remote keyless entry car fob is quite useful. It’s essentially a wireless...
  • Calvin Hsia's WebLog

    Independence Day for blogging

    • 68 Comments
    Since July 4 th is nearing, I thought it would be appropriate to start my independent blog. In this first entry, I’ll add a few pointers to prior entries that I made to our VSData team blog. Solving a customer problem is my blog narrative describing an...
  • Calvin Hsia's WebLog

    Overload Operator new to detect memory leaks

    • 5 Comments
    There are various leak detection methods for memory allocators. A popular one is to tag each allocation with some information about the caller. When there’s a memory leak, you just need to look at that tag info to find the line of code that allocated...
  • Calvin Hsia's WebLog

    How to log application API calls using import module addresses

    • 8 Comments
    Let’s log all the calls that Excel makes to open or create a file. Start Visual Studio (any version), choose File->Open->Projects. In the dialog, change the “Files of Type” to “Executable Files (*.exe)” Choose any application like Excel...
  • Calvin Hsia's WebLog

    GDI+ can't handle some malformed JPG files

    • 10 Comments
    I received a comment on my blog VFP handles some images differently with GDIPlus Here's another problem with the way that VFP hooks into GDI+. If a JPG has malformed EXIF data, VFP will refuse to display it in a standard picture object. It returns...
  • Calvin Hsia's WebLog

    Decoding the timestamp in class libararies and forms

    • 4 Comments
    I was asked Is there a way to translate the timestamp in a VCX to a human readable format? Visual Foxpro puts a timestamp on many records in the table that represents a form or class library. Historically this field was used to match records across supported...
  • Calvin Hsia's WebLog

    Write your own Task Manager

    • 20 Comments
    Often an error message occurs: “The process cannot access the file because it is being used by another process.” Typically it occurs when you try to copy or rebuild the file. How do you determine which process is using it? One way to release the...
Page 2 of 18 (427 items) 12345»