Strange error message with Oracle

The Oracle ODBC driver threw an error message on a completely innocent looking line:
Read More…

Dealing with Outlook references

When you automate Outlook, you typically create a reference to Outlook.Application and then get the namespace using the GetNamespace() method. Everything you want to do is possible through the Namespace object. loNamespace.Application provides a nice reference back to Outlook. So why would one want to keep the additional reference around?
Read More…

Choosing a folder in Outlook

When looking around for samples about Outlook automation samples, it seems that most either create items only in the default folders or hardcode the path in the program code. However, in a real world application, the folder in which you create item often has to be configurable. Fortunately, there's actually a function build into MAPI that does this:
Read More…

Opening an e-mail window with GroupWise™

In most cases, you can open an e-mail editing window using
Read More…

Calling _Execute() from a different thread

You can only call the _Execute VFP API function from within the same thread that Visual FoxPro uses to load the library. Calling the function from a different thread crashes Visual FoxPro. If you need to execute code originating in a different thread, you can use SendMessage, though. Here's the code for the FLL. First of all, you need a variable to hold the window handle:
HWND hWndMain = NULL;
Next, you need a function that a VFP application calls to register the handle
Read More…

There is not enough memory to complete this operation

When calling an FLL function you get this error messages, when the FLL creates a new string but doesn't specify a string length:
Read More…

Sorting

You find sorting algorithm in most programming languages, but you have to look hard for an implementation of common sorting algorithms in Visual FoxPro. Of course, Calvin Hsia has some on his blog, but otherthan that it's getting difficult. The most obvious reason is that Visual FoxPro supports sortingnatively for indexes as well as arrays.
Read More…

Record is out of range (#5)

Something tried to access a record that does not exist in the selected table.
Read More…

Class Factory cannot supply requested class (0x80040111)

When the Init() method of a VFP COM object returns .F., Visual FoxPro raises this error to the creating application.
Read More…

FRX as a cursor

You cannot create an FRX file as a cursor using the CREATE CURSOR command, because FRX files containa UNIQUE field which isn't allowed as a field name:
Read More…