473,554 Members | 2,301 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to convert unmanaged string with char array type to managed string with char array type?


How to convert an unmanaged string with char array type to a managed string
with char array type?

Nov 17 '05 #1
1 4361
have a look at the System::Runtime ::InteropServic es::Marshal class

the func PtrToStringAuto () might do what you want

you have to issue a

#using <mscorlib.dll >

in the managed C++ file

Regards, Eckart
joye wrote:

How to convert an unmanaged string with char array type to a managed string
with char array type?


Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Weston Fryatt | last post by:
(Sorry for spamming multiple groups, But I need a solution to this problem) I think this should be a simple question on Memory Allocation in a managed DLL and passing a memory pointer over to an unmanaged DLL. I have a "Unmanaged" Client DLL that I'm creating a Managed "wrapper" to be used in VB.Net and/or C#.. In the my Client DLL...
by: Mark Jerde | last post by:
I'm trying to learn the very basics of using an unmanaged C++ DLL from C#. This morning I thought I was getting somewhere, successfully getting back the correct answers to a C++ " int SumArray(int ray, int count)" Now I'm having problems with C++ "return(false)" being True in C#. Here is the C# code. ========================= using...
by: Mark Ingram | last post by:
Hi, how can i return an array of strings from an unmanaged c++ dll into a c# application? cheers Mark
by: Johannes Unfried | last post by:
Problem Best practice needed to marshal STL data from managed code to unmanaged code & vice vers Details managed code is written in managed C++ & accesses the unmanaged code (i.e. lives in a mixed mode DLL unmanaged code is written in unmanaged C++ & resides in an unmanaged DL Product used is VS.NET 200 Please tell me what is the best...
by: Tommy Svensson \(InfoGrafix\) | last post by:
I've been instructed to work againt a huge unmanaged C++ API from a C# application. Now, the only way, as I've understood it, is to go the Managed Extensions for C++ way. This means I have to write a wrapper between unmanaged API and my managed app. Now on to the question: If there's an unmanaged API class called X with a defined method
by: Serge BRIC | last post by:
My application, written in .NET VB, tries to get a communication port handle from a TAPI object with this code: Dim vFileHandle As Byte() = appel.GetIDAsVariant("comm/datamodem") The vFileHandle is supposed to be a file handle (an IntPtr, I suppose). How can I convert this Byte() in this IntPtr ?
by: Aston Martin | last post by:
Hi All, ********************** My Situation ********************** I am working on project that involves passing a structure to unmanaged code from .Net world (well using C#). Perhaps an example will prove useful. structure MyStruct { // this is a complicated struct declaration in the sense
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hi Gurus, I need to transfer a jagged array of byte by reference to unmanaged function, The unmanaged code should changed the values of the array, and when the unmanaged function returns I need to show the array data to the end user. Can I do that? How?
by: hanthehead | last post by:
In order to use a C# dll from our unmanaged C++ project I have created a mixed managed\unmanaged c++ dll. This dll is passed an unmanaged class which contains vector<CDBRecord> m_vecRecords member variable. Within the managed C++ dll m_vecRecords is added to. This all works fine until our unmanaged C++ project attempts to m_vecRecords.clear()...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.