Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving RTF text to Word document
Message
 
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:
00618210
Views:
23
In order to avoid redefinion of lstrcpy you could use another function to copy string:
Declare Long lstrcpyn In kernel32 String @lpDest, Long lpSrc, Long iLen
Declare Long GlobalSize In kernel32 Long hMem

IF ( OpenClipboard(0) != 0 )
	cf = RegisterClipboardFormat("Rich Text Format")
	h = GetClipBoardData(cf)
	ptr = GlobalLock(h)
	lnDataLen = GlobalSize(h)
	str_RTF = SPACE(lnDataLen)
	lstrcpyn(@str_RTF , ptr, lnDataLen)
	CloseClipboard()
	GlobalUnlock(h)
	THIS.TEXTRTF = Left(str_RTF, lnDataLen-1)
ENDIF
>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)
>    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).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform