Re: Returning array of strings through callback from unmanaged to mana
- From: "<ctacke/>" <ctacke_AT_OpenNETCF_com>
- Date: Thu, 20 Apr 2006 23:46:26 -0400
The challenge is who's going to own the allocated memory? If it's the
method making the callback, then how does it ever get freed? If it's the
target of the callback, how does it know how much space to allocate?
Strictly speaking you could probably marshal them as an array of IntPtrs,
then do an IntPtr to String on each, but the potential for eitehr leaks or
invalid memory access is just too high. I'd consider rearchitecting.
-Chris
"Bruce Parker" <bparker@xxxxxxxxxxxxx> wrote in message
news:06270D80-50F0-413B-A977-B841F6D6FD63@xxxxxxxxxxxxxxxx
I have seen documentation that CF 2.0 supports arrays through interop. I
cannot find any solid examples of how to do this.
What I want to accomplish is to pass a callback function to unmanaged
code.
One of the parameters in the callback function is an array of strings.
The
unmanaged code will save the callback function and start a timer. When
the
timer fires, I need to be able to create an array of strings and pass that
back through the callback function to the managed code.
Does anyone have a code sample for this?
.
- Prev by Date: Re: WM5 Project & OpenNETCF
- Next by Date: Deploying Pocket PC Applications in VS2005
- Previous by thread: Re: WM5 Project & OpenNETCF
- Next by thread: Re: Returning array of strings through callback from unmanaged to
- Index(es):
Relevant Pages
|