Calvin Hsia's WebLog

thoughts from a professional developer

  • Calvin Hsia's WebLog

    Add a manifest to control your application Vista UAC behavior

    • 15 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

    Why doesn't Microsoft Excel Spreadsheet control work?

    • 7 Comments
    We received a bug report: Steps to Reproduce : Open the form designer by creating a new form. Insert a an ActiveX control and select "Microsoft Office Spreadsheet 11.0" Actual Results : OLE error code 0x80040202: Unknown COM status code...
  • Calvin Hsia's WebLog

    The MVPs are coming!

    • 3 Comments
    I was quoted in this Computerworld article about the MVP summit, which is happening this week in Seattle . The author says I compiled a “spreadsheet that ranked the most prolific posters on the FoxPro forum”. That is slightly incorrect: obvious...
  • Calvin Hsia's WebLog

    New printers are far more capable: Canon iP4300

    • 3 Comments
    Our several year old ink jet printer died the other day. It was an Epson Stylus Pro 5000. I knew it was on its way out, so I had been researching printers a little recently. I knew that printer quality and features had been growing substantially in recent...
  • 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

    Another way to get data into a web page: using OleDB or ODBC

    • 1 Comments
    Here’s a way to get data into a web page to be viewed by a web browser. The code first spits out some text into a variable, then writes the variable to a file in the c:\Inetpub\WWWRoot folder. If you have Internet Information Server installed (on...
  • Calvin Hsia's WebLog

    Word did not seem to be working

    • 2 Comments
    I wanted to create a document, so I went to Outlook, which I always have running, and type Ctrl-N to create a new Mail message. From the new mail message, I could type Alt-F, N and then Enter to choose File->New->Blank Document. (Tools...
  • Calvin Hsia's WebLog

    Customer question: what does the crash call stack mean

    • 1 Comments
    A customer asks: I read your article "Intentionally crash your program". I have some questions that I hope you can answer. When a fatal exception happens, foxpro display the calling stacks. How to read the calling stacks? A calling stack seems...
  • Calvin Hsia's WebLog

    Timestamp digital pictures

    • 7 Comments
    I was given several dozen digital photos that I wanted to add to my collection. However, the camera used did not have the date/time set. Worst still, each time the camera was turned on, the camera clock started ticking from the same time (1/1/2004 midnight...
  • Calvin Hsia's WebLog

    Here's an infinite loop that will hang your machine

    • 4 Comments
    Don’t try running this code: CREATE CURSOR test ( name c( 10 ), data m) *_vfp.EditorOptions="LQT" INSERT INTO test VALUES ("fred","test http://www.msn.com"+ CHR ( 0 )+" other stuff") MODIFY MEMO data nowait It creates an in memory...
  • Calvin Hsia's WebLog

    The preservation of numerical precision

    • 1 Comments
    A customer reported a difference in behavior when executing some code in the design time and in a COM dll. You can run this code to see it: (use the server created from http://blogs.msdn.com/calvin_hsia/archive/2004/06/18/159550.aspx ) ? SET...
  • Calvin Hsia's WebLog

    The return value of a method can be intercepted using BindEvent

    • 1 Comments
    Here’s a blog post that I wrote a long time ago, but forgot to publish. Marco Cenzato commented on Why doesn't my form close? Here is another case; what do you think: is related? ** Comment the define and rerun the program # Define...
  • Calvin Hsia's WebLog

    Is this a Vista bug?

    • 4 Comments
    A customer reported a crash of a VFP application while running under the new version of Windows: Vista. The customer code attempted to automate the configuration of the web server (See Automating Web Site Administration Using IIS ). Specifically...
  • Calvin Hsia's WebLog

    Write your own hangman game

    • 7 Comments
    Many years ago (1985) I wrote a C program to play Hangman. I had decoded a word processor spelling dictionary for my word source. More recently, I have encoded 2 spelling dictionaries for general purpose use: 1 with 171201 words, the other with...
  • Calvin Hsia's WebLog

    Play movies with an ActiveX control

    • 1 Comments
    I’ve been using Canon Powershot cameras for years, and they take movies in AVI format as well as being a good camera. I store my photos and movies in the same folders, and use the same database to store them. To display the movies, I add a Windows...
  • Calvin Hsia's WebLog

    Strange collection class behavior with objects

    • 3 Comments
    Alan Stevens asks: Doug Kimzey discovered an odd behavior in the VFP collection class today. It only occurs when the collection members are objects. Try running the following code, and see if you can make sense of it. For extra confusion, uncomment...
  • Calvin Hsia's WebLog

    Playing with NTFS File Streams

    • 3 Comments
    I was browsing MSDN, and I came across this article: A Programmer's Perspective on NTFS 2000 Part 1: Stream and Hard Link So I copied the code from Calling the Windows APIs for Large Files , modified it a little, and came up with a sample program...
  • Calvin Hsia's WebLog

    Visual Sorting Algorithm comparison

    • 3 Comments
    When I bought my first IBM PC around 1981, I wrote a program to demonstrate the speed of various sorting algorithms. It filled the screen with random characters, then the user could choose amongst a few sorting techniques and watch the sort algorithm...
  • Calvin Hsia's WebLog

    The Nametag Game

    • 6 Comments
    When I took my 3 year old son for the first day of preschool, there was a table with several nametags for the students. I asked him if he knew which one was his, and he correctly pointed out the right one. Below is sample code in Fox and VB.net that...
  • 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

    Does the VFP ODBC driver support subdirectories?

    • 6 Comments
    I received a question from a customer: I don't know how to search for this but does ODBC, specfically Visual FoxPro support opening tables in a subdirectory? ODBC is very old.. OLEDb is much more recent. In any case, the answer is yes...
  • Calvin Hsia's WebLog

    Create an ActiveX control using ATL that you can use from Fox, Excel, VB6, VB.Net

    • 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

    Dynamically attaching a debugger

    • 4 Comments
    Sometimes something goes wrong with your program and you want to investigate why. You can start Visual Studio, choose Debug->Attach to Process and choose the process you want to debug. (The dialog also allows remote debugging and choosing Native, Managed...
  • Calvin Hsia's WebLog

    Various ways to display multiple photographs: on a Fox form

    • 3 Comments
    My prior 2 posts show how to display multiple photos on a VB.Net form, first using the PictureBox control, the second drawing to the form directly. Below is some code to display multiple photos on a Fox form using an array of Fox Image controls . These...
  • Calvin Hsia's WebLog

    Various ways to display multiple photographs: Using Rects and thumbs

    • 0 Comments
    My prior post showed how to use an array of PictureBox controls to display multiple photographs on a form. Now we’ll do something similar, but instead of using the PictureBox control, which is a little bit heavyweight, we can just draw directly onto the...
Page 7 of 18 (435 items) «56789»