Calvin Hsia's WebLog

thoughts from a professional developer

  • 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

    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

    Surface Pro 3 cursor disappears

    • 34 Comments
    I like my new Surface Pro 3. Things were working fine and all of a sudden, the cursor would disappear. I just have the Type Cover and a memory card installed: no other hardware. Narrowing down the issue: if I move my finger in circles on the trackpad...
  • 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...
  • 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

    Install Northwind for SQL Express and use Visual Studio and DLINQ to query it

    • 6 Comments
    SQLExpress is free and comes with Visual Studio, but the sample Northwind database isn’t included. You can download sample databases Northwind and Pubs from http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46a0-8da2-eebc53a68034&displaylang...
  • 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

    New Tablet PC hard disk and using RIS

    • 6 Comments
    My 3 year old Acer TravelMate 100 TabletPC hard disk (20G) was dying. It has served me well as a portable machine. I love the tablet features and the small size. It was one of the original prototype tablets that I started using about 6 months before TabletPCs...
  • Calvin Hsia's WebLog

    Run your application forms on the web

    • 8 Comments
    I received a customer question: I have looked all over the web and still searching, and found your blog. I have a very specific issue and I need to ask whether this is doable first of all and how to do it after. First of all, I need to make...
  • Calvin Hsia's WebLog

    Call GDI+ JPG manipulation from Excel, Word, Powerpoint, VB.NET

    • 1 Comments
    Here’s a way to manipulate photos from within some Microsoft products. In the prior post , I wrote some code to write and draw directly on a JPG image. It draws text, a timestamp, and an ellipse with a gradient brush onto a JPG and then saves it out...
  • Calvin Hsia's WebLog

    More Multithread capabilities: interthread synchronization, error checking

    • 24 Comments
    In a prior post: Create multiple threads from within your application , there is a sample Thread Class that can be used to create multiple threads that can execute VFP code. Today’s sample presents code that demonstrates how a thread can send messages...
  • Calvin Hsia's WebLog

    Customize your Windows Mobile SmartPhone home screen and Start Menu

    • 8 Comments
    My Smartphone ( Cingular 2125 ) died the other day: actually the phone was fine: the SIM card needed replacing. In the old days, if your phone died you could get help 24 hours a day. Nowadays you have to wait til their service center is open. On the trusty...
  • Calvin Hsia's WebLog

    The VB version of the Blog Crawler

    • 19 Comments
    This is the VB.Net 2005 version of the Blog Crawler. It’s based on the Foxpro version , but.it uses SQL Server Everywhere so you can deploy it on your mobile device! It crawls a blog and stores all entries into a SQL Server Everywhere table. This includes...
  • Calvin Hsia's WebLog

    GetLastError is a number. What does it mean?

    • 5 Comments
    A customer asked I'm getting an error 12 back from a GetLastError call, and I've seen a number of sites that tell me I can figure out what that error is by sending it to SysErrorMessage. But nothing I've seen shows how to declare SysErrorMessage...
  • Calvin Hsia's WebLog

    Error Reading File infinite loop if drive disabled while file open and Data Session window open

    • 0 Comments
    If you have a file open on some drive (perhaps a USB or network drive) and the Data Session window open, try disconnecting the drive somehow. Perhaps yank the network cable, pull the USB drive even though Windows says not to, or even move out of wireless...
  • Calvin Hsia's WebLog

    Another customer problem: a product doesn't work with VFP

    • 3 Comments
    A customer reported that a product they have doesn’t work with Visual Foxpro . Time to put on the detective hat! In the command window, type o= CREATEOBJECT (“ABCProduct.Application”) After hitting the Enter key, the FoxPro process crashes. I tried from...
  • Calvin Hsia's WebLog

    Cold Solder Joint

    • 7 Comments
    When we had our first child, we had an audio monitor that consisted of 2 pieces: a microphone with a wireless transmitter and a speaker with a wireless receiver. Thus we could hear the baby from afar. Times have changed. Now the hospital uses disposable...
  • Calvin Hsia's WebLog

    SQL Select for most recent record

    • 4 Comments
    Suppose I have a table of test results with at least 4 columns: ID (unique integer) SuiteName (name of test) RunTime (DateTime) Failed There are several hundred tests, and I will run a batch file that runs all the tests several times...
  • Calvin Hsia's WebLog

    Is a process hijacking your machine?

    • 25 Comments
    Suppose there is a process on your machine that is hijacking your processor. Perhaps it’s in an infinite loop. Or perhaps you have no idea what a particular process is doing, and you’d like to find out. If you have a debugger installed, like Visual Studio...
  • Calvin Hsia's WebLog

    Generating VBScript to read a blog

    • 7 Comments
    Sometimes I need to test something using VBScript . A user sends a code snippet and asks why it behaves a certain way. Examining the behavior in VB can help. Below is a VFP code sample which demonstrates VBScript code which uses several objects...
  • Calvin Hsia's WebLog

    Create your own typing tutor!

    • 22 Comments
    Here’s an idea to teach somebody the positions of the letters on the keyboard: letters fly in randomly from the right for 30 seconds. Hit the letter on the keyboard for points. Miss and lose points. As time goes on, the letters move faster and there are...
  • Calvin Hsia's WebLog

    Spy on your programs

    • 10 Comments
    A user emailed me a question: How can I get the handle often named as "HWnd" of any Visual Foxpro native visual object such as COMMANDBUTTON,SHAPE,EDITBOX,LISTBOX ,etc.? There is a tool called SPY++ that ships with Visual Studio (on my machine, Start...
  • Calvin Hsia's WebLog

    The VB version of the Flip Task Bar for Vista Desktop Window Manager

    • 4 Comments
    In this post: Create your own Flip Task Bar with live thumbnails using Vista Desktop Window Manager DWM , I showed Fox code on creating your own Flip Task bar Here is the VB.Net version that does the same thing… File->New->Project->Visual...
  • Calvin Hsia's WebLog

    Print a t-shirt

    • 6 Comments
    I went to http://www.stamps.com to order US Postage stamps with a photo that I choose to upload: no Elvis stamps for me. There are also sites (like www.pictureframes.com ) that will print/frame and deliver a customer photograph to any address: a great...
  • Calvin Hsia's WebLog

    Permutations

    • 2 Comments
    I saw this post which shows some VFP code to permute a string. For example, there are 6 permutations of “abc”: abc, acb, bac, bca, cab, cba There are n! permutations of a string of length n. I dug up some old code that did the same thing in fewer lines...
Page 3 of 18 (438 items) 12345»