Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving RTF text to Word document
Message
From
09/02/2002 09:47:11
 
 
To
08/02/2002 17:55:29
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00584887
Message ID:
00617887
Views:
28
>>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,
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform