Re: Accessing clipboard from REXX DLL



Hallo,

I am confused now about what works and what does not and if you use
OBJ_GETTABLE or OBJ_GIVEABLE.

1.) Mozilla etc. should use DosAllocSharedMem(...,NULL,..., PAG_WRITE |
PAG_COMMIT | OBJ_GIVEABLE) for its memory allocation with the given flags as
a minimum. This is according to PM Programming Guide. But this is only true
if it places a pointer into the clipboard (CFI_POINTER). Bitmaps for example
are handled differently and 3.) does not apply.
2.) Then, calling WinQueryClpbrdData should not cause any problem, but
obviously it does when it is called from a VIO process
3.) Therefore, the VIO process should call DosGiveSharedMem with its own
PID. You can also experiment with the OBJ_ANY flag on the DosGiveSharedMem
call. High memory has introduced some subtleties.

So, how does Mozilla etc. allocate the memory that it places into the
clipboard ? What Clipboard format does Mozilla use ? I think you should
precede the call WinQueryClipbrdData with a WinQueryClipbrdFmtInfo call.
Maybe the format you try to use is wrong. It might make a big difference,
see 1.)
Also, as Rich suggested, always use WinInitialize/WinTerminate as a bracket
around any PM functions.

As far as Theseus goes: you need to look around in the linear address view
(or something like that) as clipboard memory is shared and only appears
there. Theseus help is good enough to get you rolling.


Send us a piece of your (corrected) code of how you access the clipboard for
reading from it.

Lars

"Alex Taylor" <mail.me@xxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:mdq090pMZSKk-pn2-x8o8zhdVNP8x@xxxxxxxxxxxx
On Wed, 26 Dec 2007 10:32:09 UTC, "Lars Erdmann" <lars.erdmann@xxxxxxxx>
wrote:

The thing is, WinGetClipboardData (I assume) should call DosGiveSharedMem
when it is called from another process (the samples never require or
indicate that the receiving process needs to call DosGiveSharedMem
explicitely) but there seems to be a bug that prevents it from doing so
if
it is called from a VIO process.

1.) Mozilla etc. SHOULD use that flag (OBJ_GIVEABLE and NOT OBJ_GETTABLE)
because in the PM programming guide it is documented to be used when you
intend to put something into the clipboard. If it still doesn't work you
will
a.) need to have a look into the Mozilla sources

My logic was originally lifted from Mozilla, so it should be the
same (unless, of course, Mozilla has changed it since then).


b.) check with Theseus HOW exactly the memory you receive from the
clipboard is allocated

Well, I've installed Theseus now, but I have to confess I don't
actually know how to do this.

--
Alex Taylor
http://www.cs-club.org/~alex

Please take off hat when replying.


.



Relevant Pages