|
You guys are all familiar with SDI and MDI models of application design (ie Document View Architecture).
Im reading through Prosise (MFC) and came across this:
Alternatives to MDI
A workspace-based model that groups related documents in objects called worspaces and allows documents
contained in a workspace to be viewed and edited in MDI-like document frames that are children of a top
level frame window. Visual C++ is one example of an application that uses the workspace
containment model. I would be interested to know if anyone has had any success programming an application with a model similar
to this. I am interested in this model mainly because the application I am designing is going to need
"modular" documents. That is, a user is going to be able to add many different types of documents to their
workspace. The workspace object will need to be serialized so that it can be saved and loaded. Its a major
undertaking because there is also a document designer application that the user can use to generate active
documents that can be loaded into the workspace. These documents are just "views" of data objects that will
also have to be serialized along with a workspace.
In other words containment is
workspace
--> multiple data objects (dynamically added)
--> multiple documents (views) (dynamically added)
Has anyone seen or read any articles on this style? Seen any similar open source projects / examples? The
model has also been called the "floating Document Interface". Apparantly CodeWarrior uses it as a
stock programming model (along with MDI / SDI).
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
Has anyone even read this?
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
|
I have a loop that first gets a value of "PAGE" for the Cedit WindowText. Why doesnt it stop at
GetWindowText() the second time it comes around? I stepped through and after finding "PAGE" the first time, it sails through the lines in red on a second pass, and of course I never got a chance to change the CEdit entry, so the variable is still "PAGE", and an infinite for loop starts....
bool bExistingEntry;
do
{
<code> m_editAddNewKeyword.SetFocus();
m_editAddNewKeyword.GetWindowText(m_newKW);</code>
bExistingEntry = false;
for (int i = 0 ; i < m_numFields && !bExistingEntry ; i++)
if (bExistingEntry = (m_AddKWFldsHolder[i] == m_newKW))
{
AfxMessageBox("Keyword already exists in database. Add new Keyword or Cancel");
}
}
while (bExistingEntry);
Probably something goofy, but I cant see it....
Thanks,
ns
|
|
|
|
|
It does!! GetWindowText() just gets the text from the edit control into m_newKW . The proper way to validate input is in your dialog's OnOK() handler. Like so:
m_editAddNewKeyword.GetWindowText (m_newKW);
for (int i = 0 ; (i < m_numFields); i++) {
if (m_AddKWFldsHolder[i] == m_newKW) {
AfxMessageBox("Keyword already exists in database. Add new Keyword or Cancel");
return;
}
}
CDialog::OnOK();
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
How do I get my UI to pop up again after the messagebox is dismissed. I cant dismiss the messagebox, it keeps looping because I never get a chance to change the entry. I thought setfocus would do it, but it sails through that line I found...
|
|
|
|
|
See my edited reply. I figured I'd left out the essentials.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
thanks a bunch! I didnt think of that!
|
|
|
|
|
Here is the message from VC Debug tool ,Can somebody tell me What does it mean?
First-chance exception in DMSClient.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
SIMPLE IS BEAUTY
|
|
|
|
|
ZBUILDER wrote:
First-chance exception in DMSClient.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
What does it mean?
Some code in Kernel32.dll threw an exception.
That is the meaning of that line, and as you choose not to give more information about the context, it is about all one can say about it.
|
|
|
|
|
A first-change exception normally is not a problem: it's the debugger's opportunity to see an exception before it is being handled by an exception handler (or catch-block). If no exception is propagated to your code, that means the writer of the library has foreseen the possibility of this exception and written an appropriate catch-block.
So don't worry about it.
|
|
|
|
|
Thank you very much.See you later?
SIMPLE IS BEAUTY
|
|
|
|
|
I make a program in window 95, In this environment it runs. Now I have took it to windows Millenium but when i run, it gives me a error "Debug Assertion faif, file: barstat.cpp, line 266". I have made a packet but it does not run.
thank in advances.
|
|
|
|
|
Simply look in barstat.cpp at line 266. The expression within ASSERT() (or similar) at that line evaluates to false running under ME, not in Windows95.
Or even easier: open in MS VC++, place somewhere before barstat.cpp 266, and trace the value of the expression.
|
|
|
|
|
Hi,
This is really annoying me.
char *buffer;
GetData(&buffer);
the plan here is that the GetData function will allocate buffer:-
void GetData( char ** ppBuf)
{
*ppBuf = new char [length];
strcpy (*ppBuf,"other data");
}
this appears to work. In fact, back in the original code block:-
printf(buffer);
works correctly.
But when i try and delete the allocated memory in the original code block:-
delete [] buffer;
I get a nasty debug "damage after normal block" type error. Both the main block and the called function exist within the same thread. I've traced through step by step in the debugger, and the address of the block of memory that is allocated by the new keyword is definately the very same block of memory that i am trying to delete.
Why does this occur????
thanks,
Jon
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
Whats the value of length and does it include the \0 terminating character?
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Ahah. Roger, you are a top banana. Whereas I am an idiot.
thankyou for your help!
|
|
|
|
|
Does anyone knows where to find documentations (books or tutorials) about the way to work with the visual C++ environment ???
I mean :
- How to work with several sub-projects from different teams ?
- How to integrate and to work with external components such as DLLs without needs to copy files or header in my project ??
- How to use include/lib directories ???
- What is the detailled signification of the Project/Settings parameters ???
what I do not mean :
- How to use visual c++ to create dialog box or progress bars ... (and such things that is described in every VC++ books...)
Thanks,
Vince
|
|
|
|
|
Hi,
I have an automated Ms Word instance running on my application. What I want to do, it's: meanwhile the my program is refreshing the data on the Ms Word Instance, block the keyboard input for the user in My Ms Word Automated instance. Is that possible ?
The problem that I have, is if the user begins to type meanwhile the doc is being refreshed by my App, Word Crashes
Thanks in advance, Greetings
Braulio
|
|
|
|
|
Probably yes,
Just implement ::PreTranslateMessage in the main window class.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
Mmmmm....
But ::PreTranslateMessage, will only work for Handles of windows of the same App, ... and my word instance belongs to another process space, is that correct ?
|
|
|
|
|
I am trying to open a cdrom drive using CreateFile() (with Vwin32 vxd) for win98 platform but this gives me permission denied.
How can i read it
|
|
|
|
|
I'm trying to find an ATM based windows code sample.
Need to make a Client/Server application using an ATM protocol.
Have an Interphase SDH card with an ATM interface.
If someone can have me an input, please do.
Thanks in advance.
|
|
|
|
|
hi,
i've to reallocate a CString class member on runtime, i can't change the declaration in the parent class because it's a library but do it in the derived class.
The problem is that assigning to the CString a value the program exit with
HEAP[Sample1.exe]: Invalid Address specified to RtlFreeHeap( 5f0000, 5f4ccb08 ). Using .Empty() .ReleaseBuffer() and similar there's no errors, only assigning something.
It's a problem in the member allocation?
|
|
|
|
|
another thing, i use the debug version of the library with debug mode on.
|
|
|
|