 |
| Passing data records between VFP applications via the Clipboard |
User rating: 0/10 (0 votes) | |
|
|
 |
 |
| Before you begin: |
 |
The Custom class TClipboard communicates with Windows Clipboard through several Win32 functions. Both applications -- sender and recipient -- should create an instance of this object.
See also:
Using shared memory to exchange data between two FoxPro applications |
 |
 |
| |
| |
Members area. Log in to view this example. |
|
| |
|
|
|
|
|
 |
User rating: 0/10 (0 votes) | |
| 5876 bytes Created: 2002-11-24 17:07:01 Modified: 2011-12-10 09:20:22 Visits in 7 days: 108 |
|
 |
 |
| Listed functions: |
 |
|
 |
 |
| My comment: |
 |
This is another way of passing information between VFP applications. Normally such data exchange is based on a table or tables, which can be accessed by participating applications. Table names must be available to the applications either through global objects, or they are hard-coded.
On initialization the TClipboard object registers two Clipboard formats: VFPTablePlan and VFPTableData.
The sender application uses the CopyToClip method to copy records from the active alias to the Windows Clipboard. The structure of the alias is copied in the VFPTablePlan format, which is a regular SQL CREATE expression. The records are copied in the VFPTableData format, which is a tab delimited buffer.
The recipient can use either AppendFromClip or NewFromClip methods. The AppendFromClip appends records from the Clipboard to active alias (if any). The NewFromClip creates a new cursor with the structure and records retrieved from the Clipboard.
Here is another idea of a similar class, which can convert records to the HTML code and place this data on the Windows Clipboard in the HTML Clipboard Format (CF_HTML). Immediately after that this data is available to all applications, which understand CF_HTML format.
MSDN article: Using the Clipboard.
|
 |
 |
| Word Index links for this example: |
 |
|
|
 |
 |
| Translate this page: |
 |
|