For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
What I need is
sort of " multidimensional array of single variable and variable length array ".
The main array is defined / assigned (?) and of "fixed length" - three in example - for now.
Of course I need to access all using pointer.
How do I accomplish this ?
PS I did try std:array , but it conflicts with "boost" - can't do for now.
I am writing an article on best practices and in this article I am trying to formulate an hypothesis for which public functions eventually lead to most of the code design issues. It's not public functions per se, but more about inter-objects communication (messaging).
Established that encapsulation works fine for data abstract types, how would you define the situation in which stateful objects with well defined behaviours, do not have control on their states? Let's say in the best case scenarios, I have a well defined object with well defined behaviours, like Walk() and Run() but doesn't have control on when it walks and when it runs. Other objects will control when this object walks or runs. Let's now say that this object is used in a spaghetti codebase, where the reference to this object is injected indiscriminately. The object could potentially find itself walking or running at the wrong times. What I am trying to say is that encapsulation ensures the validity of the states, but cannot determine if the states are set at the right time.
How would you define this problem? I know how to solve it, I am just trying to understand if encapsulation is involved at all in this problem. Without public functions this problem wouldn't exist in the first place, but is the possibility of settings states at the wrong time a form of broken encapsulation?
Now take care Object-oriented Reactive Programming is not Reactive Object-oriented Programming there is a big difference between those two you need to decide which you are doing and the difference between them.
The Observer pattern addresses the following problems:
- A one-to-many dependency between objects should be defined without making the objects tightly coupled.
- It should be ensured that when one object changes state an open-ended number of dependent objects are updated automatically.
- It should be possible that one object can notify an open-ended number of other objects.
Now in programmer jargon speak we call observer pattern programming as "Omnipotent god programming" because there will exist an object or function that observes and controls everything. It is often used in games programming but it is not well suited to real world situations where you can't encapsulate all options and you need to "think" about what is going on.
As an example DNS attacks on websites work because they break the observer pattern of the internet standards .. to deal with the attack you need to know past history and apply some logic
Computer languages encapsulate precise physical concepts, english language encapsulates wide range communication.
It is never the language describing a problem that is the issue it is describing the process in terms of a physical concept the CPU can execute as code blocks.
For perspective you could write a book claiming all you need is a screwdriver, spanner and hammer as tools and you can fix anything. Whilst you can probably tackle a vast range of repairs there are jobs that require highly specialized tools that you simply couldn't do. Plain English Programming falls into the same fallacy you conceive situations it might work but you have to close your eyes to the situations it clearly won't.
I suspect the only way to really go after a real concept of english language programming would be via AI and if you went that path specific jargon would be less verbose, clearer and not prone to stupid English language nuances. Take any scientific field the first thing we generally have to do is butcher English into a series of defined jargon and acronyms so we can all agree on what is being said. Read any science journal or book and it isn't english a layman would recognize you need to know what all the jargon and acronyms mean. So I put the chances of any serious programming in english language at close to zero because we can't even do it with science.
I have MDI MFC application. For a particular child window, i want to split in to two. Already i have toolbar for topview by using OnCreate() in ChildFrame.cpp. I want to add toolbar for bottom view also.
ChildFrame OnCreateClient() code:
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
// TODO: Add your specialized code here and/or call the base classif(iWindowNumber == 4)
if (!m_wndSplitter.CreateStatic(this, 2, 1))
if(!m_wndSplitter.CreateView(0,0, RUNTIME_CLASS(CTrendView),CSize(cr.Width(), cr.Height()-200),pContext)||
!m_wndSplitter.CreateView(1,0, RUNTIME_CLASS(CTrendListView),CSize(cr.Width(), cr.Height()-550),pContext))
//m_wndSplitter.SetActivePane(1, 0);return TRUE;
return CMDIChildWnd::OnCreateClient(lpcs, pContext);
In OnCreate(), im loading toolbar, but it adds only for TopView. I want to add different toolbar for bootmView. Can we add toolbar using CView::OnCreate()? i tried this but it is not happening.
Otherwise i have to create 3 splitter window, middle winodw will have toolbar buttons that can be added using CMiddleView::OnCreate().
How can i get that?
I saw that one show CFrameWnd. My window is CMDIChildWnd. So i didnt try first. I tried now. i create CSPlitFrame as CFrameWnd and i coded like below. But when i want my particular window , it shows error on calling that view in Mainframe.cpp.