|
Mr.Brainley wrote: The explanation is written here
Thanks for that lovely article.
Actually what's written in the books are the very basics that could go wrong (Just like this one ditched me) when you grow up in this world.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Mr.Brainley wrote: Does anyone know of a certain problem that requires a non OO-workaround in C++ ?
main()
|
|
|
|
|
See, that's my problem. Too often I don't see the obvious ...
|
|
|
|
|
why should this be a problem ??
codito ergo sum
|
|
|
|
|
main() isn't the member of a class, it's a global function, which doesn't fit with the OO paradigm
|
|
|
|
|
you can easely change the entry point of a program through the compiler option /ENTRY:function. See help[^]
How to do this:
class MyApplication
{
int __stdcall Run(int argc, _TCHAR* argv[]);
};
int __stdcall MyApplication::Run(int argc, _TCHAR* argv[])
{
return 0;
} Then change the entry point in the property settings of the project from blank (default) to MyApplication::Run. This way the program only excist out of one class embedding the entry point.
codito ergo sum
|
|
|
|
|
Mr.Brainley wrote: I believe, that one can write 100% OO in C++, but i really can't proof that.
You can write pure OO code in C++, but why would you want to? OOD/OOP is overkill (and actually doesn't fit well) for many things, which is why generic programming is also a strong feature in C++.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
C++ is a blend of OO, functional, and generic programming. It is basically a catch-all language that you can do anything with.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
anilFirst wrote: Is C++ is 100% OOP language?
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
The notion of 'object oriented' is a moving target.
Here[^] is an interesting little article that discusses the different views held by some languages that support 'object oriented' programming.
The article is a response to an essay by Paul Graham[^]. His essays make good reading and while you're at it, browse his site. I think most people will find it interesting -- whether you agree with his views or not. His writing can be thought provoking, or at very least provocative.
Later,
Dan
Be clear about the difference between your role as a programmer and as a tester. The tester in you must be suspicious, uncompromising, hostile, and compulsively obsessed with destroying, utterly destroying, the programmer's software.
------------
Boris Beizer
|
|
|
|
|
C++ supports multiple programming padigrams; Object Oriented programming is just one of the supported padigrams. Others include generic programming. What do you mean by "100% Object Oriented"? It provides support for most OO concepts but does not force you to use them.
Steve
|
|
|
|
|
Hi,
I have created a modal dialogbox and attached a button and named it as Save.
Whenever I clicked on it I want to display another dialogbox with a combo box attached to it.Whenever I clicked on OK button I need to get the data in the first Dialog box.
void CDialogClass1:OnSave()
{
CDialog2 dlg2;
dlg2.DoModal();//I attached a combo box to it.
}
Please can u help me.
Thanks in advance.
|
|
|
|
|
U can pass parameter from First Dialog to second dialg
1 ) through constructor
2) Via member variable
( CDialog2 dlg2;
dlg2.m_Var = m_Var_one
dlg2.DoModal();//I attached a combo box to it.
3) Keep a global variable and share value in two dialog
|
|
|
|
|
I am very sorry.I can't understand what u said.
I need not want to send data from first dialogbox to the second dialogbox which contains the combobox.
I want from the data from second dialog's combobox.
Thanks for u r effort.
|
|
|
|
|
IF you want the data from the second dialog box in the first one:
you can do this:
if(dlg2.DoModal()==IDOK)
{
dlg2.m_myCombo.// Some function to retrieve data from combo box
}
-- modified at 9:03 Tuesday 26th September, 2006
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: dlg2.m_myCombo.// Some function to retrieve data from combo box
Not possible, as the combobox no longer exists.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
vc++_fragrance wrote: display another dialogbox with a combo box attached to it.Whenever I clicked on OK button I need to get the data in the first Dialog box.
There are two ways to this in my knowledge:
1) If it's a base/derived relationship you can use GetParent() to get a pointer of the parent class in the derived class and then use it to access the member functions of the parent class and also the member variables depending on their access modifiers.
2) You can create a pointer of the first class(From where you are calling DoModal()) into the second class where you need the contents of the first dialog.
For this:
a) Include the header file of the first dialog in the second.
b) In the public section declare a pointer of the first class.
Like: CMyFirstClass *pFirstClass;
c) Just above the line dlg2.DoModal() you can write dlg2.pFirstClass=this;
d) Now you can access the variables/members/member functions of the first dialog in the second dialog using pFirstClass.
Like: pFirstClass->m_strEdit.GetWindowText(...);
etc....
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
if your main class is CMainDlg you can use CMainDlg* m_Main=(CMainDlg*)GetParent(); m_Main->YouCombo();
|
|
|
|
|
How to split the window in following way?
1st row should be divided in 2 columns.
2nd row should be in single column.
|
|
|
|
|
by using CSplitter. If not using MFC then you will have to create your own splitter controls.
|
|
|
|
|
I have used that technique, but whenever i split window in that way it gives some exception.
|
|
|
|
|
First create a splitter window with two rows (panes). In the top pane, create another splitter window with two columns (panes). If you are using MFC, check out CSplitterWnd .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I have used the same technique, but it gives some exception.
|
|
|
|
|
What exception is thrown? I assume you've stepped through your code using the debugger. What has it revealed?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|