a problem!!!!
-
hi all!! i am facing a problem i am bnot able to understand!!! consider the foll codes in my project CPrjView pview; long c1=pview.ctr; these r lines written in a c.cpp and it includes the PrjView.h file ctr is a public variable of The CPrjView class of type long i am not underrstanding that why c1 is getting a very strange value!!! for ef ctr is 3 and still c1 is getiing a value like -85899346 also i am not able ti change the values of variables in this c.cpp for eg if i write pview.ctitle="ABC"; ctitle is a public variable of CPrjView class of type CString it is giving a run time error... please help!!!1
-
hi all!! i am facing a problem i am bnot able to understand!!! consider the foll codes in my project CPrjView pview; long c1=pview.ctr; these r lines written in a c.cpp and it includes the PrjView.h file ctr is a public variable of The CPrjView class of type long i am not underrstanding that why c1 is getting a very strange value!!! for ef ctr is 3 and still c1 is getiing a value like -85899346 also i am not able ti change the values of variables in this c.cpp for eg if i write pview.ctitle="ABC"; ctitle is a public variable of CPrjView class of type CString it is giving a run time error... please help!!!1
doing
CPrjView pview;
calls the default constructorCPrjView::CPrjView()
. be sure you're correctly initializingctr
into this constructor, because it seems to be nowhere else getting a value... maybe you think it contains 3, but it doesn't. did you use the debugger ? what happens if you do the following ?pview.ctr = 3;
long c1 = pview.ctr;
TOXCCT >>> GEII power
[toxcct][VisualCalc] -
hi all!! i am facing a problem i am bnot able to understand!!! consider the foll codes in my project CPrjView pview; long c1=pview.ctr; these r lines written in a c.cpp and it includes the PrjView.h file ctr is a public variable of The CPrjView class of type long i am not underrstanding that why c1 is getting a very strange value!!! for ef ctr is 3 and still c1 is getiing a value like -85899346 also i am not able ti change the values of variables in this c.cpp for eg if i write pview.ctitle="ABC"; ctitle is a public variable of CPrjView class of type CString it is giving a run time error... please help!!!1
smartymanav wrote: for ef ctr is 3 and still c1 is getiing a value like -85899346 Never define a variable anywhere without giving it a default value. Otherwise, this is what you get. I think the other response covers your more specific problem. Christian Graus - Microsoft MVP - C++
-
doing
CPrjView pview;
calls the default constructorCPrjView::CPrjView()
. be sure you're correctly initializingctr
into this constructor, because it seems to be nowhere else getting a value... maybe you think it contains 3, but it doesn't. did you use the debugger ? what happens if you do the following ?pview.ctr = 3;
long c1 = pview.ctr;
TOXCCT >>> GEII power
[toxcct][VisualCalc]thanks a lot!!!!!!!!!!1 it solved my prob....i need practice!!!!!! thanks but can u also advice me something i wan t to permanently save the changes made in an array of strings..... i tried to use databse for it but cud not...do u know hot to get data from multiple tables in different variables thanks again
-
thanks a lot!!!!!!!!!!1 it solved my prob....i need practice!!!!!! thanks but can u also advice me something i wan t to permanently save the changes made in an array of strings..... i tried to use databse for it but cud not...do u know hot to get data from multiple tables in different variables thanks again
what database do you use exactly ? if MS SQL Server, ADO is the best way (i consider you know about SQL though - see Carlos Antollini's ADO Classes[^] for that). if you use simple files, it will depend on how you format them... cheers,
TOXCCT >>> GEII power
[toxcct][VisualCalc] -
doing
CPrjView pview;
calls the default constructorCPrjView::CPrjView()
. be sure you're correctly initializingctr
into this constructor, because it seems to be nowhere else getting a value... maybe you think it contains 3, but it doesn't. did you use the debugger ? what happens if you do the following ?pview.ctr = 3;
long c1 = pview.ctr;
TOXCCT >>> GEII power
[toxcct][VisualCalc]thanks a lot it solved my prob thanks again!!! but can u tell me another thing plz suggest me a medthod to permanently save the changes made during run time into a array of strings in vc++ i tried to use database but am unable as i am already using a database to get data into a form in the same project do u know how to get data from multiple tables in the same project into diff forms... thanks again
-
what database do you use exactly ? if MS SQL Server, ADO is the best way (i consider you know about SQL though - see Carlos Antollini's ADO Classes[^] for that). if you use simple files, it will depend on how you format them... cheers,
TOXCCT >>> GEII power
[toxcct][VisualCalc]i am using access datase linking by odbc.... is ado better???or it is possible to do so in odbs using access database acually the thing is i am already using a database for retrieving data in a form in this same project.... i now want to use another table in the same database for retriving data in to another form plz help or suggest a diff way thanks
-
i am using access datase linking by odbc.... is ado better???or it is possible to do so in odbs using access database acually the thing is i am already using a database for retrieving data in a form in this same project.... i now want to use another table in the same database for retriving data in to another form plz help or suggest a diff way thanks
-
i am using access datase linking by odbc.... is ado better???or it is possible to do so in odbs using access database acually the thing is i am already using a database for retrieving data in a form in this same project.... i now want to use another table in the same database for retriving data in to another form plz help or suggest a diff way thanks
Hi, U can use CDaoDatabase and CDaoRecordset Classes to handle databases. U can directly open access(.mdb) databases and also thro odbc. These classes support both of them. U can also ADO. it is better than DAO. Refer MSDN for more details. Bye Cool Ju:cool: