|
If you've written a constructor with parameters, it is not called default constructor.
Default constructor is one with no parameters.
The object you're creating from the class probably needs a default constructor.
|
|
|
|
|
A default constructor is one provided by the compiler -- if you write one that takes no parameters it's not a default constructor.
Edit: Oh, I see, I wound up in the C++ forum somehow...
In C#, "default constructor" actually means something more than "parameterless constructor":
"
10.10.4 Default constructors
If a class contains no instance constructor declarations, a default instance constructor is automatically provided.
"
modified on Tuesday, April 27, 2010 6:00 PM
|
|
|
|
|
The C++ standard defines that "a default constructor is a constructor that can be called without arguments". (ISO/IEC 14882)
|
|
|
|
|
You are wrong. The default constructor is the constructor without arguments. Incidentally, if you don't write any constructor for your class then the compiler provides the default constructor for you.
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]
|
|
|
|
|
Austrian_Programmer wrote: I do not call the default constructor, but my self written one, also the parameter lists match.
Since you've written one constructor the compiler provide no more the default one (that is sometimes required). Probably you should write the default constructor for your class (i.e. please report the exact error message and the offending line content).
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]
|
|
|
|
|
The other side of the story is that, you can prevent a constructor being called (implicitly or explicitly) other than what you have provided.
|
|
|
|
|
I wrote a default constructor (empty and parameterless) and now it works. However, I do not know why; the default constructor is never called.
By the way, I know that a default constructor is not any self written one^^
|
|
|
|
|
If you can provide a sample code, it will help to understand the problem well.
Hope, your problem might be like the following one.
class CTest
{
public:
CTest( int a ) // since there is a constructor, the compiler won't generate
// the default (no-argument) constructor.
{
}
};
int main()
{
CTest Object; // Here, we are trying to invoke the no-argument constructor.
// So the error C2512 comes.
// To solve the problem, define a no-artument constructor.
// CTest Object( 1 ); Otherwise, you should declare the object like this.
return 0;
}
|
|
|
|
|
We need a custom button or custom graphic to be able to have multiple select points. We have looked at Button Objx and other tools but no luck yet. Eg. have a vehicle button or graphic and based on selection, eg. doors, hood, wheels, etc. go to different events or mark selections. We would need an outline front/back of a human body as well. Also, would need graphic/button to be able to be resized based on resolution.
Any ideas of what we can do.
thank you
CLAY
|
|
|
|
|
Kyle P wrote: We need a custom button or custom graphic to be able to have multiple select points...Any ideas of what we can do.
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
What i would do:
- Create a bitmap of a car.
- define rectangles where the user may click on. Save those rectangles (origins and sizes) in an array or file
- run the program and measure its screen-size
- calculate the difference in size of the screen and the bitmap in a ratio
- read in the bitmap and put it on screen. Stretch it when needed (use StretchBlt() ?)
- read in the rectangles
- When stretched multiply all coords of the rectangles with the ratio.
- program the actions
- Monitor the mouse up messages: when the mouse is in one of the rectangles, invoke the corresponding action.
ready...
If you still have time over:
- take the bitmap and cut out every rectangle, colorize it a bit and save it as a new bitmap. Now every rectangle has a (sub)bitmap that can be displayed while the mouse hoovers over the rectangle (you'll need to monitor mouse moves also) ..
Rozis
modified on Wednesday, April 28, 2010 8:38 PM
|
|
|
|
|
Is there any approach to write unit test cases for GUI based applications (VC++ applications).
It's my client's requirement to write test cases for it.
|
|
|
|
|
If necessary to test the GUI, I would rather use QTP or some kind of automation software to test my GUI.
If you seperate your business/data logic from the presentation layer, you should be able to write unit test against the business/data layer.
For GUI testing, you can take a look at Fitnesse[^]. I haven't tried it, but have seen some demos and heard it could really work for GUI applications.
|
|
|
|
|
How do I disable resizing through WM_SIZE Message? Thanks.
|
|
|
|
|
Either remove the resizing borders, or handle the message and return 0 .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
How can i get List view Column header name
is there any macro avaliable
|
|
|
|
|
|
thanks code-o-mat
but still its giving me some head ache
when i drag drop my column.. i m not able to get the column names as per the current arrangement....
|
|
|
|
|
Elaborate that a bit, please, i!m not sure what you mean...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
actually i have three columns in my list view
column1 column2 column3
when i drag the first column(column1) to second column(column2)
second coloum will be in first columns position and first columns position .
position will get changed to below format
column2 column1 column3
so when i get the column details using
TCHAR szBuf[256];
LVCOLUMN column;
column.mask = LVCF_TEXT;
column.pszText = szBuf;
column.cchTextMax = sizeof(szBuf) / sizeof(TCHAR);
for(int i=0;i<g_ncColumns;i++)
{
ListView_GetColumn(GetDlgItem(hDlg,LV_NOTATIONS), i, &column);
at the first run of for loop i m expecting the szBuf as column2
but its stil giving as column1
|
|
|
|
|
Could CListCtrl::GetColumnOrderArray[^] help?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hiho
I would like to increase the size of the window showing the month, that appears if you click on the dropdown-icon. The problem is, I don't have a clue how to do that, because it is drag and drop from the tools. I would be happy about any sugestions.
Thx
Jan
|
|
|
|
|
Xerantes wrote: I would like to increase the size of the window...
At design time or run time?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Good Question. At Design would be sufficient for me.
|
|
|
|