|
||||||
| Managed C++ Visual Studio .NET managed C++ Topics |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
I am trying to convert from a System::String to a char array. I have found a code snippet that works in Visual Studio 2005 but when I try to run the same exact code in Visual Studio 2003 I get several errors. The code looks like:
System::String *orig = this->textBox1->Text; pin_ptr<const wchar_t> wch = PtrToStringChars(orig); size_t origsize = wcslen(wch) + 1; const size_t newsize = 100; size_t convertedChars = 0; char nstring[newsize]; wcstombs_s(&convertedChars, nstring, origsize, wch, _TRUNCATE); Where nstring should be where the string ends up. The errors that I get are: (143): error C2065: 'pin_ptr' : undeclared identifier (143): error C2059: syntax error : 'const' (146): error C2065: 'wch' : undeclared identifier (150): error C2065: '_TRUNCATE' : undeclared identifier (150): error C3861: 'wcstombs_s': identifier not found, even with argument-dependent lookup (150): error C3861: 'wch': identifier not found, even with argument-dependent lookup Any help would be much appreciated. |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Visual Studio 2008 Express Beta 2 Download | Jordan | Programming News | 2 | 08-03-2007 01:05 PM |
| Visual Studio 2005 and Windows Vista | Jordan | General Programming | 3 | 01-22-2007 03:21 PM |
| Visual Studio 2005 Pro Won't Install | CheeseBurgerMan | Software Development Tools | 10 | 09-22-2006 05:44 PM |
| Visual Studio .NET Tips and Tricks free ebook | Jordan | Software Development Tools | 2 | 09-14-2006 02:12 PM |
| Visual Studio 2005 Express Edition | Crane | Software Development Tools | 9 | 05-25-2006 06:17 PM |