>>Alexander -
>>
>
>
>i tried the inverse .... tried to get the clipboard data with the following:
>
> IF ( OpenClipboard(0) != 0 )
> cf = RegisterClipboardFormat("Rich Text Format")
> h = GetClipBoardData(cf)
> ptr = GlobalLock(h)
> str_RTF = REPLICATE(' ',4096)
> lstrcpy(str_RTF , ptr)
You need to redefine the parameters for lstrcopy to reflect the first parameter as a string passed by reference and the second parameter as a long; in the call, the first parameter must be prefixed with an @ symbol to tell VFP that the result is to be reflected in the VFP memory variable content on return.
> CloseClipboard()
> GlobalUnlock(h)
> GlobalFree(h)
> THIS.TEXTRTF = str_RTF
> ENDIF
>
>i get an error "datatype mismatch on the LSTRCPY statment.
>can you point me to an example of the correct way to do this ?
>or point out what i'm doing wrong here. (all variables are declared
>as in your original example).
Look at the UDFs in my ClsHeap class; I'd recommend using ClsHeap rather than the in-line code approach shown here for handling the memory issues. The class comments describe what's going on in detail; there are examples of the use of lstrcopy() and RtlMoveMemory in detail in the code that can be used for reference, and the management of the memory space is simplified. It uses a private heap rather than the global memory pool, which may be significant if you ever try running in a multithreaded environment
>
>thanks,