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

Managed C++/CLI

 
GeneralRe: Gettin image from hard disk in graphics under c Pin
John M. Drescher12-Nov-03 12:06
John M. Drescher12-Nov-03 12:06 
GeneralDialogs in Windows Forms application Pin
krajnik7-Nov-03 8:20
krajnik7-Nov-03 8:20 
GeneralRe: Dialogs in Windows Forms application Pin
Signal-911-Nov-03 9:01
Signal-911-Nov-03 9:01 
GeneralConvert from __GC String to const WCHAR Pin
DR Clevenger6-Nov-03 13:00
DR Clevenger6-Nov-03 13:00 
GeneralRe: Convert from __GC String to const WCHAR Pin
Tom Archer6-Nov-03 17:29
Tom Archer6-Nov-03 17:29 
GeneralRe: Convert from __GC String to const WCHAR Pin
DR Clevenger7-Nov-03 2:59
DR Clevenger7-Nov-03 2:59 
GeneralRe: Convert from __GC String to const WCHAR Pin
DR Clevenger7-Nov-03 3:20
DR Clevenger7-Nov-03 3:20 
GeneralRe: Convert from __GC String to const WCHAR Pin
Tom Archer7-Nov-03 3:50
Tom Archer7-Nov-03 3:50 
DR Clevenger wrote:
I got it I forgot to put the 'const' in the method

Yep Smile | :)

Here's the thing.

The __pin keyword is used to indicate that the value should not be moved in memory. This is done because a .NET String is subject to being moved about by the GC and when you convert that data into a WCHAR* for purposes of using that pointer over any length of time, you need to ensure that the data is not moved. The WCHAR* is also defined as const because String objects are immutable.

Anyway, you probably know this, but I wanted to give you a complete answer on what is going on here just in case.

Cheers,
Tom Archer
* Inside C# -Second Edition
* Visual C++.NET Bible
* Extending MFC Applications with the .NET Framework
GeneralRe: Convert from __GC String to const WCHAR Pin
DR Clevenger7-Nov-03 5:27
DR Clevenger7-Nov-03 5:27 
GeneralString question Pin
Ereinion6-Nov-03 11:24
Ereinion6-Nov-03 11:24 
GeneralRe: String question Pin
George L. Jackson20-Nov-03 7:38
George L. Jackson20-Nov-03 7:38 
GeneralError loading C++.Net dll on networkdrv Pin
michaelschmitt3-Nov-03 0:40
michaelschmitt3-Nov-03 0:40 
GeneralRe: Error loading C++.Net dll on networkdrv Pin
J. Dunlap3-Nov-03 8:45
J. Dunlap3-Nov-03 8:45 
GeneralRe: Error loading C++.Net dll on networkdrv Pin
Michael_Sch3-Nov-03 10:04
sussMichael_Sch3-Nov-03 10:04 
GeneralRe: Error loading C++.Net dll on networkdrv Pin
Michael_Sch3-Nov-03 10:07
sussMichael_Sch3-Nov-03 10:07 
GeneralRe: Error loading C++.Net dll on networkdrv Pin
Michael_Sch3-Nov-03 11:09
sussMichael_Sch3-Nov-03 11:09 
GeneralUML help Pin
code_struck2-Nov-03 8:54
code_struck2-Nov-03 8:54 
GeneralRe: UML help Pin
Dave Kreskowiak4-Nov-03 12:49
mveDave Kreskowiak4-Nov-03 12:49 
GeneralRe: UML help Pin
code_struck4-Nov-03 14:07
code_struck4-Nov-03 14:07 
GeneralRe: UML help Pin
Dave Kreskowiak5-Nov-03 12:44
mveDave Kreskowiak5-Nov-03 12:44 
GeneralVisual C++ .NET Compiler Error ... Pin
SD328-Oct-03 23:43
SD328-Oct-03 23:43 
GeneralDial-up server in windows 98 Pin
choupani25-Oct-03 4:07
choupani25-Oct-03 4:07 
GeneralConverting System::String to char* Pin
peter271324-Oct-03 9:10
peter271324-Oct-03 9:10 
GeneralRe: Converting System::String to char* Pin
Tom Archer2-Nov-03 13:20
Tom Archer2-Nov-03 13:20 
GeneralMixing managed and UNmanaged code... Pin
raitz23-Oct-03 1:46
raitz23-Oct-03 1:46 

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.