Click here to Skip to main content
16,006,475 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Error while calling VC# function in VC++ [modified] Pin
George L. Jackson1-Oct-08 7:14
George L. Jackson1-Oct-08 7:14 
GeneralRe: Error while calling VC# function in VC++ Pin
Andy Rama3-Oct-08 19:28
Andy Rama3-Oct-08 19:28 
QuestionCOM object in .net whose threading model is STA, not both Pin
Shao Voon Wong28-Sep-08 23:39
mvaShao Voon Wong28-Sep-08 23:39 
QuestionWhy does Debug::Print prints in the release build version? [modified] Pin
Shao Voon Wong28-Sep-08 15:29
mvaShao Voon Wong28-Sep-08 15:29 
AnswerRe: Why does Debug::Print prints in the release build version? Pin
George L. Jackson29-Sep-08 5:50
George L. Jackson29-Sep-08 5:50 
QuestionHow to avoid loading an already loaded shared library Pin
Yashusid25-Sep-08 18:53
Yashusid25-Sep-08 18:53 
AnswerRe: How to avoid loading an already loaded shared library Pin
led mike26-Sep-08 4:37
led mike26-Sep-08 4:37 
QuestionMarshal::Copy fails when trying to copy from a char* to a System::Char[] Pin
Cyrilix25-Sep-08 10:50
Cyrilix25-Sep-08 10:50 
I have some code that fails when I do this:
Char mgData[] = new Char[numBytes];
Marshal::Copy(data, mgData, 0, numBytes);

...but does not fail when I do this:
Byte mgData[] = new Byte[numBytes];
Marshal::Copy(data, mgData, 0, numBytes);


data is of type char*, and contains binary data in the form of individual bytes (not represented as text at all). numBytes is the length of char*, when it was created with...
char* data = new char[numBytes]


The specific error that I'm getting is in Marshal::Copy, and the debugger points me to memcpy.asm. This leads me to believe that it's something unconventional, or that I'm simply not handling my unmanaged to managed conversions properly. There's a bit of background though... the reason why I'm trying to convert from unmanaged char* to managed Byte[] is because a BinaryWriter object won't properly write binary data when it's in the form of char*. If I were to call...
BinaryWriter.Write(char*), it would simply write until it thinks that it's at the end of a text string (likely a null-terminated character, or something along those lines). Furthermore, I'm not sure if using the Byte instead of the Char is incorrect, since Byte is an unsigned type, and Char (I think) is signed, which matches char* (also signed).

Any suggestions?
GeneralRe: Marshal::Copy fails when trying to copy from a char* to a System::Char[] Pin
George L. Jackson25-Sep-08 11:54
George L. Jackson25-Sep-08 11:54 
GeneralRe: Marshal::Copy fails when trying to copy from a char* to a System::Char[] Pin
Cyrilix25-Sep-08 12:27
Cyrilix25-Sep-08 12:27 
GeneralRe: Marshal::Copy fails when trying to copy from a char* to a System::Char[] Pin
Mark Salsbery25-Sep-08 13:00
Mark Salsbery25-Sep-08 13:00 
QuestionGames and C++/CLI Pin
Cyon11125-Sep-08 0:50
Cyon11125-Sep-08 0:50 
GeneralRe: Games and C++/CLI Pin
George L. Jackson25-Sep-08 4:07
George L. Jackson25-Sep-08 4:07 
Questionarray initilization Pin
staticv24-Sep-08 23:27
staticv24-Sep-08 23:27 
AnswerRe: array initilization Pin
George L. Jackson25-Sep-08 4:00
George L. Jackson25-Sep-08 4:00 
QuestionAttach DLL to Program Pin
DemonPT24-Sep-08 14:03
DemonPT24-Sep-08 14:03 
QuestionUnmanaged string to managed string Pin
N a v a n e e t h23-Sep-08 17:08
N a v a n e e t h23-Sep-08 17:08 
AnswerRe: Unmanaged string to managed string Pin
George L. Jackson23-Sep-08 17:33
George L. Jackson23-Sep-08 17:33 
Question.net runtime eror Pin
balu1234522-Sep-08 9:18
balu1234522-Sep-08 9:18 
AnswerCross Post Pin
led mike23-Sep-08 4:45
led mike23-Sep-08 4:45 
QuestionCalling Windows.Form from MFC with /cli [modified] Pin
ToSchi9819-Sep-08 1:43
ToSchi9819-Sep-08 1:43 
AnswerRe: Calling Windows.Form from MFC with /cli Pin
Mark Salsbery19-Sep-08 6:58
Mark Salsbery19-Sep-08 6:58 
GeneralRe: Calling Windows.Form from MFC with /cli Pin
ToSchi9819-Sep-08 8:58
ToSchi9819-Sep-08 8:58 
GeneralRe: Calling Windows.Form from MFC with /cli Pin
Mark Salsbery19-Sep-08 10:44
Mark Salsbery19-Sep-08 10:44 
GeneralRe: Calling Windows.Form from MFC with /cli Pin
ToSchi9822-Sep-08 3:18
ToSchi9822-Sep-08 3:18 

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.