|
Do you have an aversion against isalpha() and isdigit() ?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all,
I m using a ListCtrl of Report View Type in dialog boxes and FormView,
I want to resize the last column of List Control according to size of dilog box and formview.
please tell me how can i do this.
if possible please explain with example.
thank in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: I want to resize the last column of List Control...
Use the list control's SetColumnWidth() method.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
SetColumnWidth(),use for fix width i want to resize the last coloumn as ListCtrl resize.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: ...i want to resize the last coloumn as ListCtrl resize.
And you use SetColumnWidth() for this.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi All,
If i try to print or preview print, the image gets tilted vertically.
I have set the mapping modes all properly. I think there is a problem some where else.
And fyi - i use CImage Class and BitBlt function with SRCCOPY flag to display my image.
And my mapping mode is MM_LOENGLISH.
Kindly help!
Priya Sundar
|
|
|
|
|
I want to add a button to accept files.
I had set the "Accept Files" property of the button to be True.
But how do I receive the message when I drag a file to the button?
|
|
|
|
|
Create a class for that button derived from CButton. And inside that class handle the WM_DROPFILES message.
|
|
|
|
|
Hi all
I know its windows forum . But I have a doubt : What is the equivalent of _set_new_handler() in unix GCC ? When I tried including it its not compiling . I have included <new> also .
redindian
|
|
|
|
|
|
Ok, I have to do 3 programs for school and I am completely lost on how to start either of them off. If somebody could help me I would greatly appreciate it. Here is the info about the programs.
1. Population
Create a New Project called YourLastnamePopulation.
In a population, the birth rate is the percentage increase of the population due to births and the death rate is the percentage decrease of the population due to deaths. Write a program that displays the size of a population for any number of years. The program should ask for the following data:
· The starting size of a population
· The annual birth rate
· The annual death rate
· The number of years to display
Write a function that calculates the size of the population for a year. The formula is
N = P + BP + DP
Where N is the new population size, P is the previous population size, B is the birth rate, and D is the death rate.
Input Validation: Do not accept numbers less than 2 for the starting size. Do not accept negative numbers for birth rate or death rate. Do not accept numbers less than 1 for the number of years.
2. Lowest Score Drop
Create a New Project called YourLastnameLowestScore.
Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions:
· void getScore() should ask the user for a test score, store it in a reference parameter variable, and validate it. This function should be called from main once for each of the five scores to be entered.
· void calcAverage() should calculate and display the average of the four highest scores. This function should be called just once by main, and should be passed the five scores.
· int findLowest() should find and return the lowest of the five scores passed to it. It should be called by calcAverage, which uses the function to determine which of the five scores to drop.
Input Validation: Do not accept test scores lower than 0 or higher than 100.
3. Overloaded Hospital
Create a New Project called YourLastnameHospital.
Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient, the following data should be entered:
· The number of days spent in the hospital
· The daily rate
· Hospital medication charges
· Charges for hospital services (lab tests, etc.)
The program should ask for the following data if the patient was an out-patient:
· Charges for hospital services (lab tests, etc.)
· Hospital medication charges
The program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out-patient information. Both functions should return the total charges.
Input Validation: Do not accept negative numbers for any data.
Again I would appreciate if someone could start me on the right path to completing these programs
|
|
|
|
|
LilKoopa wrote: Ok, I have to do 3 programs for school and I am completely lost on how to start either of them off. If somebody could help me I would greatly appreciate it. Here is the info about the programs.
...
LilKoopa wrote: Again I would appreciate if someone could start me on the right path to completing these programs
I suggest starting with problem 1 , then problem 2 , finally ending with problem 3 .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: I suggest starting with problem 1, then problem 2, finally ending with problem 3.
I second that - he'll also get extra points if there are chronology marks
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
LilKoopa wrote: Ok, I have to do 3 programs for school and I am completely lost on how to start either of them off. If somebody could help me I would greatly appreciate it.
Start by knowing that "either" is a choice made between two things, not three.
That aside, you should be able to at least get started on any one of these. While you may need help with some of the details, you can't be in a programming course and not know how to start a project (regardless of whether it is pretty or even produces the correct result).
I see that your question has been asked elsewhere. See here and here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I have inherited someone else's c++ code that I need to increase the QueryTimeout value for, and I have run into a snag. They defined the recordset using this syntax:
From the .h file:
class test : public CRecordset
{
public:
test(CDatabase* pDatabase = NULL);
DECLARE_DYNAMIC(test)
//{{AFX_FIELD(test, CRecordset)
...
//}}AFX_FIELD
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(test)
public:
virtual CString GetDefaultConnect(); // Default connection string
virtual CString GetDefaultSQL(); // Default SQL for Recordset
virtual void DoFieldExchange(CFieldExchange* pFX); // RFX support
//}}AFX_VIRTUAL
}
From the .cpp file:
IMPLEMENT_DYNAMIC(test, CRecordset)
test::test(CDatabase* pdb)
: CRecordset(pdb)
{
//{{AFX_FIELD_INIT(test)
...
//}}AFX_FIELD_INIT
m_nDefaultType = snapshot;
}
Eventually the query get's called using:
test m_test(NULL);
m_test.m_strFilter="Select Field1, Field2 from Table";
m_test.Open();
I've tried several methods to change the QueryTimeout value, all with no success. To make this work, I think I need to separate the indirect reference to CDatabase* pdb so that I can modify the settings for pdb. I've not been able to find any examples anywhere that discuss how this could be done differently without re-writing major portions of the program.
Can anyone please confirm if I'm on the right track, and if possible, what the code should look like to accomplish this?
Thanks,
SpT
|
|
|
|
|
Does this work?
CDatabase *pDatabase = new CDatabase();
pDatabase->SetQueryTimeout(30);
test m_test(pDatabase);
m_test.m_strFilter="Select Field1, Field2 from Table";
m_test.Open();
delete pDatabase;
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Well, that was simple enough. I was looking to change it for the whole structure. Guess I was over-complicating it. Thanks much!
|
|
|
|
|
How the hell did you figure that one out! Dude that is like a puzzle inside a box inside a trunk inside a shark inside a whale inside a theme park located on the internet that you can't find on Google because you can't figure out the keywords to use!
WTF! I give up, gonna eat my filet-o-fish.
led mike
|
|
|
|
|
|
Classic post above this one, BTW
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
He's in a school daze. Don't worry, he will probably graduate without knowing how to find his ass with two hands and a flashlight then get hired by my company.
led mike
|
|
|
|
|
Hello,
I was trying to connect to remote MS SQL 2005, I can connect to server with microsoft client application, but when i try to connect with source code in visual c++, it returns: named pipes provider: could not connect, i dont know why?
here is my connection string:
Driver={SQL Native Client};Server=TestServer;Database=test;Uid=xIB;Pwd=xIB;MARS_Connection=yes;
anybody has any idea to solve the problem?
thanks in advance
|
|
|
|
|
|
|
Hi,
I wanted to disable the root node in a tree control in MFC, have not been able to do so. Could anybody help?
Thanks,
Software Developer
Sanjay Khapre
|
|
|
|