Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / September 2005

Tip: Looking for answers? Try searching our database.

How to convert char* to Byte[] in Managed C++

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aca02djr@sheffield.ac.uk - 01 Sep 2005 01:02 GMT
I have a managed C++ function which returns a managed byte array - and
i need the contents of said array to be the same as the contents of a
char* array (which represents image data). How can I convert this
unmanaged char* to a managed Byte[]?
Uday Takbhate [MSFT] - 19 Sep 2005 06:45 GMT
In C# you have something like..

byte[] blob = System.Text.Encoding.UTF8.GetBytes(char [],....);

You may find eqvailent for managed C++.

Thanks,
Uday Takbhate [MSFT]
Microsoft Developer Support
--------------------
>From: aca02djr@sheffield.ac.uk
>Newsgroups: microsoft.public.dotnet.framework.interop
[quoted text clipped - 7 lines]
>Content-Type: text/plain; charset="iso-8859-1"
>X-Trace: posting.google.com 1125532959 2070 127.0.0.1 (1 Sep 2005 00:02:39
GMT)
>X-Complaints-To: groups-abuse@google.com
>NNTP-Posting-Date: Thu, 1 Sep 2005 00:02:39 +0000 (UTC)
>User-Agent: G2/0.2
>X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
NET CLR 1.0.3705),gzip(gfe),gzip(gfe)
>Complaints-To: groups-abuse@google.com
>Injection-Info: o13g2000cwo.googlegroups.com; posting-host=81.132.130.11;
>   posting-account=hP-1RgwAAACeAH_-l27yderw8Qyc6MZd
>Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!news.glorb.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-fo
r-mail
>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.framework.interop:9394
>X-Tomcat-NG: microsoft.public.dotnet.framework.interop
[quoted text clipped - 3 lines]
>char* array (which represents image data). How can I convert this
>unmanaged char* to a managed Byte[]?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.