Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C5 trying to read clipboard as HTML
Message
From
02/02/2010 09:41:02
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01447039
Message ID:
01447103
Views:
42
Thanks -- I've tried that, and it seems not be be failing now; hopefully, this is a permanent solution.

>You may want to check http://www.berezniker.com/content/pages/visual-foxpro/retrieve-html-clipboard
>
>>One of my users is getting a consistent C5 error when trying to read the clipboard as HTML (having been pasted there from Excel)
>>
>>The code I am using looks like this:
>>
Procedure ReadClipboardasHTML
>>
>>	Local lcString, lcCF, lnH, lnLen, lxPtr
>>
>>	Declare Long GlobalLock In Win32API Long Hmem
>>	Declare Long GlobalUnlock In Win32API Long Hmem
>>	Declare Long GlobalSize In Win32API Long Hmem
>>	Declare String lstrcpy In Win32API String @ lpDest, Long lpSrc
>>	Declare Long OpenClipboard In Win32API Long
>>	Declare Long CloseClipboard In Win32API
>>	Declare Long RegisterClipboardFormat In Win32API String
>>	Declare Long GetClipboardData In Win32API Long uFormat
>>
>>	lcString = ""
>>	*  lcCF = RegisterClipboardFormat ("Rich Text Format")
>>	lcCF = RegisterClipboardFormat ("HTML Format")
>>	If (OpenClipboard (0) != 0)
>>		lnH = GetClipboardData (lcCF)
>>		If lnH > 0
>>			lnLen = GlobalSize (lnH)
>>			lcString = Replicate (Chr (0), lnLen)
>>			lxPtr = GlobalLock (lnH)
>>			lstrcpy (@lcString, lxPtr)
>>			lcString = Left (lcString, lnLen-1)
>>			GlobalUnlock (lnH)
>>		Endif
>>		CloseClipboard ()
>>	Endif
>>
>>	Return Substr (lcString, At ("<", lcString))
>>
>>Endproc
>>
>>
>>Any ideas or suggestions?
>>
>>Thanks in advance,
Jim Nelson
Newbury Park, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform