Welcome to MSDN Blogs Sign in | Join | Help

November 2005 - Posts

Recompress your digital pictures to save space

I have 23,000 digital pictures and movies taking many gigabytes of storage from the past decade or so. The more recent ones are larger, because higher resolution cameras were more readily available. I have a few copies of the entire collection on various
Posted by Calvin_Hsia | 6 Comments
Filed under: ,

DECLARE DLL allows OBJECT type

Before VFP7, it was very difficult to get an object back from a DECLARE DLL call. I added the “OBJECT” type for VFP7 which allows you to call a DLL which returns a COM object reference. Luckily, most COM objects are created from other COM objects, and
Posted by Calvin_Hsia | 1 Comments

Are water and salt the only inorganics we consume?

Of all the naturally occurring foods/drinks that humans normally ingest, is it true that all but two of them contain carbon? In any case, these 2 are very common. Maybe there’s a candy bar I don’t know about that doesn’t have carbon<g>. (Of course
Posted by Calvin_Hsia | 2 Comments
Filed under:

Use Regular Expressions to get hyperlinks in blogs

At Southwest Fox conference I presented a sample calling a VB.NET server to do regular expression matching . Here’s the sample I used. It gets some HTML from my blog and parses all the hyperlinks (looks for the HREF tags) and puts them into a VFP table:
Posted by Calvin_Hsia | 4 Comments
Filed under: , ,

Eliminating Fire Alarm sound at Chess Tournament Awards Ceremony

My daughter earned a 4 th place trophy out of 100 competitors in her division at a chess tournament, far ahead of all other unrated players. As a proud parent, I wanted to get a photo and video of the trophy presentation to hear how the award was presented.
Posted by Calvin_Hsia | 1 Comments
Filed under:

Excel's new gradient Data Bar feature is cool: you can do it too!

I’ve seen demos of Excel 12 and it’s conditional formatting Data Bar and thought it was cool. In each cell, it draws a colored gradient bar with a width proportional to the cell’s value, making it easy to spot the largest/smallest values. So I wrote a
Posted by Calvin_Hsia | 9 Comments
Filed under:

Fox helps drag racer win Microsoft Start Something Amazing Award

It was very impressive to see a computer using FoxPro helping a 15 year old drag racer win competitions. When I started reading about it, I thought it must be some sort of simulation: don’t you have to be older to drive? Then I saw the video, which clearly
Posted by Calvin_Hsia | 7 Comments
Filed under:

What happens if external code throws an exception?

In VFP, there are many features to call external code, such as ActiveX controls, COM servers, DECLARE DLL or SET LIBRARY TO . In older versions, you could even LOAD and CALL machine code. If such external calls caused a crash for some reason, what should
Posted by Calvin_Hsia | 5 Comments

Intentionally crash your program

When developing the Watson error reporting features (see Dr. Watson: Please send in your error report , and What is a C0000005 crash? , What was Dr. Watson's original name? )) it was useful to cause a crash intentionally In VFP we have a simple way to
Posted by Calvin_Hsia | 7 Comments

Is this a bug in the View Parent Code button?

We received a bug report Steps to Reproduce : 1) Create MyButtonClass1 class of MyButtonLibrary1. Add code to click method. 2) Create MyFormClass1 class of MyFormLibrary1. 3) Add commandbutton of class created in step1. Add code to commandbutton's click
Posted by Calvin_Hsia | 4 Comments
Filed under:

Collecting pictures for yearbook, Ektaflex

Not even three months of school have passed, and I’ve already received a request for school photos for the yearbook. Simple: bring up my VFP Picture Query program , type in “School”, date range since September 2005, and presto: a SQL Select query of my
Posted by Calvin_Hsia | 0 Comments
Filed under: ,

How old is your computer?

You can determine the last time your Administrator password was changed, which could have been the first time you started your computer (if you haven’t formatted your hard disk or changed the admin password) This code calls NetUserGetInfo to get user
Posted by Calvin_Hsia | 1 Comments

I cant understand why men cant live without wars

I read A 'Rand'om Word Trick For You about inserting “Random” words into Word for sample data. It actually puts in a fixed sentence (“The quick brown fox jumps over the lazy dog”) multiple times, which isn’t random at all. That reminded me of the Shakespearean
Posted by Calvin_Hsia | 3 Comments
Filed under:

Windows Security and how it affects running generated code

Here I described how VFP generates executable code and runs it for early and late binding COM clients and implementing COM interfaces. However, there is an important issue with generating and running executable code in the same process. A computer has

Load, Call, Character Generators, and &quot;Letter Quality&quot; printers

I remember early versions of FoxPro had the LOAD and CALL commands (try typing them in the command window!) that allowed you to put binary code directly into memory and run it! Back about 20 years ago, I wrote code in Foxbase that I hand assembled into
Posted by Calvin_Hsia | 3 Comments
Filed under: ,

The vTable name is __vfptr in the debugger

When I’m at a breakpoint debugging some C++ code, sometimes I drill down into members of variables to inspect values. The way C++ implements inheritance, there is a virtual function pointer table, often called a vtable. The Visual Studio debugger allows
Posted by Calvin_Hsia | 2 Comments
Filed under:

What to do with the Bindevent return value?

The BINDEVENT( ) Function allows you to attach code to run when other code is executed. It’s sort of like an event hook. The first example below has a method called “Foobar” which is called to return a value. After BindEvent is called, the method is called
Posted by Calvin_Hsia | 3 Comments
Filed under:

Quiz: Infinite Continued fractions

At the SouthWest Fox speaker dinner we were talking about continued (or infinite) fractions. I posed this question: What does this expression evaluate to? 1 + 1 _________ 1 + 1 ________ 1 + 1 _______ 1 + 1 ______ 1 + 1 … Clue: It’s adding some positive
Posted by Calvin_Hsia | 5 Comments
Filed under:

How does Task Manager determine if an Application is Not Responding?

If you start Task Manager (Ctrl-Shift-Esc) and display the Applications tab, you will see a list of running applications. Once in a while an application shows as “Not Responding”. How does Task Manager figure that out? A simple way to determine the answer
Posted by Calvin_Hsia | 5 Comments
Filed under:
 
Page view tracker