Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 21st, 2006, 5:30 AM   #21
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 852
Rep Power: 4 The Dark is on a distinguished road
Try
txtItem->Text = "0";
String current;
current = txtItem->Text;
The Dark is offline   Reply With Quote
Old Apr 21st, 2006, 6:38 AM   #22
Animatronic
Programmer
 
Join Date: Jun 2005
Posts: 99
Rep Power: 4 Animatronic is on a distinguished road
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...
Animatronic is offline   Reply With Quote
Old Apr 21st, 2006, 7:01 AM   #23
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Apr 21st, 2006, 3:32 PM   #24
Twilight
Programmer
 
Join Date: Apr 2006
Location: Calgary, Alberta
Posts: 67
Rep Power: 3 Twilight is on a distinguished road
Quote:
Originally Posted by Animatronic
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...
I just put it there so I know I wouldn't have issues with it trying to read something that wasn't there. It'll go once I actually have to read stuff.

And the ^ thing fixed it for me, so could somebody mind telling me jsut what the hell that thing does?
Twilight is offline   Reply With Quote
Old Apr 21st, 2006, 4:15 PM   #25
Twilight
Programmer
 
Join Date: Apr 2006
Location: Calgary, Alberta
Posts: 67
Rep Power: 3 Twilight is on a distinguished road
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.
Twilight is offline   Reply With Quote
Old Apr 22nd, 2006, 12:48 AM   #26
Twilight
Programmer
 
Join Date: Apr 2006
Location: Calgary, Alberta
Posts: 67
Rep Power: 3 Twilight is on a distinguished road
And is it possible to convert these new Strings into old C++ style strings, so I can use the same functions on them?
Twilight is offline   Reply With Quote
Old Apr 22nd, 2006, 5:00 AM   #27
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
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
nnxion is offline   Reply With Quote
Old Apr 22nd, 2006, 6:51 AM   #28
Animatronic
Programmer
 
Join Date: Jun 2005
Posts: 99
Rep Power: 4 Animatronic is on a distinguished road
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);
Animatronic is offline   Reply With Quote
Old Apr 22nd, 2006, 5:12 PM   #29
Twilight
Programmer
 
Join Date: Apr 2006
Location: Calgary, Alberta
Posts: 67
Rep Power: 3 Twilight is on a distinguished road
Quote:
Originally Posted by nnxion
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#.
All I did was grab Visual C++, because I thought it would be the most familiar. However, if C# is easier, I'll definitely give it a try. Know where I can pick up free development software?
Twilight is offline   Reply With Quote
Old Apr 22nd, 2006, 5:39 PM   #30
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3 Jimbo is on a distinguished road
http://msdn.microsoft.com/vstudio/express/visualcsharp/
Jimbo is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:39 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC