Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Visual FoxPro   (RSS)

Make your Task Switcher Window bigger

One of the best features of Windows is the ability to Cut and Paste data within an application or from one application to another. You can alt-tab or click on the task bar to switch between actively running applications, like Word and Visual Studio. When

Area fill algorithm: crayons and coloring book

Kids know how to use crayons and a coloring book. How do you write such a program? In my last post ( Which pixels do you turn on when you draw a line? ) I showed how to draw a line. Now suppose you have some lines or shapes already drawn. How would you
Posted by Calvin_Hsia | 4 Comments
Filed under: , ,

Comment/Uncomment code to switch versions quickly without using macros

In a typical day, I write or debug programs in several languages: typically Foxpro, C#, VB, C++ and 32 bit assembly, with an occasional MSIL, IDL and 64 bit ASM thrown in. Sometimes, I like to switch between one version of code and another. This is useful

Cartoon animation program

A cartoon can be thought of as a series of drawings. To simulate movement, the drawings can be slightly different from each other. Remember drawing simple cartoons using a pad of paper? Simply flipping through the pages made the drawings come to life.
Posted by Calvin_Hsia | 15 Comments

Overload Operator new to detect memory leaks

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
Posted by Calvin_Hsia | 5 Comments
Filed under: , ,

Make your code more maintainable: The evils of the Return statement

What does it mean to make code more maintainable? Certainly obfuscated code is hard to understand, by definition. A big part of maintainability is making it easier for others to read and understand what the code is doing. Your code may have been working

Use a dictionary to help create a mnemonic

I was using a program that was yet another TLA and I wanted to create a mnemonic to help me remember what it was. One of the letters was “k”, so I wanted to find a word that starts with “k” Simple: load a dictionary, search for words starting with “k”

How fast is interop code?

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 is often

How to interrupt your code

I received a question: Simply, is there a way of interrupting a vfp sql query once it has started short of closing down the process ? I am running some complex queries on very large datasets which can sometimes take many minutes to complete. Typically,
Posted by Calvin_Hsia | 6 Comments

Examine .Net Memory Leaks

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

Persist user form size and location settings per session

My prior post ( Create your own Test Host using XAML to run your unit tests ) shows how to create a form and present it to the user. The user can resize and reposition the form, even on a 2 nd monitor. When the user exits the form, we can persist or remember

Create your own Test Host using XAML to run your unit tests

A few days ago, somebody came into my office and plopped down a box. It seemed very light. He said that it was a new PC. I thought hmmm…. The box seems empty…Why am I getting a new PC?. Apparently an inventory was made and my current hardware was at the

Compress and timestamp your pictures to gain disk space

I was running out of space again on my notebook. As years go by, digital cameras can take pictures with more megapixels, but that means they take up more space. Thus my pictures from 10 years ago are much smaller than this year’s. Since I have multiple

Find the Executing function's name

Often I want to write the SAME code that will display the name of the currently executing method or function. That way I can just copy/paste the same code into multiple methods. For example, in sub Form1_Load I could put this line: System.Diagnostics.Debug.WriteLine(
Posted by Calvin_Hsia | 5 Comments

Use Visual Studio Test framework to create tests for your code

While writing software over a period of weeks or months, various components of the software get completed at various times. You’ve tested and you’re satisfied they work, and you move on to develop another feature. Or you might check in the source code
More Posts Next page »
 
Page view tracker