|
prithaa wrote: f SetScrollRange is not given after after creating a window what are the implications?
The implication is that the system doesn't know how to draw the scrollbar or how far it should
allow the user to scroll it. This makes a scrollbar fairly useless.
Useualy scroll range settings change every time the associated window is resized.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
how to get keyboardkey value?
|
|
|
|
|
Can you be more specific key value
|
|
|
|
|
janpoo wrote:
how to get keyboardkey value?
GetAsyncKeyState()
|
|
|
|
|
How to set tab key value for buttons on dialog.
eg:
The dialog have 5 buttons.when i press tab key it will move around the buttons.how to do that. plz help me.
|
|
|
|
|
I'm not entirely sure what you mean. If you're just talking about being able to switch the focused button by using the Tab button; the operating system should handle that itself.
If you're making the window from a resource, make sure the button has "Tab Stop" checked. If you're making the window from from code, or on-the-fly I believe it's called, there may be a Style flag for "Tab Stop." "Tab Stop" is what tells the OS that the button (or other control) is a valid target to set focus to when the user cycles with the Tab key.
If you're talking about changing the order that they get focus in, in Visual C++ 6.0 I know you can hit Ctrl+D to do that. (in the resource editor)
|
|
|
|
|
when i press tab key ,nothing happen.onone button have a focus.i am crete a button with check on tabstop option.
|
|
|
|
|
If you have the buttons set up with the Tab Stop option, but pressing tab does not cycle the focus, it may be part of your code intercepting the Tab key's message. Do you have any pretranslatemessage functions that may be throwing off the key press messages?
|
|
|
|
|
i wrote the following in pretranslatemessage()
if(pMsg->message==WM_KEYDOWN)
{
if(pMsg->wParam==VK_RETURN)
pMsg->wParam=VK_TAB;
if(pMsg->wParam==VK_ESCAPE)
return false;
}
return CDialog::PreTranslateMessage(pMsg);
tab key is working but i cant view the changes.i used cxSkinbutton
|
|
|
|
|
I do not understand why you have your pretranslate message converting the VK_RETURN messages into VK_TAB, However, if that is necessary, you may have to do the same for WM_KEYUP
|
|
|
|
|
tab is working.am move to button using tab after i place tab on one button, and press enter key that show error what is a problem.
|
|
|
|
|
janpoo wrote: and press enter key that show error what is a problem.
And whats that ?
|
|
|
|
|
I made a simple programme and there is a single compilation error. i am new to inheritance technicalities so, plz anyone can interpret this error for me.
the orror is ->> cannot find default constructor to initialize base class 'baby' in function mybaby::mybaby(int,int).
i am also enclosing the code for your reference -->>
# include "iostream.h"
# include "conio.h"
class baby
{
private:
int weight,age;
char name[20];
public :
int standard;
baby(int age, int weight, int standard):age(age),weight(weight),standard(standard)
{ }
baby(int age, int weight):age(age),weight(weight)
{ }
void get_name()
{
cout<<"\n \n Enter the name of the baby -> ";
cin>>name;
}
void show_data()
{
cout<<"\n \n The name of the baby is -> "<<name;
cout<<"\n \n="" the="" age="" and="" weight="" of="" baby="" is="" -=""> "<<age<<" &="" "<<weight<<"="" respectively";
}
};
class="" mybaby="" :="" baby
{
private:
int="" mybaby_age,mybaby_weight;
char="" mybaby_name;
public:
mybaby(int="" mybaby_age,="" int="" mybaby_weight):mybaby_age(mybaby_age),mybaby_weight(mybaby_weight)
{="" }
void="" get_mybabyname()
{
cout<<"\n="" \n="" the="" name="" of="" my="" baby="" -=""> ";
cin>>mybaby_name;
}
void show_mybabyname()
{
cout<<"\n \n The name of my baby is -> "<<mybaby_name;
cout<<"\n \n="" the="" standard="" of="" my="" baby="" is="" -=""> "<
|
|
|
|
|
I may be wrong, but I would interpret the problem as a lack of default constructor in the class Baby.
You should make a function in Baby that's just Baby() without any parameters.
I believe when you make a new class, like MyBaby, that is based off another class, Baby, that it needs the base class, Baby, to have a default constructor.
This is because when you construct MyBaby, it will inherit all of Baby, and initialize using Baby().
-----
Your code is hard to follow, because I don't quite get what you're trying to do. When you initialize mybaby obj0(7,25); the variable standard is not initialized anywhere in the code. this would make obj0.show_mybabyname(); to print out garbage for "The standard of my baby is -> "
-----
also note the char mybaby_name; is not initialized as an array, and will not store a name.
I think you fail to see the usefulness in inheritance, as you have mybaby_age and mybaby_weight. When you declare a mybaby object, you can use age and weight that is inherited from the baby class to store the same values.
|
|
|
|
|
Firstly, you're using private inheritance (the default for class es); you probably intended this:
class mybaby : public baby
Secondly, the class baby has no default constructor (a constructor that can be called with no arguments). To fix this the derived class needs to explicitly call a constructor, like this:
mybaby(int mybaby_age, int mybaby_weight)
: baby(mybaby_age, mybaby_weight)
{}
Thirdly why has the class mybaby got the members mybaby_age , mybaby_weight and mybaby_name when the members weight , age and name will be inherited from the base and look like they serve the same purpose?
There are other problems but this should point you in the right direction.
Steve
|
|
|
|
|
for the second time :
please respect the forum posting guildelines[^] and use the appropriate <pre></pre> tags when posting code samples.
moreover, a huge piece of code is generaly useless if you sink the lines that really matter into a ocean of code lines that don't bring much infos to the problem.
|
|
|
|
|
i posted the code along with the problem so that someone trying to figure out the problem may understand the issue clearly by running or analysing the code himself/herself over his/her machine.
and regarding the
, i'll take care of that next time i post anything like a code.
|
|
|
|
|
I program on occasion as a past time. I'm very familiar with Visual C++ 6.0 and all my apps are made on it. Soon I will be upgrading to Vista and I am worried about compatibility. Vista says it is not supporting any C++ before 2005. I know I won't be able to take advantage of any new Vista API if I continue using Visual C++ 6.0, my question is will it run at all?
Basically, if I do get Vista installed, can I use Visual C++ 6.0 and still make applications using the XP/98 API that I've been using. Or has Microsoft basically forced an upgrade?
Thanks
|
|
|
|
|
x87Bliss wrote: Basically, if I do get Vista installed, can I use Visual C++ 6.0 and still make applications using the XP/98 API that I've been using.
Yes. You can use VC6 on Vista.
x87Bliss wrote: Or has Microsoft basically forced an upgrade?
VC 6 is no longer supported, so its other way to ask for upgrade.
|
|
|
|
|
VC6 runs fine on Vista, just make sure you install SP6.
|
|
|
|
|
Thanks for both of your responses
|
|
|
|
|
Hi
after freeing a pointer using free() is it required to set it to NULL ?
thanks
|
|
|
|
|
You should set it to NULL, freeing it doesn't do that for you.
-Sean
|
|
|
|
|
No, setting it to NULL is not required. Many people do it because it can help track down dangling pointer problems.
Steve
|
|
|
|
|
Its is not required, but its good practice to set pointer to NULL after deleting.
|
|
|
|