473,503 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Managed String to in/out char *

Hello,

I have a unmanged C++ dll which has a function defined like:

Modify(char* str)

The char* is an in/out with a max length of 1024

I'd like to have a C++.Net Wrapper function which can be called by
CSharp like that:

Modify(ref str);

How do I have to define the C++.Net function and how do I have to call
my
unmanaged C++ function.

Regards,

Holger

Oct 14 '06 #1
1 1322
http://msdn2.microsoft.com/en-us/library/5787xk45.aspx

--
Regards
Sheng Jiang

Microsoft Most Valuable Professional in Visual C++
http://www.jiangsheng.net
http://blog.joycode.com/jiangsheng/
<hk*****@gmail.com????
news:11**********************@i42g2000cwa.googlegr oups.com...
Hello,

I have a unmanged C++ dll which has a function defined like:

Modify(char* str)

The char* is an in/out with a max length of 1024

I'd like to have a C++.Net Wrapper function which can be called by
CSharp like that:

Modify(ref str);

How do I have to define the C++.Net function and how do I have to call
my
unmanaged C++ function.

Regards,

Holger

Oct 15 '06 #2

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

Similar topics

1
3498
by: lolomgwtf | last post by:
I have a managed C++ method that wraps unmanaged code and creates a managed object holding data retrieved form an unmanged one. I want create an instance of this managed class in C#, pass it to...
27
51645
by: Trep | last post by:
Hi there! I've been having a lot of difficult trying to figure out a way to convert a terminated char array to a system::string for use in Visual C++ .NET 2003. This is necessary because I...
1
2019
by: DBT | last post by:
I'm sure this is simple if you know how. I've got .h files and .lib files for a C language API that I need to access from a C# assembly. For the sake of this question, assume there are two .h...
4
11328
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error...
2
1632
by: Peter Nolan | last post by:
Hi All, I have some older C++ code that reads databases via ODBC and converts data to C++ null delimited strings. I amd writing a tool to read these types of old C strings and update an XML file....
7
8214
by: Klaus Bonadt | last post by:
I have an existing VC6 application using the MFC. I am able to pass CString and other parameters from such a VC6 dll to an unmanaged MFC dll (compiled in Visual Studio .NET). Now I want to use...
2
2110
by: mccoyn | last post by:
I am trying to use a C style string in a managed class. When I try to call a function like strcmp I get an error. For example, this code __gc MyClass char str _nogc void foo() strcpy(str,...
3
3483
by: zhphust | last post by:
I want to convert a object of a managed class to a unmanaged structure that has the same member with that managed class. Can anybody tell me how i can do it? Thanks in advance. -- zhphust...
87
5023
by: Robert Seacord | last post by:
The SEI has published CMU/SEI-2006-TR-006 "Specifications for Managed Strings" and released a "proof-of-concept" implementation of the managed string library. The specification, source code for...
16
8757
by: pkoniusz | last post by:
Hello everybody, Been just thinking how actually one could convert the following unmanaged code to the managed C++: struct JustAnExample { char value1; int value2; // etc ....
0
7282
Oralloy
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,...
0
7342
jinu1996
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...
1
6998
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...
1
5018
isladogs
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...
0
4680
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...
0
3171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1516
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 ...
0
391
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.