|
have you tried to use the debugger (i mean, setting breakpoints and watch some variables to understand what's actually going on) ?
|
|
|
|
|
|
The most common cause of this type of error is an uninitialized pointer.
char *str;
strcpy(str, "Hello"); or
delete pointer;
DoSomething(pointer);
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
A good first step is to remove the /GZ[^] and /RTC[^] compiler switches from your debug build (temporarily).
Steve
|
|
|
|
|
Sometimes you see applications using controls that you would like to use in your own application . Is there a way to list the names of controls used by a compiled application ?
Thanks you in advance
|
|
|
|
|
If you could to read controls of an application how do you use them on your application?
|
|
|
|
|
aklougbo wrote:
Sometimes you see applications using controls that you would like to use in your own application
Use FindWindowEx and EnumChildWindows to enumerate the child window in Application.. for getting type of control you can call GetClassName api to retrieve it class!
|
|
|
|
|
Hello,
Is it necessary to give a range to a scrollable window?
If SetScrollRange is not given after after creating a window what are the implications?
Prithaa
|
|
|
|
|
have you read the doc and tried anything ?
|
|
|
|
|
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.
|
|
|
|