Re: Return a string from C++ Native to C# 64-bit

Tech-Archive recommends: Fix windows errors by optimizing your registry



Franck wrote:
In your case, i guess you will need to pass a 64bit string

i C# a 64bit string is using string builder with 64bit int limits
like :
StringBuilder sb = new StringBuilder(Int64.MaxValue, Int64.MinValue);

A 64 bit string? What are you talking about?

The C++ code returns a byte array that contains a string that is encoded as Ansi (Encoding.Default). This is decoded into a unicode string by the marshalling code. A string in .NET looks the same regardless if it's on a 32 bit platform or a 64 bit platform.

--
Göran Andersson
_____
http://www.guffa.com
.



Relevant Pages

  • RE: IE headers w patch level - new info
    ... Internet Settings\User Agent\Post Platform ... String Value: Q312461 ... The patch information that Internet Explorer displays ... logfiles, under the UserAgent field. ...
    (Focus-Microsoft)
  • Re: some interesting perspectives on .NET from the other camp ...
    ... >> now rather use framework functionality directly. ... Do you really think a VB.NET writer is any more dependent on MS ... low platform or framework level functions altogether. ... Trimming a string just seems to me to be exactly ...
    (borland.public.delphi.non-technical)
  • Re: Wide character support
    ... > adequately translated for the new platform. ... I've printed a wide string to a narrow stream and ... Printing on GNU/Linux? ...
    (comp.lang.c)
  • Re: [OT, redirect] Re: gethostbyname(string here)
    ... Artie Gold wrote: ... > of standard C) please ask in a forum specific to your platform. ... While the example is using gethostbyname(), ... string to the function. ...
    (comp.lang.c)
  • Re: Itanium model numbers {re F$getsyi("HW_MODEL")}
    ... I know the amount of ... What the particular platform vendor might decide to do with the string is, well, another discussion -- that string arises from what amounts to the system vendor platform firmware, and it's analogous to how SRM stored and returned that value to OpenVMS Alpha as part of the dynamic system recognition stuff. ... which the firmware makes available and which VMS doesn't currently ...
    (comp.os.vms)