CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2012
    Location
    Earth!
    Posts
    9

    unsigned char array pointer to C# equivalent - marshalling

    I have some C code which will be called from C# using P/Invoke. I have a C struct member for which I am trying to define an C# equivalent.

    Array16 *data;

    typedef unsigned char Array16[16];

    How do I define the C# equivalent of this C data member?

  2. #2
    Join Date
    Jul 2012
    Posts
    90

    Re: unsigned char array pointer to C# equivalent - marshalling

    Not sure about this one, try System.UIntPtr

  3. #3
    Join Date
    Mar 2001
    Posts
    2,529

    Re: unsigned char array pointer to C# equivalent - marshalling

    CSharp uses the unsafe keyword as you know to allow you to use pointers. Unsafe code is very C-Like. This is done to allow inter-op with Win32 and other external C/C++ libraries and memory mapped devices. Other than that, you can make pointers to the built in types, that are also classes.

    http://msdn.microsoft.com/en-us/libr...=vs.71%29.aspx

    HTH,
    ahoodin
    To keep the plot moving, that's why.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured