RE: passing string array to C++

Tech-Archive recommends: Speed Up your PC by fixing your registry



You wrote "Does this apply to all marshalling of passing arrays of
pointers? "

Arrays of references to objects are problematic for NETCF 1.0 since we don't
have the MarshalAs attribute to tell the CLR how to marshal the data that
the
data is referencing.

I suspect that the most straightforward implementation is the one I used -
let C
(not C++) manage the array and expose only array elements to Managed code
via C-language wrapper functions. If you use C++ you will need to deal with
keeping
a copy of the "this" pointer around in your C# code during the life of your
C++ class
and handle (or alias) mangled names. Writing a set of C-language collection
management functions should be fairly simple.

Gary

.



Relevant Pages

  • C2440 error
    ... conversions to references or pointers to arrays ... Prev by Date: ...
    (microsoft.public.vc.language)
  • Re: Im not REALLY a newbie, but.......
    ... If you choose to use only pointers and not references, ... begin with T being 'int', it is easy enough to see that the function must ... >distant past that swapped dynamic objects around (sorry, pointers to them!). ... >around with n-dimensional arrays, or arrays of strings (or should I say ...
    (alt.comp.lang.learn.c-cpp)
  • RE: Marshal.PtrToStructure for CMSG_SIGNER_INFO
    ... The problem is probably caused when marshalling the var-length array ... Marshal class in System.Runtime.InteropServices to manipulate the arrays. ... Microsoft Community Support ... before sending mail. ...
    (microsoft.public.dotnet.framework.interop)
  • Re: COM and Threads - Odd behavior
    ... Are PointIn and VectorIn supposed to point to arrays of doubles? ... be aware that only the first element of this array will be marshalled to ... through marshalling unscathed, this would explain why nothing is ...
    (microsoft.public.win32.programmer.ole)
  • Re: Returning an array from a function.
    ... unfortunately I am required to use arrays. ... Also I said that I cannot use pointers, turns out its wrong, I am able to ... use both references and/or pointers to accomplish this. ...
    (alt.comp.lang.learn.c-cpp)