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

Managed C++/CLI

 
Questionsocket program help Pin
mhetfield19783-Apr-07 11:42
mhetfield19783-Apr-07 11:42 
AnswerRe: socket program help Pin
Christian Graus3-Apr-07 12:01
protectorChristian Graus3-Apr-07 12:01 
GeneralRe: socket program help Pin
mhetfield19783-Apr-07 12:03
mhetfield19783-Apr-07 12:03 
GeneralRe: socket program help Pin
Nish Nishant3-Apr-07 13:34
sitebuilderNish Nishant3-Apr-07 13:34 
QuestionConverting from std::string to System::String^ Pin
flippydeflippydebop2-Apr-07 2:44
flippydeflippydebop2-Apr-07 2:44 
AnswerRe: Converting from std::string to System::String^ Pin
led mike2-Apr-07 4:34
led mike2-Apr-07 4:34 
AnswerRe: Converting from std::string to System::String^ Pin
Mark Salsbery2-Apr-07 6:50
Mark Salsbery2-Apr-07 6:50 
GeneralRe: Converting from std::string to System::String^ Pin
flippydeflippydebop2-Apr-07 8:57
flippydeflippydebop2-Apr-07 8:57 
well hang on then guys...

Why does this:

System::String^ myStr = "hello"


Work fine even though i do not use the gcnew operator to allocate the string 'myStr' on the heap?

What i am saying is that i know in the .net world everything is allocated on the heap and that the above statement, even though it appears to reside on the stack is probably being allocated on the heap..

Now if the compiler lets me write code like above, then why wont it let me write code like this:

String^ managedStr = nativeStr.c_str();


The above line fails.. Instead in this instance i have to explicitly allocate the variable managedStr on the heap like so:

String^ s6 = gcnew String(nativeStr.c_str()); // works!
GeneralRe: Converting from std::string to System::String^ Pin
Mark Salsbery2-Apr-07 9:26
Mark Salsbery2-Apr-07 9:26 
GeneralRe: Converting from std::string to System::String^ Pin
led mike2-Apr-07 9:30
led mike2-Apr-07 9:30 
GeneralRe: Converting from std::string to System::String^ Pin
flippydeflippydebop2-Apr-07 19:55
flippydeflippydebop2-Apr-07 19:55 
Questiondisable print screen button in key board Pin
nivasinfotech1-Apr-07 18:48
nivasinfotech1-Apr-07 18:48 
AnswerRe: disable print screen button in key board Pin
George L. Jackson2-Apr-07 14:58
George L. Jackson2-Apr-07 14:58 
Question(char*& Content) ? Pin
Software_Specialist1-Apr-07 7:53
Software_Specialist1-Apr-07 7:53 
AnswerRe: (char*& Content) ? Pin
Richard Andrew x641-Apr-07 8:37
professionalRichard Andrew x641-Apr-07 8:37 
GeneralRe: (char*& Content) ? Pin
Software_Specialist1-Apr-07 9:56
Software_Specialist1-Apr-07 9:56 
GeneralRe: (char*& Content) ? Pin
Software_Specialist1-Apr-07 9:57
Software_Specialist1-Apr-07 9:57 
GeneralRe: (char*& Content) ? Pin
Richard Andrew x641-Apr-07 10:06
professionalRichard Andrew x641-Apr-07 10:06 
AnswerRe: (char*& Content) ? Pin
lafleon4-Apr-07 10:30
lafleon4-Apr-07 10:30 
QuestionShowing a NotifyIcon Context Menu Pin
Richard Andrew x6431-Mar-07 18:57
professionalRichard Andrew x6431-Mar-07 18:57 
AnswerRe: Showing a NotifyIcon Context Menu Pin
Mark Salsbery1-Apr-07 7:39
Mark Salsbery1-Apr-07 7:39 
GeneralRe: Showing a NotifyIcon Context Menu Pin
Richard Andrew x641-Apr-07 8:32
professionalRichard Andrew x641-Apr-07 8:32 
GeneralRe: Showing a NotifyIcon Context Menu Pin
Mark Salsbery1-Apr-07 9:09
Mark Salsbery1-Apr-07 9:09 
GeneralRe: Showing a NotifyIcon Context Menu Pin
Richard Andrew x641-Apr-07 9:13
professionalRichard Andrew x641-Apr-07 9:13 
Questionerror LNK2005 Pin
thesad31-Mar-07 8:43
thesad31-Mar-07 8:43 

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.