cgcgames -1 Junior Poster in Training

nice idea :) i got it to work. i just loaded the datarow into the database by doing dr[g] runing a loop of 16 and then it would add all the values to the string which ended up loading the datarow to the database

cgcgames -1 Junior Poster in Training

um isnt there a way to eneter a table into a database?

cgcgames -1 Junior Poster in Training

Hey Everyone

I looked on this site but didnt find anything good enough to help me. I have a DataTable called dt.

it has 230 records in it and 16 colums. I now want to put that table in a table in ms access called weapons. I have never written to a database before. I have only ever read from one. so if someone could help me that would be great.

also i would like to know if the colums have to be the same names and stuff.

thanks,
cgcgames

cgcgames -1 Junior Poster in Training

i Figured out how to do it :)

for anyone that has the same problem this is the code that can do it

TempData.Tables[0].Columns[0].ColumnName.ToString()

and if you do want to try a split it pretty easy to do

TempData.Tables[0].Columns[0].ColumnName.ToString().Split('_');

basicly do Split('Character that seprates the 2 bits of info')

hope this helps someone in the future

cgcgames

cgcgames -1 Junior Poster in Training

Hey Just wanted to ask a quick question.

i am using a MS access database. i have done my selecting and filling of the dataset. What i was wanting to know is there a way to look at the name of the Column where the data is in. I was wanting to put it in a string so i could use that data to fill in somthing. plus i also got another thing i wanted to check in the title.

so does anyone know a way to select the title of the column and put it in a sting?

it would be great help if someone did :)

cgcgames -1 Junior Poster in Training

I am having some trouble in this one area. What I am trying to do is get a treeview that loads from the database. which I have done and it loads all the way to the final data. but what I want it to do is make a conection to the database when the user makes a selection in the final view.

The only way I can see this working is getting another bit of information. the information I need is where they are in the tree view. so i put in a after expand and put the code name2 = TreeView.SelectedNode.Text; I needed that so I can right my sql statment when the user selects somthing in the final view. and for the most part this works. however if the user doesnt click on the text to expand it, it doesnt change the selected node. Basicly meaning if they use the + to expand the view it wont change the selected node.

is there anyway to make the selected node the node that just expanded. If i can do somthing like that my code will work.

if you didnt understand what i was meaning please let me know and ill try and make it more clear.

Thanks,
Cgcgames

cgcgames -1 Junior Poster in Training

ok so i have looked around the web and on this forum but i could only find find and rplace txt in a file and i dont want that.

What i want to do is make a program where the user can select the file path then they can select what kinda of setup they want then click install what this will do is then look at the files in there program and replace them in the program selected.

so you can get a better idea ill go into more detial. I am making this for a game and in the game file it has all the graphics for the GUI and ships etc, i want to make a program that has diffrent graphics of the ships and replace the old with the new. so when the run the game it looks diffrent.

the game is called Star Sonata. So i only want it to look in a file called StarSonata so they system is only aloud to update that file.

so basicly that really. i want a program to ask the user what gui they want then select the path of the file to update then click update and then it will find and rplace the files from the program.

any help will be a big help.

thanks,
cgcgames

cgcgames -1 Junior Poster in Training

i realy did try to understand this lol but i really cant XD.

im useing a MS access databse to do it. so im not sure quite how to do it.

u am just not understanding how it is working. could you maybe describe it a little more? aslong as it donesnt bother you :)

cgcgames -1 Junior Poster in Training

ahh ok :)

yeah i wasnt sure excatly what you where looking for. so i decided i would cover all areas

cgcgames -1 Junior Poster in Training

i have looked around the forum and on the web but couldnt find anything that seemed to be what i was looking for. or i couldnt follow how they where doing it.

What i need is to fill a treeview from a dataset. the dataset has been filled from a database.

when i want to fill a combobox all i need to do is

combo.DataSource = dtclimate;
            combo.DisplayMember = "name";
            combo.ValueMember = "id";

obviously the dataSource is a temp DataTable. that gets filled by a foreach loop.

i was wanting to do somthing simirler with a treeview but it has diffrent ways of doing things.

was wondering if someone could give me a good tut to look at or tell me a good way to handle a treeview and what everything stands for in the syntax. becuase it looks like its pretty diffrent logic and syntax for a treeview but i could be wronge.

thanks to all of you

cgcgames -1 Junior Poster in Training

well im not sure what you want to do. that code right there will only ever add one email adress to the box. becuase you said =. that means it refresses everytime it adds one. whay you want to do is do += that will add a new value to the box.

but you would want to put somthing in like

TextBoxEmailNewsletter.Text = ""

so the user can then empty the box. like make a button with that code or somthing and call it reset.

now lets change all that code :P. go back to your database (if you use MS its real simpy you make a qurrie and then make selected the whole table then go to sql view to get the code) and then use the SQL code to select the whole table. then fill that into a dataTable.

myConnect2 = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\Jordan\\Documents\\Star Sonata\\StarSonata Calculator\\Items.mdb;Persist Security Info=False");

            myConnect2.Open();
            OleDbDataAdapter terradata = new OleDbDataAdapter("SELECT t_firstData.* FROM t_firstData;", myConnect2);
            terradata.Fill(fill);
            myConnect2.Close();

that is code to connect to a MS databse. that is now making a conection to the database then fill a dataset with the table you selected. (dont forget to make the dataSet. DataSet fill = new DataSet();)

from there you can do one of 2 things. you can select a row manualy or do it from the users choise.

a manul selection would look somthing like this

//Convert it to String (not needed but i do it anyway)
//cadata = …
cgcgames -1 Junior Poster in Training

hmm im not sure quite what your having to do? You have to make a program? and im assuming in C++ which is not a good langauge for web C# is way better for web side of things.

what im not understanding is what does the program have to do? and is it ment to be a windows form kinda thing or somthing that goes on the web thats none client based?

cgcgames -1 Junior Poster in Training

we need to see code or somthing. we cant just solve somthing without seeing whats causing it.

eighter tell us somthing more or past soem of your code so we can see what you have done :)

cgcgames -1 Junior Poster in Training

Sorry but i am really having a hard time with these datasets :). if anyone knows a awsome tut on them i would be very gratefull

what i am trying to do is use a database then fill the datasets. i can do that part. but now i want to fill comboboxes (i can do that to) then i want it to take addonholder (which is a colum in my table) and put it in a double so it can be calculated in a calculation.

then i have 6 boxes that only show information from another table when somthing is selected from the other 3 boxes on the other side. in the tables i have put in data that should help me link. the id of heavy is 0 and hevy shows 1 thing in the other 6 boxes. so i want it to look at the id in the boxes and decided from that what to addin and remove whats not ment to be there.

sorry for not going into massive detail. just wanted you to know a small outline of what im trying to do so you know what the best tut is for me to look at.

also if this helps where is what my databse looks like. Click the link below

http://www.mediafire.com/?yfr52oqcknakk9g

thanks,
cgcgames

cgcgames -1 Junior Poster in Training

sorry dont know how to delete :). this was ment to be in C# i forgot i changed over to C# becuase i knew more. sorry about that

cgcgames -1 Junior Poster in Training

thanks ill try and get stuff to wrok from what you said

cgcgames -1 Junior Poster in Training

9 i am wanting to split that up into 3 parts givng me 3 bits of info for each

cgcgames -1 Junior Poster in Training

I am Working on Conecting to a database in windos forms C++. I use MVC++.

here is a link to my DB file so people can see what i have tried to do in the DB.

http://www.mediafire.com/?yfr52oqcknakk9g

you need access to see this.

i have finaly figured out how to make a connection to the database and put a table into a dataset and then put the data in the dataset into a combobox however what i dont know how to do is limit the data put in the combobox.

right not i have 3 combobox one called gravity another called temperature and my last one is called climate. there is 3 things i want to do. I want to take the data and put the text in the box (i can do that) but i want to limite what is put in there. I want it to put Heavy, Normal and Low into one combobox. Gas, Nox, Terran in another one and then the last 3 in the last box. i have put in the table all heavy type == 0 all temp type == 1 all climate type == 2.

i also have a thing called addonholder. i want that number to be stored with that text. so if someone was to selection Heavy, Terran, Frozen. it will look at the addonholder colume and times them togeather. to give you an output.

I am finging it hard to do …

cgcgames -1 Junior Poster in Training

Hello Everyone

I have been looking on the net and I found a few things but I am a bit think :P. I need more of a walkthrough kind of things. I am currently making a programe for a game and I need to access a database that has information.

I have made the tables I need in access and I am using windows forms in C++. I saw there was a dataset thing I could use. but when I was going onto the microsoft side they had a data Adapter wizered which looked great but it must not be included in the express version even though i can use it in code it wont do all the things for me like it said on microsoft :). my biggest thing is I need to conect to the datbase in my programe and make it fill some comboboxes by looking at the information. it also has to control when it puts stuff in the box like if someone makes a selection it will add some more selections.

here is a download link of the program you can use atm. this has been coded without a database and now i want to change it to a database and finish it off. seeing as there are bugs and there are 4 parts to finish off.

http://www.mediafire.com/?6kyzi1t6y91tcze.

that is so you can see what i am trying to do with the database. i want to conect and …

cgcgames -1 Junior Poster in Training

nvm got it working XD. my uncl came in and i found so many things in all the other langauges just not C++ but eventrally i got it to work with the ::. which i should of relised lol :).

so it worked with

Application::Exit();

cgcgames -1 Junior Poster in Training

I give up hehe. been looking over the form and the internet and couldnt find anything that worked.

what i want to do is simple. i have made a program that uses a MDI form (basicly a shell form that opens forms in it). and in the menu bar it has file then exit. I want it to close the shell when the person clicks the exit button but i dont know how to code that in.

does anyone have any ideas to help me

thanks,
cgcgames

cgcgames -1 Junior Poster in Training

hmm its not easy to find the info. the best i could find was this.

http://bytes.com/topic/c/answers/223167-break-string-into-different-parts

just keep in mind this is possible so dont give up :).

good luck with it. sorry i couldnt be of more help.

cgcgames -1 Junior Poster in Training

you need to split it all up. look at the string in code. then serch for characters. tbh i havent needed to do this before. but i know you can and recently i have been working on forms in C++ which is managed code.

what i suggest you do is search in good spliting strings or somthing. or finding somthing in a string.

give me 10mins or so ill go see if i can find somthing when i do ill come back to you

cgcgames -1 Junior Poster in Training

well deppends on what you are trying to do. if tis always going to be the same equation then you can cheat. but if you want to do some mathmatical equation to work it at then you need to code what its going to need to check.

first of all you need to check the letters after the numbers in the first string and the second string to see if they match.

once you do that its pretty much like how you do it in your head. you just tell it to add this to that times that to this etc :P.

also what i would do is sperate the letter from the number when it does equal the same letter then put the numbers into there own veriable and run them through the calculation then at the end add the letter you seperated. so you need to store the letter somewhere else.

hope that helps you.

good luck,
cgcgames

cgcgames -1 Junior Poster in Training

only just got up and was able to read through all this and Fbody is right. he pretty much said my first conclution. however i hardly ever use throws in my code. i genrally work around them :).

however you have used them with out any trys or catches which is expected. it even tells you in the error log. you have like 15 errors saying the throw doesnt work and like Fbody said use try and catch statments. jsut type in goodle try and catch statments in C++. that should get you somthing helpful if you havent already done so.

anyway good luck with it. sorry i couldnt be of more help

cgcgames -1 Junior Poster in Training

the reading part isnt so easy. id recomend typing into google reading from file. or look at a File I/O.

for storing its pretty easy.

if you start with an empty project(in Dev C++ or microsoft VC++). and put a "filename".cpp file in the source folder of you program and code from there including the header files <iostream> and <fstream>. Then all you have to do is store the user input by putting it into an array then putting the array into the textfile.

this shows you how to put the file with extra stuff.

DefinedFileName << yourarray << "\n"

you can put what ever you want into those qouts. like even " " meaning space. and even adding somthing else if you want. just by putting "<<".

this should help you with that. i strongly suggest you look up File I/O C++. that will show you how to hold data when opening files or deleting all the data in a file etc.

or click below and look at a tut that i used when i was learning it.

http://www.cprogramming.com/tutorial/lesson10.html

from there its just trying it out and see what it does and what you can make it do.

Good luck,
cgcgames

P.S. if you need help in other areas you dont understand that i just assumed you would. like getting a line from the user and putting it into and array. please let me …

cgcgames -1 Junior Poster in Training

oh ok well i cant help you much there sorry. i userly use VC++ eighter that or you need to find what liberies are needed and what are included with your compiler to find out what can make the text box.

eighter that or you hard code the libery's to do what you want. but i recomend the VC++ its got it all included. if your not already using microsft VC++

cgcgames -1 Junior Poster in Training

yeah your problem is you have a ; after your if statment at line 24. apart from that it should work

cgcgames -1 Junior Poster in Training

hmm well im not sure what the program is trying to do. havent looked hard enough at it. but you have a few decleration errors. you put empty in there and thats not not c++ code and if its ment to be a veriable you didnt declare it.

you also have a few sytax errors that shouldnt be there so you messed somthing up in your class stuff. tbh it all looks a bit messy. thats mostly becuase it didnt open tabed out so its all on the baseline :) making it hard to read.

but what i can gather is the main problem is your throws, im not sure what the problem is but there not working in the code. if i understood more about what the program is ment to be doing maybe i can help a little bit better.

cgcgames -1 Junior Poster in Training

np glad to help

cgcgames -1 Junior Poster in Training

Like jonsca said. we need to know what your using. if its Windows Forms in Visual C++ then all you do is drag and drop a textbox and set its properties in the properties window.

then double click it and now you can code it.

if you want to try somthing. let the user put text in the textbox then make there text apear in a read only box. this is simple to do. you just put two text boxes in a form. make one read only in the proerties window. then put a button in.

from there double click the button. then store the information into a string.
somthing like this

String^ usertext = this->textbox1->Text

then you can put that text into the other text box like this.

this->textbox2->Text = usertext;

you can do much more but that is the basis you kinda need to know. you can even code it without storing it into a string. but i find its helpfull if you want to do somthing like compare there text to somthing.

i.e. for a user system. you might want to use a if statment to compare input a user entered like a password. you can have a signup section that takes user input then a login that checks it to the input that they entered. thats when its usefull to use strings.

cgcgames -1 Junior Poster in Training

ahh ok :) nice to see you got your problem fixed.

cgcgames -1 Junior Poster in Training

thats for the help i wast trying a diffrent way ill give that a go now

cgcgames -1 Junior Poster in Training

hmm i dont tbh. does the error pop up in a file complied version? i have a felling that in a full complied version it wont pop up. one thing you can do is make the program it self check if its is playing then make a message box show up saying this file cant play do you have flash? if not follow this link. or somthing along the lines of that.

the error your getting only seems to be a compile error. once the program is in a compiled state it shouldnt matter. it will run when there is flash and it wont run when you dont have flash. it shouldnt pop up with any errors.

but i could be wronge. just try and build your solution and run it from my computer instead of runing it straigt from the programe.

anyway best of luck

cgcgames -1 Junior Poster in Training

im checking 3 things. to make sure the other 6 boxes dont have the same value selected.its also checking 2 things. one thing is checking the other 6 for information needed for that item. and its also checking the other 3 i have to see what the user input. basicly it dont matter what im trying to do. all i need to know is how to compare information in the comboboxes

i want to compare it somthing like this

if (Atmos == "Noxious")

but i cant do that becuase its its coded in a diffrent section. i just need to know how to compare boxes so one box looks at the other box to see whats in it and if its the wronge information it wont run that.

cgcgames -1 Junior Poster in Training

like whaty Allophyl said :). i was just trying to keep it simple hehe. um but you havent stored the other prime in testing number. what your doing is minusing the same number from eachother becuase you store a diffrent prime in testing number everytime. what i would do is somthing like this.

#include <iostream>
#include <math.h>

using namespace std;

int main () {
	int testnumber = 3; //declares the number that will be tested on. this is the first prime
	int findingprime = testnumber - 1; // the number that is used to divid by testnumber to check if there is a remander
	int lastprimeholder = 3; //holdes the last prime so you can compare it

	while (testnumber < 100) { //loops while primes are under 100
		if (testnumber%findingprime == 0) { // check for to see if there is no remander and if there is its not a prime number and adds 2 to the testnumber to start testing the next number
			testnumber = testnumber + 2;
			findingprime = testnumber - 1;
		}
		else { //else if there is a remander it takes one of the findingprime veriable and reruns the loop
			findingprime = findingprime - 1;
		}
		while (findingprime == 1) { //if it goes through all the looping and finding prime is equal to 1 then that means testnumber is a prime
			if (testnumber-lastprimeholder == 2) {
				cout << lastprimeholder << " " << testnumber << "\n"; //print the pair to the screen
			}
				lastprimeholder …
cgcgames -1 Junior Poster in Training

well depends on what your doing :). if your making a forms aplication its pretty easy. you just put the CSV file into your project. i userly make a new file called data and put it there.

then in the toolbox view look for data and then data sorce and put it to your form then you can link the data sorce to your database and go from there. tbh i havent looked into reading line by line my self.

if your doing a comand line im not sure how to do that :) i need to look it up. but im sure someone else will replie before i can look it up and figure it out for you. however if know one has before tomorrow (im goign to bed now) then ill figure it out and let you know

Kind Regards,
cgcgames

iamthwee commented: wtf? datasource? -2
cgcgames -1 Junior Poster in Training

um well i would do it like that. i would make a table in a database and link it into C++.

i would use somthing like access but its up to you.

im not sure how to do tables any other way so im sorry

oh you can also do it in flat files. you can do it by taking a string and putting it into a flat file. and then placing the next information somewhere else in the file.

for example if you opened a flat file it could say
username::password
testing::123
tvrjc1::testing
klimop::jit853

somthing like that by taking user input putting it into a string then putting it into a file and adding a "::" on the end to serprate your data. somthing like this

cout << username << "::";

here is where you can look at how to read and write to files.

http://www.cprogramming.com/tutorial/lesson10.html

hope this helps you a little

cgcgames

cgcgames -1 Junior Poster in Training

Um well thats the problem :P. you need flash to play it. so if you uninstalle flash it wont work. what i would suggest you do is make a setup file and then check if the user has flash.

apart from that i dont think you can get around it. you need to have flash on you comp to play it. but i could be wronge. so if someone has any better ideas please share them.

the only other way i know you could fix this is use Windows Media Player. this will then pretty much work on anyones PC. apart from mac :P. because most windos PC's already have that installed and runing.

anyway good luck with your problem

cgcgames -1 Junior Poster in Training

first of all printf is not a C++ thing lol. inless thats included with your header.

cout << "enter a number: ";

is a better way of doing it.

and the calcualation doesnt make much sence. it did all the way upto when it made num1=num2.

its looking for a remander. then checking if the remander is == 0

but the next part doesnt make a lot of scence. i mean its not really doing anything :P.

cgcgames -1 Junior Poster in Training

why do you want to call on notepad. if your wanting to creat a txt file and save it then open it later one to look at the info in the text file. then you dont really want to open notepad.

however if tht was what you were wanting to do then Acient Dragon is correct.

but if you want to do what i said here is a link to look at how to do that.

it is called File I/O

http://www.cprogramming.com/tutorial/lesson10.html

good luck with what you are trying to do

cgcgames -1 Junior Poster in Training

since this seems to be for school i will not give you the awnser. but i have quickly coded somthing that you can look at. this is how to find a prime number. once you can do that it should be farly easy to figure out how to find primes 2 numbers apart.

#include <iostream>
#include <math.h>

using namespace std;

int main () {
	int testnumber = 3; //declares the number that will be tested on. this is the first prime
	int findingprime = testnumber - 1; // the number that is used to divid by testnumber to check if there is a remander

	while (testnumber < 100) { //loops while primes are under 100
		if (testnumber%findingprime == 0) { // check for to see if there is no remander and if there is its not a prime number and adds 2 to the testnumber to start testing the next number
			testnumber = testnumber + 2;
			findingprime = testnumber - 1;
		}
		else { //else if there is a remander it takes one of the findingprime veriable and reruns the loop
			findingprime = findingprime - 1;
		}
		while (findingprime == 1) { //if it goes through all the looping and finding prime is equal to 1 then that means testnumber is a prime
			cout << testnumber << "\n"; //print the prime to the screen
			testnumber = testnumber + 2; //moves onto next number
			findingprime = testnumber - 1; // sets findingprime to one lest then testnumber
		}
	}
	cin.get(); // waits for user to press enter to stop the programe.
}

Good Luck

cgcgames -1 Junior Poster in Training

[] means how many spots you will get in the char veriable. this is called an array. what you just saw was a 2d array.

char username[10]

that line of code means you can now store 10 chars in the username veriable.
this is useful when you want to store more then one char.

a 2d array is pretty much the same but now it stores one in the first slot and one in the second slot. so you could use it to keep track of a tic tac toe game for instance.

here is an full example using the comand line on how to use a single array
this example makes an array with int. you can make an array with any legal syntax for storing veriables.

#include <iostream>

using namespace std;

int main(){
	int Array[4]; //declares a veriable called Array with 4 slots

	cout << "Enter a number: ";
	cin >> Array[0]; // you must always remeber that it starts at 0 and not 1

	cout << "Enter a second number: ";
	cin >> Array[1];

	cout << "Enter a third number: ";
	cin >> Array [2];

	Array[3] = Array[0]+Array[1]+Array[2]; // this means that you will only have to Array[3] since it starts at 0

	cout << "The sum is: " << Array[3] << "\n";//display whats stored in Array[3]. that is what was just done above.
	cin.ignore(); //ignores the enter so i can use the cin.get()

	cin.get(); //waites for user to press enter …
cgcgames -1 Junior Poster in Training

Hi Everyon.

Sorry to bother you all again.

but I cant seem to figure out a solution for comparing information in these comboBoxes. What I want it to do is take the information the user selects and compare it with another drop down.

so lets say one drop down says Terran and a second one says Noxious. I want the second Combobox to check what it says inside it, (i can get this to work then i add a veriable to it) then i want it to check if the first Combebox says Terran if so check if one of the selection boxes(i have 6 textboxes that have the same input) already has the same information.

then later on i add it to the calculation at the end. but my problem is trying to compare infermation from the other comboboxes. before i was kinda just looking at the info in one combie box. now i want to compare info from one box and determine weather the other box is aloud that selection. If that makes any sence

here is some of the code i got so far.

//veribales needed to do all the calculations and storing
		float gravholder;
		float tempholder;
		float atmosholder;
		int calevelholder;
		int calcholder;
		int cacalc;
		int addonholder;
		int addonholder2;
		int addonholder3;
		int addonholder4;
		int addonholder5;
		int addonholder6;

private: System::Void checkedListBox1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void addonBox5_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void Gravity_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
			 String^ …
cgcgames -1 Junior Poster in Training

Hey Everyone

I am having troubles. i tried looking up how to make the main for invisable but i cant figure out how. i saw some examples but they made no scence to me.

What i am trying to do is change from one form to another and hide the first one. Its basicly a calculator and when someone clicks on the advanced button it flicks to another form that has the advanced settings.

i am using VC++ 2010. I just cant figure this out. this is the code i got so far sorry for the lenght the main bulk of it is at the bottom and a few bits at the top making pointer etc.

#pragma once
#include "help.h"
#include "about.h"
#include "CAadvanced.h"

namespace SSCalculator {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// <summary>
	/// Summary for Form1
	/// </summary>
	public ref class Form1 : public System::Windows::Forms::Form
	{
	private:
		help ^form;
		about ^form2;
		CAadvanced ^advance;

	public:
		Form1(void)
		{
			InitializeComponent();
			form = gcnew help;
			form2 = gcnew about;
			advance = gcnew CAadvanced;
			//
			//TODO: Add the constructor code here
			//
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~Form1()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::ComboBox^  Gravity;
	private: System::Windows::Forms::ComboBox^  Atmos;
	protected: 






	private: System::Windows::Forms::TextBox^  CAinput;

	private: System::Windows::Forms::Button^  Calc;










	private: System::Windows::Forms::ComboBox^  Temp;
	private: System::Windows::Forms::Label^  gravtext;
	private: System::Windows::Forms::Label^  atmostext;
	private: System::Windows::Forms::Label^  temptext;
	private: System::Windows::Forms::Label^  catext;
	private: System::Windows::Forms::TextBox^  inputText;
	private: …
cgcgames -1 Junior Poster in Training

lol i cant bealive i was dumb enough to make that mistack. it was becuase before i had it all on one line so it would of worked. i wasnt thinking when i split it hehe. but it still having problems with it. its saying line consists of to many characters. and i got know clue why

cgcgames -1 Junior Poster in Training

ok i suck :P. i just dont know how to use it in C++. i have tried loads of ways now. I'm just not sure how to get it working I keep getting this error message:

1>c:\users\jordan\documents\visual studio 2010\projects\ss calculator\ss calculator\Form1.h(323): error C2446: '==' : no conversion from 'int' to 'System:: String ^'
1> No user-defined-conversion operator available, or
1> No standard conversion exists from the boxed form of the arithmetic type to the target type

thats when I tried to use strcmp which didnt work eighter. sorry if my code looks like a mess its a bit jumpy lol. what im wanting to do is take the info from the comboBox and place a veribable with it. so when the user finishes selecting the 3 drop downs. it will take the string inputs. Then take what ever multiplier that was put with the string(i have tried to do this with if statments). then after that it will times the multiplyer's togeather then times that by 100 (havent codded that in yet becuase there not point till i can get the infermation).

im really tempted to just make it in C# but I want to have a better understanding in C++ becuase I am more likly to be working in that field in the future.

here is the code so far (and yes its bad i know :P)

#pragma once
#include <cstring>

namespace SSCalculator {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace …
cgcgames -1 Junior Poster in Training

Thanks for the Help. And the correction on the line of code i messed up on :).

I am going to try what you have done and see if i can link it with it all. I have never created a windows form aplication in C++ before so this is a little new to me.

anyway im am very greatful.

kind regards,
Jordan

cgcgames -1 Junior Poster in Training

Hi Everyone.

I have been Looking around for a Tutorial on Forms in Visual C++ I found a nice graphical calculator walkthrough for C# but the code for C# and C++ is a little diffrent and I cant get it working in C++.

I am trying to make a Form that takes infermation from a ComboBox(Drop Down). to Calculate somthing later on.

my issue is I am finding it hard to figure out how to get the infermation from the ComboBox hehe.

in C# if i have a comboBox called grav I can just get the infermation I want out of it by using

Grav.Text == 'sting'

I am wanting to do somthing like that in C++

here is what I have coded so far.

private: System::Void Temp_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void Atmos_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void Gravity_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void CAinput_TextChanged(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void CAtext_Click(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void Calc_Click(System::Object^  sender, System::EventArgs^  e) {
			 if (Gavity.Text == 'Heavy' || 'Normal' || 'Low'){
				 if (Atmos.Text == 'Gaseous' || 'Noxious' || 'Terran'){
					 if (Temp.Text == 'Blistering' || 'Frozer' || 'Temperate'){
						 if (Gravity.Text == 'Heavy'){
							 gravholder = 0.5;
						 }
						 if (Gravity.Text == 'Normal'){
							 gravholder = 1;
						 }
						 if (Gravity.Text == 'Low'){
							 gravholder = 0.75;
						 }
						 if (Atmos.Text == 'Gaseous'){
							 atmosholder = 0.5;
						 }
						 if (Atmos.Text == 'Noxious'){
							 atmosholder = …
cgcgames -1 Junior Poster in Training

Thanks for the speedy replie.

but im not sure thats quite what i was looking for.

sorry for the difficulty understanding what was trying to say. I was trying to think of a way to word it hehe so it probably didnt come out the best.

what im looking for is a way to edit the string retured from a file. right now my code puts the user input (username and password) into a txt file adding ~ on the end. so if i was to open the file it would look like username~password~.

what i am wanting to do is take that information from the file (as you can see what i have done in the void login() fucntion) and make it so i can take the first string of charaters before the ~ and the second string of charaters after the ~. and compare it to the user input for login to make sure they entered the right accout details.

i manged to get this to work another way but i want to be able to close the program and re open it and still be able to login without having to signup again.

i then went on to say at the end i was also trying to see if i could get a flat file database to work. but im not sure how to do one of those and was wondering if thats the best option and how to implment one …