Click here to Skip to main content
15,911,531 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Understanding Templates Pin
Michael Dunn23-Oct-06 13:28
sitebuilderMichael Dunn23-Oct-06 13:28 
AnswerRe: Understanding Templates Pin
George L. Jackson23-Oct-06 13:31
George L. Jackson23-Oct-06 13:31 
GeneralRe: Understanding Templates Pin
Nathan Farrar24-Oct-06 1:54
Nathan Farrar24-Oct-06 1:54 
QuestionC++/CLI std::wstring behaving VERY strangely with /MD Pin
Raeldor_22-Oct-06 21:36
Raeldor_22-Oct-06 21:36 
AnswerRe: C++/CLI std::wstring behaving VERY strangely with /MD Pin
led mike23-Oct-06 5:02
led mike23-Oct-06 5:02 
GeneralRe: C++/CLI std::wstring behaving VERY strangely with /MD [modified] Pin
Raeldor_23-Oct-06 5:47
Raeldor_23-Oct-06 5:47 
GeneralRe: C++/CLI std::wstring behaving VERY strangely with /MD Pin
led mike23-Oct-06 6:19
led mike23-Oct-06 6:19 
GeneralRe: C++/CLI std::wstring behaving VERY strangely with /MD [modified] Pin
Raeldor_23-Oct-06 6:38
Raeldor_23-Oct-06 6:38 
I am doing the following where in_name is System::String and name is std::wstring, and the node parameter is wchar_t* (used to be std::wstring, but that didn't work either)...

MNW::MarshalString(in_name, name);
m_node=new NW::Node(name.c_str());

Where NW::Node is my unmanaged class. MarshalString is...

void MarshalString(System::String^ s, std::wstring& os)
{
const wchar_t* chars =
(const wchar_t*)(Marshal::StringToHGlobalUni(s)).ToPointer();
os = chars;
Marshal::FreeHGlobal(IntPtr((void*)chars));
}

Do I need to do more than this?

[EDIT]
having said that, even this...

pin_ptr<const wchar_t> str=L"test";
m_node=new NW::Node(str);

Blows an error. UNLESS I compile with the debug DLL. :S


-- modified at 12:47 Monday 23rd October, 2006
GeneralRe: C++/CLI std::wstring behaving VERY strangely with /MD Pin
led mike23-Oct-06 7:49
led mike23-Oct-06 7:49 
GeneralRe: C++/CLI std::wstring behaving VERY strangely with /MD Pin
Raeldor_23-Oct-06 8:38
Raeldor_23-Oct-06 8:38 
GeneralRe: C++/CLI std::wstring behaving VERY strangely with /MD Pin
led mike23-Oct-06 9:40
led mike23-Oct-06 9:40 
QuestionManaged C++ 101 Pin
Mark Salsbery22-Oct-06 15:29
Mark Salsbery22-Oct-06 15:29 
AnswerRe: Managed C++ 101 Pin
led mike23-Oct-06 5:00
led mike23-Oct-06 5:00 
GeneralRe: Managed C++ 101 Pin
Mark Salsbery23-Oct-06 6:09
Mark Salsbery23-Oct-06 6:09 
AnswerRe: Managed C++ 101 Pin
Eric Dahlvang23-Oct-06 10:45
Eric Dahlvang23-Oct-06 10:45 
QuestionDNS settings Pin
picasso221-Oct-06 19:28
picasso221-Oct-06 19:28 
QuestionWrapping Unmanaged Code... Destructor Not Being Called Pin
Raeldor_21-Oct-06 5:14
Raeldor_21-Oct-06 5:14 
AnswerRe: Wrapping Unmanaged Code... Destructor Not Being Called Pin
George L. Jackson22-Oct-06 14:37
George L. Jackson22-Oct-06 14:37 
QuestionPROG TO ERASE...help Pin
zetkonrad20-Oct-06 1:10
zetkonrad20-Oct-06 1:10 
AnswerRe: PROG TO ERASE...help Pin
Christian Graus20-Oct-06 3:32
protectorChristian Graus20-Oct-06 3:32 
QuestionC++ algorithms Pin
abac_mefisto19-Oct-06 22:13
abac_mefisto19-Oct-06 22:13 
AnswerRe: C++ algorithms Pin
Christian Graus20-Oct-06 0:36
protectorChristian Graus20-Oct-06 0:36 
Questionhi Pin
sudha_sen19-Oct-06 19:17
sudha_sen19-Oct-06 19:17 
AnswerRe: hi Pin
Jonathan [Darka]19-Oct-06 23:37
professionalJonathan [Darka]19-Oct-06 23:37 
AnswerRe: hi Pin
Christian Graus20-Oct-06 0:38
protectorChristian Graus20-Oct-06 0:38 

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.