|
Sir,
I am student of Punjab University College of Information Technology, Lahore, Pakistan
I have problem while using Borland C++ v3.1.
Problem:
=========
The size of an object in virtual inheritance increases 2 bytes
Class base
{
public:
int b;
base()
{}
virtual void f() {}
virtual void g() {}
};
Class derive : virtual public base
{
public:
int d;
derive()
{}
virtual void f() {}
virtual void g() {}
};
----------------------
derive d;
cout<<sizeof(d); gives="" 12="" why?
="" *
but="" when="" i="" don’t="" give="" constructor="" in="" derive="" class="" then="" the="" size="" of="" object="" is="" 10,="" because="" there="" will="" be="" no="" 2="" bytes="" extra="" layout.="" please="" help="" me="" out="" about="" finding="" myth="" these="" two="" bytes.
<b="">The object layout in figure is in following URL
OBJECT LAYOUT FIGURE
*/
The object layout where that extra 2 bytes are laid is drawn in atttchment with v-table layout.
Please contact me at!
informfarid@yahoo.com
|
|
|
|
|
mfareed_baig wrote:
The object layout in figure is in following URL
OBJECT LAYOUT FIGURE
I think you better re-check this hyperlink. It is incorrect.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
In a typical SDI project, what should "file save" do in the main frame. What should be saved? I have project that when debug run is started up the GUI title bar indicates: Untitled - Project 1. I never understood why I was getting the Untitled part. Its like it thinks you are opening a file.
Thanks.
Jerry
|
|
|
|
|
jerry1211a wrote:
I have project that when debug run is started up the GUI title bar indicates: Untitled - Project 1. I never understood why I was getting the Untitled part. Its like it thinks you are opening a file.
If you do not like this behavior, override the frame's PreCreateWindow() method with:
cs.style &= ~FWS_ADDTOTITLE;
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hello,
I am writing an application that will provide the feature of "taking" a pixel color from any other window, currently displayed. When the user right clicks with the mouse on the desktop, taskbar, or the system tray for example, the color (RGB) of the pixel he has clicked on must be obtained.
Do you have any idea how this functionality could be implemented?
The real question is how could I obtain another window's DC (from which I could get the pixel), and the mouse coordinates when the user presses the right button on another window...
Thank you in advance.
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
|
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
?
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
Vladimir Georgiev wrote:
?
What is your question? The provided link looks just like what you are after.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
My "?" was for the Greeeg's smiley. I did not understand what he meant about that.
But anyway, I agree that the link provided gives me the right clues for solving my problem, for which I thank Maximilien
I am sorry for the misunderstanding...
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
Vladimir Georgiev wrote:
My "?" was for the Greeeg's smiley. I did not understand what he meant about that.
It was just Greeeg's way of providing a hyperlink. He used an image tag instead of an anchor tag.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
How do I add an achor tag ?
How do I write a [code] section,
which appears in light yellow if I remember well
Is there a link that explains all of these things and others ?
Thanks !
|
|
|
|
|
When replying to a post, check out the formatting (and smiley) options below the text box.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thank you,
I am realizing now that with Mozilla browser only the smileys appears, not the others.
|
|
|
|
|
No matter. You can insert <A>, < PRE>, and <CODE> tags manually.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Click on the smiling icon !
http://www.codeproject.com/gdi/screencolorpicker.asp
The Code Project - Screen Color Picker - Fonts & GDI
|
|
|
|
|
Hi Guys,
Iam writing an MFC application with a dialog having a listbox control.
In the view header class,have the ListBox object as a member variable.
CListBox m_ListBox;
The questions I have are:
[1]How will I create a Listbox control
used the "m_ListBox.Create"- How will I pass the cDialog class as I have to pass a "pParentWnd parameter" which expects a CWindow object
[2]How to make the listbox control,Dialog & view class of the same size.
[3] Want to add 2 columns in the list box,a header row, with constant values.
1st column 2nd column
************* ***********
FixedLineNumber; 5
StartLineNumber; 10
NumberOfLines; 4
FixedLength; 15
CharacterLength; 10
CharacterOffset; 5
and fill the 2 columns with values as above.
the first column contain constant texts & the second coumn,I want to fill with values...
Any help is appreciated....
|
|
|
|
|
Pazzuzu wrote:
[1]How will I create a Listbox control
used the "m_ListBox.Create"- How will I pass the cDialog class as I have to pass a "pParentWnd parameter" which expects a CWindow object
All MFC windows (including CDialog objects) derive from CWnd. Just cast it to CWnd in the create function
Pazzuzu wrote:
[2]How to make the listbox control,Dialog & view class of the same size
What do you mean? like as in the same size on the screen?
Pazzuzu wrote:
[3] Want to add 2 columns in the list box,a header row, with constant values
You are using the wrong control. Use a CListView control rather.
Cheers,
Peter
controlSHIFT
[Glossary Manager] [AfterThought Backup Lite]
All good things were meant to be improved
|
|
|
|
|
Okay Thanks,
Could u please tell me how to achieve the above said things using the
CListView control.
By [2],I mean to make the listview control to the size of the dialog,while displaying & not to the size of the view.
|
|
|
|
|
Okay Thanks,
Could u please tell me how to achieve the above said things using the
CListView control.
By [2],I mean to make the listview control to the size of the dialog,while displaying & not to the size of the view.
By ListView control,did u mean list control co's,while in the control tool box,I see only list contol & listbox control
|
|
|
|
|
It is CListCtrl.
You can use these functions of the class
eg:
To add columns
m_ListCtrl.InsertColumn(1,"1st Column");
To add data to the control
m_ListCtrl.InsertItem(0,"Data");
m_ListCtrl.SetItemText(0,1,"Value");
|
|
|
|
|
How will I connect my view class which is derived from Cview to the control object,Co's I want to test the list control
Did as follows:
On the,"OnCreate" function of my view class,I did as follows
m_lstctrl.Create(WS_CHILD|WS_VISIBLE|LBS_STANDARD|WS_HSCROLL,
CRect(10,10,200,200),this, IDC_TEST);
m_lstctrl.InsertColumn(1,"1st Column");
But I dont see any columns ,apart from the listctrl box boundary...
|
|
|
|
|
Replace LBS_STANDARD by LVS_REPORT.
|
|
|
|
|
Thanks Dreamz.Now I see the control on screen.
But the size is small.
How can I set the size of the ctrl in code..
Thanks all......
|
|
|
|
|
Pazzuzu wrote:
How can I set the size of the ctrl in code..
Check out the second parameter to Create() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|