Customer question: what does the crash call stack mean

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 to contain the following information:   1.  either a function name or a…

1

Timestamp digital pictures

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).   With certain display modes of my picture display program…

7

Here’s an infinite loop that will hang your machine

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 table of 2 fields: a Character and a Memo field. It then inserts into the Memo field a string that looks like a hyperlink…

4

The preservation of numerical precision

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(“Decimals”) SET DECIMALS TO 15 num=12.45678901234567890 ?num ox=CREATEOBJECT(“t1.c1”) *ox.mydocmd(“set decimals to 15”) ?ox.myeval(“p2”,num)    && just evaluate the parameter and…

1

The return value of a method can be intercepted using BindEvent

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 USE_BINDEVENT Activate Screen Clear Local oForm oForm = NewObject(‘MyForm’)…

1

Is this a Vista bug?

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, there was a scenario under which the user code calling GETOBJECT(“IIS://LOCALHOST/W3SVC/1/ROOT”) would crash. At the time,…

4

Write your own hangman game

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 53869. There’s some pretty serious compression to get them both into…

7

Play movies with an ActiveX control

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 Media Player ActiveX control. There have…

1

Strange collection class behavior with objects

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 the second call to THIS.ADD() and try to explain why it works…

3

Playing with NTFS File Streams

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 (Fox and VB versions below).   A file…

3