Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Visual FoxPro » Debugging   (RSS)

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

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 | 3 Comments

Find which DLLs in your system are rebased

You can use CreateToolhelp32Snapshot and its family of functions to enumerate the running processes on your machine, including the modules loaded by each process My prior post ( DLL Image base addresses are the same in XP, different on Vista ) described

How to log application API calls using import module addresses

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: C:\Program

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

Edit and Continue in VFP can save you time

Sometimes it takes many steps to reproduce a problem. Perhaps you have to start an application, log in, navigate some forms, menus, etc. until you finally reach a breakpoint in your code. Then you see the problem, want to modify the code and retest. That
Posted by Calvin_Hsia | 4 Comments
Filed under: ,

Find all statically linked libraries required before your process can start

There’s some code in this post What external code does your EXE depend on? that determines all the statically linked libraries and function calls of a particular EXE. VFP9.EXE links to about 18 modules. However, there are about 83 modules loaded when

What external code does your EXE depend on?

In the old days, when you wrote a program, you had full control over the CPU. The Instruction Pointer would always point to code that you wrote, and never anywhere else. That means if you wanted to do any kind of input/output, you had to write it yourself.

Inspect your memory image and see fragmentation

The VirtualQueryEx function can help to inspect the memory of a particular process. It returns information about the various memory pages allocated to a process. If a block is marked as MEM_IMAGE, it’s a loaded module, like an EXE or DLL, so you can use

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

Why did I get an error while publishing Photos?

I was publishing some photos/movies of my 27 month old son taking ski lessons (see Sharing Digital Pictures of your friend's ) and I received an unexpected error. I narrowed down the code to this fragment: CPATH= "c:\inetpub\wwwroot\" CREATE TABLE (CPATH+"temp")
Posted by Calvin_Hsia | 1 Comments
Filed under: , ,

SQL Select data from a text file

It’s often very useful to be able to execute a SQL SELECT statement on a text file. I was debugging a multiprocess multithread Foxpro COM DLL problem in a COM+ application . To help diagnose the problem, I wanted to figure out the sequence of events that
Posted by Calvin_Hsia | 0 Comments
Filed under: ,

Application logging and Error methods

I have some Fox classes that run in several modes. The normal fox interactive design environment In a runtime Multithreaded DLL from the fox interactive environment In a runtime Multithreaded DLL from within a client application (like windows explorer)
Posted by Calvin_Hsia | 3 Comments
Filed under: ,

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

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

Programmatically add a watch expression to the debug watch window

A user may want to add a particular variable or expression to the Visual Foxpro debug watch window Here’s some code to do it. The debugger can read/write a particular debug config file. The default is stored in the fox resource file. Or you can choose
Posted by Calvin_Hsia | 1 Comments
Filed under: ,
More Posts Next page »
 
Page view tracker