![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#21 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 852
Rep Power: 4
![]() |
Try
txtItem->Text = "0"; String current; current = txtItem->Text; |
|
|
|
|
|
#22 |
|
Programmer
Join Date: Jun 2005
Posts: 99
Rep Power: 4
![]() |
txtItem->Text = "0"; String ^ current; current = txtItem->Text; Why the txtItem->Text = "0" bit? Thats going to clear any data that your about to read... |
|
|
|
|
|
#23 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Actually, it makes a zero-shaped character, neh?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#24 | |
|
Programmer
Join Date: Apr 2006
Location: Calgary, Alberta
Posts: 67
Rep Power: 3
![]() |
Quote:
And the ^ thing fixed it for me, so could somebody mind telling me jsut what the hell that thing does? |
|
|
|
|
|
|
#25 |
|
Programmer
Join Date: Apr 2006
Location: Calgary, Alberta
Posts: 67
Rep Power: 3
![]() |
Also, how do I go about converting a String ^ type string to an integer value? In regualr C++, I would just use atoi() or something along those lines, but it won't let me do it with these new managed variable types.
And just to clarify, if I have a string containing "4388", I would need int a = 4388, not just the ascii value of each character. |
|
|
|
|
|
#26 |
|
Programmer
Join Date: Apr 2006
Location: Calgary, Alberta
Posts: 67
Rep Power: 3
![]() |
And is it possible to convert these new Strings into old C++ style strings, so I can use the same functions on them?
|
|
|
|
|
|
#27 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Well I don't know why you are doing C++.NET, I would definitely use C# for that. If you know C++ and/or Java it's pretty easy to do most of the stuff in C#.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#28 |
|
Programmer
Join Date: Jun 2005
Posts: 99
Rep Power: 4
![]() |
I agree with nnxion, if your want to develop on .net, and you can use any lanuage, use C#. It was developed from sratch for .net and so is the most natural lanuage to use. C++/CLI (C++.net) on the other hand, was developed as a managed / unmanaged transition layer so developers could still use their favourite unmanaged libraries in a .net enviroment. It certainly wasn't developed to be easy to use and confuses the hell out of me about it's subtle managed / unmanaged rules.
As for parsing if your using a managed type parse using a managed technique dont try to convert back and forth between managed / unmanaged types, just learn to do it the managed way. Thats what C++/CLI is about know how to do everything in both the managed and unmanaged way. This shoulld work: String ^ S = "54"; int i = int::Parse(S); |
|
|
|
|
|
#29 | |
|
Programmer
Join Date: Apr 2006
Location: Calgary, Alberta
Posts: 67
Rep Power: 3
![]() |
Quote:
|
|
|
|
|
|
|
#30 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 766
Rep Power: 3
![]() |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|