Using Clipboard through API, why GlobalLock 
Author Message
 Using Clipboard through API, why GlobalLock

I'm writing something that would write a string to a clipboard for later
use, so can anybody tell me why one has to GlobalLock the memory allocated
by GlobalAlloc before you can lstrcpy a string to it?

Does anybody know where I can find more info on API programming in VB?

Thanks a lot,
Paulo



Tue, 14 Sep 1999 03:00:00 GMT  
 Using Clipboard through API, why GlobalLock


rgrad.math.uwaterloo.ca> writes

Quote:
>can anybody tell me why one has to GlobalLock the memory allocated
>by GlobalAlloc before you can lstrcpy a string to it?

Because "GlobalAlloc" returns a memory handle, not a pointer.
"GlobalLock" takes the handle, and returns a pointer.

Chris

----------------------------------------------------------------

Creators of fine astronomy software for Windows.
For full details, visit our web site at http://www.skymap.com



Tue, 14 Sep 1999 03:00:00 GMT  
 Using Clipboard through API, why GlobalLock


1997 04:16:32 GMT):

Quote:
>I'm writing something that would write a string to a clipboard for later
>use, so can anybody tell me why one has to GlobalLock the memory allocated
>by GlobalAlloc before you can lstrcpy a string to it?

No need to you the API with VB:

Clipboard.SetText = "Hello! I'm getting copied now!", 1

IWantMyStringBack$ = Clipboard.GetText(1)

BTW, STOP CROSSPOSTING!

Mathias Schiffer, Germany
----------------------------------------------
VB-FAQ: http://www.rat.de/metty/bin/vb-faq.zip



Tue, 14 Sep 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Using Clipboard through API, why GlobalLock

2. Copying to Clipboard using API calls

3. Copy to Clipboard using API Calls

4. Clipboard Manipulation using API Calls

5. Clipboard Manipulation using API Calls

6. Saving a CLIPBOARD image to a file using API's

7. Clipboard object questions... using the clipboard with vb4

8. why why why why

9. Why why why why?

10. GlobalLock error 87

11. PLEASE Help with GlobalLock!!!

12. help with with globalalloc, globallock

 

 
Powered by phpBB® Forum Software