Re: Marshaling a byte array by ref
Morten Andersen <[email protected]> Wed, 12 Jul 2006 21:28:42 +0200
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Message-ID | <[email protected]> |
Hi Sean, Just a quick add'on to your comment about invoking a traditional DLL-exported entry with a "caller-allocated-out-array" (just to have the knowledge on the mailing list, if somebody later searches for it): Mcnamara, Sean D wrote: > > A "naked" C byte array from a traditional DLL can be passed in using the > documented method on instruction_docs.html. If you want the native code > to modify your byte array and then get the same reference (results of > native code's operations) back into Java, and there isn't a "getter" > method in your DLL to retrieve this pointer again, you might have a > problem. This is actually supported (but not well documented :-)). E.g. the following SourceForge-thread shows how to use GetWindowText http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/getwindowtext.asp), which uses an [out] buffer for returning the text: https://sourceforge.net/forum/forum.php?thread_id=1311741&forum_id=225268 (see post no.5, from 2005-07-05 13:07 for the "solution"). I am not really sure I explained it very well in the post, so please let me know if you want me to clarify something from the post (although it is pretty "far" away right now, I may be able to figure out what the instruction string means, if I put a little thought into it). And by the way, thanks for taking you time to answer so many questions on the list lately - some of us "old-timers" (*absolutely* including myself) have been a little inactive lately :-/ Best Regards Morten