Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › C++ Float to string conversion
New Posts  All Forums:Forum Nav:

C++ Float to string conversion

post #1 of 20
Thread Starter 
Pretty simple actually, i am making a calculator, and it stores the first number and second number in the equation as double long floats, and im getting an error:

Error 3 error C2664: 'void System::Windows::Forms::Control::Text::set(System::String ^)' : cannot convert parameter 1 from 'int' to 'System::String ^' c:\users\hp\documents\visual studio 2010\projects\hello world\hello world\Form1.h 362

this is a windows 32 forms application... should i #include ?
not sure how i should go about doing this :/
Yin
(13 items)
 
Yang
(14 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7-2600K Sandy Bridge ASUS P8Z68-V PRO PowerColor AX6950 2GBD5-2DH G.SKILL Ripjaws X Series 8GB (2 x 4GB) 
Hard DriveCoolingOSMonitor
Crucial M4 CT128M4SSD2 2.5" SSD Hyper 212 EVO Windows 7 x64 Acer V243HAJbd Black 24" 2ms(GTG) Widescreen 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Black Keyboard Win USB ... SeaSonic X Series X650 Gold XCLIO Color I Black Steel / Plastic ATX Mid Tow... Microsoft Wireless Mobile Mouse 4000 
Mouse Pad
Black Tightened Leather Circle 
CPUMotherboardGraphicsRAM
Intel Core i7-3960X Extreme Edition Sandy Bridg... ASUS Maximus IV Extreme-Z LGA 1155 Intel Z68 Asus Mars II GeForce GTX 580 x2 (Fermi) 3GB Patriot Gamer 2 Series 16GB (2 x 8GB) 
Hard DriveOptical DriveCoolingOS
OCZ RevoDrive 3 X2 series RVD3X2-FHPX4 SSD HP DVD-ROM Drive Model 481045-B21 Hyper 212 Evo x4 Windows 7 
MonitorKeyboardPowerCase
NEC Display Solutions LCD2190UXp-BK Black 21.3" x2 RAZER Black USB Wired BlackWidow Ultimate Mecha... CISCO PWR-C45-1300ACV Catalyst 4500 Series 1300... Sentey Black Box Series BX2-4292 v2.1 / 4xUSB /... 
MouseAudio
Logitech G700 Black 13 Buttons Tilt Wheel USB R... BOSE Companion 2 Series 
  hide details  
Reply
Yin
(13 items)
 
Yang
(14 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7-2600K Sandy Bridge ASUS P8Z68-V PRO PowerColor AX6950 2GBD5-2DH G.SKILL Ripjaws X Series 8GB (2 x 4GB) 
Hard DriveCoolingOSMonitor
Crucial M4 CT128M4SSD2 2.5" SSD Hyper 212 EVO Windows 7 x64 Acer V243HAJbd Black 24" 2ms(GTG) Widescreen 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Black Keyboard Win USB ... SeaSonic X Series X650 Gold XCLIO Color I Black Steel / Plastic ATX Mid Tow... Microsoft Wireless Mobile Mouse 4000 
Mouse Pad
Black Tightened Leather Circle 
CPUMotherboardGraphicsRAM
Intel Core i7-3960X Extreme Edition Sandy Bridg... ASUS Maximus IV Extreme-Z LGA 1155 Intel Z68 Asus Mars II GeForce GTX 580 x2 (Fermi) 3GB Patriot Gamer 2 Series 16GB (2 x 8GB) 
Hard DriveOptical DriveCoolingOS
OCZ RevoDrive 3 X2 series RVD3X2-FHPX4 SSD HP DVD-ROM Drive Model 481045-B21 Hyper 212 Evo x4 Windows 7 
MonitorKeyboardPowerCase
NEC Display Solutions LCD2190UXp-BK Black 21.3" x2 RAZER Black USB Wired BlackWidow Ultimate Mecha... CISCO PWR-C45-1300ACV Catalyst 4500 Series 1300... Sentey Black Box Series BX2-4292 v2.1 / 4xUSB /... 
MouseAudio
Logitech G700 Black 13 Buttons Tilt Wheel USB R... BOSE Companion 2 Series 
  hide details  
Reply
post #2 of 20
Could I see the relevant code sections?

Is this pure .NET or are you mixing native C++ and managed code?

In the case of all managed code you can just call ToString() on the float.
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #3 of 20
Thread Starter 
Code:
void updateText()
{
        if (!firstorsecond)
        {
                if (answer == 0 || firstnum != 0)
                {
                        tempstring = firstnum;
                        Text->Text = tempstring;
                }
                else
                {
                        tempstring = answer;
                        Text->Text = tempstring;
                }
        }
        else
        {
                tempstring = secondnum;
                Text->Text = tempstring;
        }
};

its updating the "text bar" of the calculator
i tried to fix it by #include "string"
used to be Text->Text = firstnum etc
Edited by GFreak45 - 1/8/12 at 9:12pm
Yin
(13 items)
 
Yang
(14 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7-2600K Sandy Bridge ASUS P8Z68-V PRO PowerColor AX6950 2GBD5-2DH G.SKILL Ripjaws X Series 8GB (2 x 4GB) 
Hard DriveCoolingOSMonitor
Crucial M4 CT128M4SSD2 2.5" SSD Hyper 212 EVO Windows 7 x64 Acer V243HAJbd Black 24" 2ms(GTG) Widescreen 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Black Keyboard Win USB ... SeaSonic X Series X650 Gold XCLIO Color I Black Steel / Plastic ATX Mid Tow... Microsoft Wireless Mobile Mouse 4000 
Mouse Pad
Black Tightened Leather Circle 
CPUMotherboardGraphicsRAM
Intel Core i7-3960X Extreme Edition Sandy Bridg... ASUS Maximus IV Extreme-Z LGA 1155 Intel Z68 Asus Mars II GeForce GTX 580 x2 (Fermi) 3GB Patriot Gamer 2 Series 16GB (2 x 8GB) 
Hard DriveOptical DriveCoolingOS
OCZ RevoDrive 3 X2 series RVD3X2-FHPX4 SSD HP DVD-ROM Drive Model 481045-B21 Hyper 212 Evo x4 Windows 7 
MonitorKeyboardPowerCase
NEC Display Solutions LCD2190UXp-BK Black 21.3" x2 RAZER Black USB Wired BlackWidow Ultimate Mecha... CISCO PWR-C45-1300ACV Catalyst 4500 Series 1300... Sentey Black Box Series BX2-4292 v2.1 / 4xUSB /... 
MouseAudio
Logitech G700 Black 13 Buttons Tilt Wheel USB R... BOSE Companion 2 Series 
  hide details  
Reply
Yin
(13 items)
 
Yang
(14 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7-2600K Sandy Bridge ASUS P8Z68-V PRO PowerColor AX6950 2GBD5-2DH G.SKILL Ripjaws X Series 8GB (2 x 4GB) 
Hard DriveCoolingOSMonitor
Crucial M4 CT128M4SSD2 2.5" SSD Hyper 212 EVO Windows 7 x64 Acer V243HAJbd Black 24" 2ms(GTG) Widescreen 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Black Keyboard Win USB ... SeaSonic X Series X650 Gold XCLIO Color I Black Steel / Plastic ATX Mid Tow... Microsoft Wireless Mobile Mouse 4000 
Mouse Pad
Black Tightened Leather Circle 
CPUMotherboardGraphicsRAM
Intel Core i7-3960X Extreme Edition Sandy Bridg... ASUS Maximus IV Extreme-Z LGA 1155 Intel Z68 Asus Mars II GeForce GTX 580 x2 (Fermi) 3GB Patriot Gamer 2 Series 16GB (2 x 8GB) 
Hard DriveOptical DriveCoolingOS
OCZ RevoDrive 3 X2 series RVD3X2-FHPX4 SSD HP DVD-ROM Drive Model 481045-B21 Hyper 212 Evo x4 Windows 7 
MonitorKeyboardPowerCase
NEC Display Solutions LCD2190UXp-BK Black 21.3" x2 RAZER Black USB Wired BlackWidow Ultimate Mecha... CISCO PWR-C45-1300ACV Catalyst 4500 Series 1300... Sentey Black Box Series BX2-4292 v2.1 / 4xUSB /... 
MouseAudio
Logitech G700 Black 13 Buttons Tilt Wheel USB R... BOSE Companion 2 Series 
  hide details  
Reply
post #4 of 20
Quote:
Originally Posted by GFreak45 View Post

Code:
void updateText()
{
        if (!firstorsecond)
        {
                if (answer == 0 || firstnum != 0)
                {
                        tempstring = firstnum;
                        Text->Text = tempstring;
                }
                else
                {
                        tempstring = answer;
                        Text->Text = tempstring;
                }
        }
        else
        {
                tempstring = secondnum;
                Text->Text = tempstring;
        }
};
its updating the "text bar" of the calculator
i tried to fix it by #include "string"
used to be Text->Text = firstnum etc

Assuming purely managed C++:
Code:
Text->Text = firstnum->ToString();
/* etc...*/

Including had no chance of fixing this because it is a type-safety issue. You can't assign an int to a string, and the compiler won't implicitly convert an int to a string - you have to do it explicitly either with the managed conversion methods (Convert::ToXx(), int::TryParse(), float::TryParse() or just calling ToString() on the object).
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #5 of 20
Thread Starter 
ty
so i should do it like that or this?
firstnum->ToString(); / ToString(firstnum);
Yin
(13 items)
 
Yang
(14 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7-2600K Sandy Bridge ASUS P8Z68-V PRO PowerColor AX6950 2GBD5-2DH G.SKILL Ripjaws X Series 8GB (2 x 4GB) 
Hard DriveCoolingOSMonitor
Crucial M4 CT128M4SSD2 2.5" SSD Hyper 212 EVO Windows 7 x64 Acer V243HAJbd Black 24" 2ms(GTG) Widescreen 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Black Keyboard Win USB ... SeaSonic X Series X650 Gold XCLIO Color I Black Steel / Plastic ATX Mid Tow... Microsoft Wireless Mobile Mouse 4000 
Mouse Pad
Black Tightened Leather Circle 
CPUMotherboardGraphicsRAM
Intel Core i7-3960X Extreme Edition Sandy Bridg... ASUS Maximus IV Extreme-Z LGA 1155 Intel Z68 Asus Mars II GeForce GTX 580 x2 (Fermi) 3GB Patriot Gamer 2 Series 16GB (2 x 8GB) 
Hard DriveOptical DriveCoolingOS
OCZ RevoDrive 3 X2 series RVD3X2-FHPX4 SSD HP DVD-ROM Drive Model 481045-B21 Hyper 212 Evo x4 Windows 7 
MonitorKeyboardPowerCase
NEC Display Solutions LCD2190UXp-BK Black 21.3" x2 RAZER Black USB Wired BlackWidow Ultimate Mecha... CISCO PWR-C45-1300ACV Catalyst 4500 Series 1300... Sentey Black Box Series BX2-4292 v2.1 / 4xUSB /... 
MouseAudio
Logitech G700 Black 13 Buttons Tilt Wheel USB R... BOSE Companion 2 Series 
  hide details  
Reply
Yin
(13 items)
 
Yang
(14 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7-2600K Sandy Bridge ASUS P8Z68-V PRO PowerColor AX6950 2GBD5-2DH G.SKILL Ripjaws X Series 8GB (2 x 4GB) 
Hard DriveCoolingOSMonitor
Crucial M4 CT128M4SSD2 2.5" SSD Hyper 212 EVO Windows 7 x64 Acer V243HAJbd Black 24" 2ms(GTG) Widescreen 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Black Keyboard Win USB ... SeaSonic X Series X650 Gold XCLIO Color I Black Steel / Plastic ATX Mid Tow... Microsoft Wireless Mobile Mouse 4000 
Mouse Pad
Black Tightened Leather Circle 
CPUMotherboardGraphicsRAM
Intel Core i7-3960X Extreme Edition Sandy Bridg... ASUS Maximus IV Extreme-Z LGA 1155 Intel Z68 Asus Mars II GeForce GTX 580 x2 (Fermi) 3GB Patriot Gamer 2 Series 16GB (2 x 8GB) 
Hard DriveOptical DriveCoolingOS
OCZ RevoDrive 3 X2 series RVD3X2-FHPX4 SSD HP DVD-ROM Drive Model 481045-B21 Hyper 212 Evo x4 Windows 7 
MonitorKeyboardPowerCase
NEC Display Solutions LCD2190UXp-BK Black 21.3" x2 RAZER Black USB Wired BlackWidow Ultimate Mecha... CISCO PWR-C45-1300ACV Catalyst 4500 Series 1300... Sentey Black Box Series BX2-4292 v2.1 / 4xUSB /... 
MouseAudio
Logitech G700 Black 13 Buttons Tilt Wheel USB R... BOSE Companion 2 Series 
  hide details  
Reply
post #6 of 20
Quote:
Originally Posted by GFreak45 View Post

ty
so i should do it like that or this?
firstnum->ToString(); / ToString(firstnum);

ToString() is a method defined in System::Object.
Each type in managed code inherits from System::Object, even primitives such as float and int, therefore ToString() is an accessible member of objects of these types, thus you should use firstnum->ToString().
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #7 of 20
Thread Starter 
new error:

Error 1 error C2227: left of '->ToString' must point to class/struct/union/generic type

also, i made it so when you click the text it auto-copies to clipboard whatever is in the label... but its saying float to unit would lose data, should i convert it to a string?
Yin
(13 items)
 
Yang
(14 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7-2600K Sandy Bridge ASUS P8Z68-V PRO PowerColor AX6950 2GBD5-2DH G.SKILL Ripjaws X Series 8GB (2 x 4GB) 
Hard DriveCoolingOSMonitor
Crucial M4 CT128M4SSD2 2.5" SSD Hyper 212 EVO Windows 7 x64 Acer V243HAJbd Black 24" 2ms(GTG) Widescreen 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Black Keyboard Win USB ... SeaSonic X Series X650 Gold XCLIO Color I Black Steel / Plastic ATX Mid Tow... Microsoft Wireless Mobile Mouse 4000 
Mouse Pad
Black Tightened Leather Circle 
CPUMotherboardGraphicsRAM
Intel Core i7-3960X Extreme Edition Sandy Bridg... ASUS Maximus IV Extreme-Z LGA 1155 Intel Z68 Asus Mars II GeForce GTX 580 x2 (Fermi) 3GB Patriot Gamer 2 Series 16GB (2 x 8GB) 
Hard DriveOptical DriveCoolingOS
OCZ RevoDrive 3 X2 series RVD3X2-FHPX4 SSD HP DVD-ROM Drive Model 481045-B21 Hyper 212 Evo x4 Windows 7 
MonitorKeyboardPowerCase
NEC Display Solutions LCD2190UXp-BK Black 21.3" x2 RAZER Black USB Wired BlackWidow Ultimate Mecha... CISCO PWR-C45-1300ACV Catalyst 4500 Series 1300... Sentey Black Box Series BX2-4292 v2.1 / 4xUSB /... 
MouseAudio
Logitech G700 Black 13 Buttons Tilt Wheel USB R... BOSE Companion 2 Series 
  hide details  
Reply
Yin
(13 items)
 
Yang
(14 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7-2600K Sandy Bridge ASUS P8Z68-V PRO PowerColor AX6950 2GBD5-2DH G.SKILL Ripjaws X Series 8GB (2 x 4GB) 
Hard DriveCoolingOSMonitor
Crucial M4 CT128M4SSD2 2.5" SSD Hyper 212 EVO Windows 7 x64 Acer V243HAJbd Black 24" 2ms(GTG) Widescreen 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Black Keyboard Win USB ... SeaSonic X Series X650 Gold XCLIO Color I Black Steel / Plastic ATX Mid Tow... Microsoft Wireless Mobile Mouse 4000 
Mouse Pad
Black Tightened Leather Circle 
CPUMotherboardGraphicsRAM
Intel Core i7-3960X Extreme Edition Sandy Bridg... ASUS Maximus IV Extreme-Z LGA 1155 Intel Z68 Asus Mars II GeForce GTX 580 x2 (Fermi) 3GB Patriot Gamer 2 Series 16GB (2 x 8GB) 
Hard DriveOptical DriveCoolingOS
OCZ RevoDrive 3 X2 series RVD3X2-FHPX4 SSD HP DVD-ROM Drive Model 481045-B21 Hyper 212 Evo x4 Windows 7 
MonitorKeyboardPowerCase
NEC Display Solutions LCD2190UXp-BK Black 21.3" x2 RAZER Black USB Wired BlackWidow Ultimate Mecha... CISCO PWR-C45-1300ACV Catalyst 4500 Series 1300... Sentey Black Box Series BX2-4292 v2.1 / 4xUSB /... 
MouseAudio
Logitech G700 Black 13 Buttons Tilt Wheel USB R... BOSE Companion 2 Series 
  hide details  
Reply
post #8 of 20
Oops, sorry that should be firstnum.ToString()!
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #9 of 20
Thread Starter 
lol kk, makes sense now, that looks more like a struct method call to me tongue.gif
Yin
(13 items)
 
Yang
(14 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7-2600K Sandy Bridge ASUS P8Z68-V PRO PowerColor AX6950 2GBD5-2DH G.SKILL Ripjaws X Series 8GB (2 x 4GB) 
Hard DriveCoolingOSMonitor
Crucial M4 CT128M4SSD2 2.5" SSD Hyper 212 EVO Windows 7 x64 Acer V243HAJbd Black 24" 2ms(GTG) Widescreen 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Black Keyboard Win USB ... SeaSonic X Series X650 Gold XCLIO Color I Black Steel / Plastic ATX Mid Tow... Microsoft Wireless Mobile Mouse 4000 
Mouse Pad
Black Tightened Leather Circle 
CPUMotherboardGraphicsRAM
Intel Core i7-3960X Extreme Edition Sandy Bridg... ASUS Maximus IV Extreme-Z LGA 1155 Intel Z68 Asus Mars II GeForce GTX 580 x2 (Fermi) 3GB Patriot Gamer 2 Series 16GB (2 x 8GB) 
Hard DriveOptical DriveCoolingOS
OCZ RevoDrive 3 X2 series RVD3X2-FHPX4 SSD HP DVD-ROM Drive Model 481045-B21 Hyper 212 Evo x4 Windows 7 
MonitorKeyboardPowerCase
NEC Display Solutions LCD2190UXp-BK Black 21.3" x2 RAZER Black USB Wired BlackWidow Ultimate Mecha... CISCO PWR-C45-1300ACV Catalyst 4500 Series 1300... Sentey Black Box Series BX2-4292 v2.1 / 4xUSB /... 
MouseAudio
Logitech G700 Black 13 Buttons Tilt Wheel USB R... BOSE Companion 2 Series 
  hide details  
Reply
Yin
(13 items)
 
Yang
(14 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7-2600K Sandy Bridge ASUS P8Z68-V PRO PowerColor AX6950 2GBD5-2DH G.SKILL Ripjaws X Series 8GB (2 x 4GB) 
Hard DriveCoolingOSMonitor
Crucial M4 CT128M4SSD2 2.5" SSD Hyper 212 EVO Windows 7 x64 Acer V243HAJbd Black 24" 2ms(GTG) Widescreen 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Black Keyboard Win USB ... SeaSonic X Series X650 Gold XCLIO Color I Black Steel / Plastic ATX Mid Tow... Microsoft Wireless Mobile Mouse 4000 
Mouse Pad
Black Tightened Leather Circle 
CPUMotherboardGraphicsRAM
Intel Core i7-3960X Extreme Edition Sandy Bridg... ASUS Maximus IV Extreme-Z LGA 1155 Intel Z68 Asus Mars II GeForce GTX 580 x2 (Fermi) 3GB Patriot Gamer 2 Series 16GB (2 x 8GB) 
Hard DriveOptical DriveCoolingOS
OCZ RevoDrive 3 X2 series RVD3X2-FHPX4 SSD HP DVD-ROM Drive Model 481045-B21 Hyper 212 Evo x4 Windows 7 
MonitorKeyboardPowerCase
NEC Display Solutions LCD2190UXp-BK Black 21.3" x2 RAZER Black USB Wired BlackWidow Ultimate Mecha... CISCO PWR-C45-1300ACV Catalyst 4500 Series 1300... Sentey Black Box Series BX2-4292 v2.1 / 4xUSB /... 
MouseAudio
Logitech G700 Black 13 Buttons Tilt Wheel USB R... BOSE Companion 2 Series 
  hide details  
Reply
post #10 of 20
Thread Starter 
ok actually now a different problem, i can work without it solved but this is my new issue, copying the numbers to the clipboard, it cant convert string to unit and float to string loses everything after the decimal (i assume seeing as it has a "loss of data") here are my errors and code:

Error 1 error C2664: 'SetClipboardData' : cannot convert parameter 1 from 'System::String ^' to 'UINT' c:\users\hp\documents\visual studio 2010\projects\hello world\hello world\Form1.h 799
Code:
private: System::Void Text_Click(System::Object^  sender, System::EventArgs^  e) {
                                 if (!firstorsecond)
                                 {
                                         if (answer == 0 || firstnum != 0)
                                         {
                                                 OpenClipboard(0);
                                                 SetClipboardData(firstnum.ToString(), NULL);
                                         }
                                         else
                                         {
                                                 OpenClipboard(0);
                                                 SetClipboardData(answer.ToString(), NULL);
                                         };
                                 }
                                 else
                                 {
                                                 OpenClipboard(0);
                                                 SetClipboardData(secondnum.ToString(), NULL);
                                 }
                         }
Yin
(13 items)
 
Yang
(14 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7-2600K Sandy Bridge ASUS P8Z68-V PRO PowerColor AX6950 2GBD5-2DH G.SKILL Ripjaws X Series 8GB (2 x 4GB) 
Hard DriveCoolingOSMonitor
Crucial M4 CT128M4SSD2 2.5" SSD Hyper 212 EVO Windows 7 x64 Acer V243HAJbd Black 24" 2ms(GTG) Widescreen 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Black Keyboard Win USB ... SeaSonic X Series X650 Gold XCLIO Color I Black Steel / Plastic ATX Mid Tow... Microsoft Wireless Mobile Mouse 4000 
Mouse Pad
Black Tightened Leather Circle 
CPUMotherboardGraphicsRAM
Intel Core i7-3960X Extreme Edition Sandy Bridg... ASUS Maximus IV Extreme-Z LGA 1155 Intel Z68 Asus Mars II GeForce GTX 580 x2 (Fermi) 3GB Patriot Gamer 2 Series 16GB (2 x 8GB) 
Hard DriveOptical DriveCoolingOS
OCZ RevoDrive 3 X2 series RVD3X2-FHPX4 SSD HP DVD-ROM Drive Model 481045-B21 Hyper 212 Evo x4 Windows 7 
MonitorKeyboardPowerCase
NEC Display Solutions LCD2190UXp-BK Black 21.3" x2 RAZER Black USB Wired BlackWidow Ultimate Mecha... CISCO PWR-C45-1300ACV Catalyst 4500 Series 1300... Sentey Black Box Series BX2-4292 v2.1 / 4xUSB /... 
MouseAudio
Logitech G700 Black 13 Buttons Tilt Wheel USB R... BOSE Companion 2 Series 
  hide details  
Reply
Yin
(13 items)
 
Yang
(14 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7-2600K Sandy Bridge ASUS P8Z68-V PRO PowerColor AX6950 2GBD5-2DH G.SKILL Ripjaws X Series 8GB (2 x 4GB) 
Hard DriveCoolingOSMonitor
Crucial M4 CT128M4SSD2 2.5" SSD Hyper 212 EVO Windows 7 x64 Acer V243HAJbd Black 24" 2ms(GTG) Widescreen 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Black Keyboard Win USB ... SeaSonic X Series X650 Gold XCLIO Color I Black Steel / Plastic ATX Mid Tow... Microsoft Wireless Mobile Mouse 4000 
Mouse Pad
Black Tightened Leather Circle 
CPUMotherboardGraphicsRAM
Intel Core i7-3960X Extreme Edition Sandy Bridg... ASUS Maximus IV Extreme-Z LGA 1155 Intel Z68 Asus Mars II GeForce GTX 580 x2 (Fermi) 3GB Patriot Gamer 2 Series 16GB (2 x 8GB) 
Hard DriveOptical DriveCoolingOS
OCZ RevoDrive 3 X2 series RVD3X2-FHPX4 SSD HP DVD-ROM Drive Model 481045-B21 Hyper 212 Evo x4 Windows 7 
MonitorKeyboardPowerCase
NEC Display Solutions LCD2190UXp-BK Black 21.3" x2 RAZER Black USB Wired BlackWidow Ultimate Mecha... CISCO PWR-C45-1300ACV Catalyst 4500 Series 1300... Sentey Black Box Series BX2-4292 v2.1 / 4xUSB /... 
MouseAudio
Logitech G700 Black 13 Buttons Tilt Wheel USB R... BOSE Companion 2 Series 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › C++ Float to string conversion