Click here to Skip to main content
15,887,875 members
Home / Discussions / C#
   

C#

 
GeneralRe: Char* in C++ 6 to C# .Net Pin
KeithF22-Mar-11 4:40
KeithF22-Mar-11 4:40 
GeneralRe: Char* in C++ 6 to C# .Net Pin
Richard MacCutchan22-Mar-11 5:10
mveRichard MacCutchan22-Mar-11 5:10 
AnswerRe: Char* in C++ 6 to C# .Net Pin
KeithF22-Mar-11 4:37
KeithF22-Mar-11 4:37 
GeneralRe: Char* in C++ 6 to C# .Net Pin
Richard MacCutchan22-Mar-11 5:13
mveRichard MacCutchan22-Mar-11 5:13 
GeneralRe: Char* in C++ 6 to C# .Net Pin
KeithF22-Mar-11 5:30
KeithF22-Mar-11 5:30 
GeneralRe: Char* in C++ 6 to C# .Net Pin
Richard MacCutchan22-Mar-11 8:16
mveRichard MacCutchan22-Mar-11 8:16 
GeneralRe: Char* in C++ 6 to C# .Net Pin
Ian Shlasko22-Mar-11 5:32
Ian Shlasko22-Mar-11 5:32 
AnswerRe: Char* in C++ 6 to C# .Net [modified] Pin
Luc Pattyn22-Mar-11 6:16
sitebuilderLuc Pattyn22-Mar-11 6:16 
Some of the replies you got contain too much attributes IMO. Passing strings between C# and native code is pretty easy, you don't even need all those Marshal thingies, a simple CharSet = CharSet.Unicode
[ADDED] or CharSet = CharSet.ASCII [ADDED]
in your DllImport should do it. You must get rid of the ref keywords obviously, as a string is always passed as a pointer anyway. And if one or more of those strings are meant to be output parameters, the easiest way is by using a StringBuilder. I think I covered all these essentials in this article[^].

Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

modified on Tuesday, March 22, 2011 12:32 PM

GeneralRe: Char* in C++ 6 to C# .Net Pin
KeithF22-Mar-11 6:24
KeithF22-Mar-11 6:24 
AnswerRe: Char* in C++ 6 to C# .Net Pin
Luc Pattyn22-Mar-11 6:31
sitebuilderLuc Pattyn22-Mar-11 6:31 
GeneralRe: Char* in C++ 6 to C# .Net Pin
KeithF22-Mar-11 6:40
KeithF22-Mar-11 6:40 
Questionclickonce Deployment [modified] Pin
arkiboys22-Mar-11 3:40
arkiboys22-Mar-11 3:40 
AnswerRe: clickonce Deployment Pin
Dave Kreskowiak22-Mar-11 4:47
mveDave Kreskowiak22-Mar-11 4:47 
GeneralRe: clickonce Deployment Pin
arkiboys22-Mar-11 4:51
arkiboys22-Mar-11 4:51 
GeneralRe: clickonce Deployment Pin
Rajesh R Subramanian23-Mar-11 4:47
professionalRajesh R Subramanian23-Mar-11 4:47 
GeneralRe: clickonce Deployment Pin
Dave Kreskowiak23-Mar-11 12:12
mveDave Kreskowiak23-Mar-11 12:12 
GeneralRe: clickonce Deployment Pin
Rajesh R Subramanian23-Mar-11 18:38
professionalRajesh R Subramanian23-Mar-11 18:38 
Questionpass picture as parameter TO C# Pin
MrKBA22-Mar-11 2:46
MrKBA22-Mar-11 2:46 
AnswerRe: pass picture as parameter TO C# Pin
Pete O'Hanlon22-Mar-11 3:10
mvePete O'Hanlon22-Mar-11 3:10 
GeneralRe: pass picture as parameter TO C# Pin
MrKBA22-Mar-11 3:36
MrKBA22-Mar-11 3:36 
GeneralRe: pass picture as parameter TO C# Pin
BobJanova22-Mar-11 3:47
BobJanova22-Mar-11 3:47 
GeneralRe: pass picture as parameter TO C# Pin
_Erik_22-Mar-11 3:51
_Erik_22-Mar-11 3:51 
GeneralRe: pass picture as parameter TO C# Pin
MrKBA22-Mar-11 4:07
MrKBA22-Mar-11 4:07 
GeneralRe: pass picture as parameter TO C# Pin
_Erik_22-Mar-11 5:09
_Erik_22-Mar-11 5:09 
AnswerRe: pass picture as parameter TO C# Pin
Dan Mos22-Mar-11 3:13
Dan Mos22-Mar-11 3:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.