|
David Chamberlain wrote:
While I don't understand your ... fascination ... with MFC, this seems to me to be a classic case of "paralysis by analysis." You can't learn MFC by using it? What's up with that? With MFC being a toolkit for implementation, you still have a lot of design work to do. Remember the old addage about design being what you're going to do and implementation being how you're going to do it. You seem to be stuck on MFC, which is much further down the road from where you are now.
I want to be able to use MFC's functions for time, multithreading, and event handling. And later, its display functions. I dont even quite know what they are or how they work, but they look good on msdn. I know I can do all three of these in normal c++, but eventually I want this application to leave the console world, and have a relatively easy user interface. I dont want to sit and convert my application down the line (which people have told me can be a troublesome task). Some people have advised me to just add the mfc functionality I need to my existing application. The problem is, I'm not quite clear how to do that either. Everytime I try to include some mfc header files and define some mfc variables, I get massive errors.
You mentioned UML diagramming, and quite frankly I know nothing about what it is or how to use it. Right now I have a whiteboard filled with boxes, lines and arrows. What exactly is it, and how can I get started?
One of my professors is going to let me borrow an intro to mfc book. Hopefully that will be enough.
David Chamberlain wrote:
Go get a book, almost any book, on MFC. Start reading, start absorbing. But don't let that hold you up on the design.
Oh I cant seem to pull myself away from this program. I dont think it'll hold me up on design, it'll probably just help me identify what specific functions are needed to do what I want to do in my design. I shouldn't have said the project is on hiatus for me to learn mfc, I meant to say actual coding is on hiatus. Design is going on constantly. Design is the best part of the application development process, because everything works the way its supposed to on paper or in your brain. There are no unresolved externals in the design stage.
|
|
|
|
|
Okay, so you are further along than I thought. Sure, the MFC book will help and by seeing what functions are available and what they do, you can try to piece them into your code. I suggest that it might be easier to start a brand new project with MFC and a doc/view GUI included, and then patch your existing code into that, rather than trying to add MFC to your existing code. You said you had problems with that approach, so the other might work better.
As far as UML, I assume you've heard of Google? I tried a search on "UML tutorial" and found quite a few good sites. (Here's one: http://www.togethersoft.com/services/practical_guides/umlonlinecourse/[^]). Check it out and see if it would help you. You don't have to document everything. At first, just stick to the big picture items or to the complicated areas where you think you need some additional analysis or review. You can create quite useful diagrams using Visio and then past them into a document with extra descriptive text. It's the beginnings of an electronic document for the project, but the purpose is to help you out as the developer and not to provide every single detail to someone who doesn't really care.
You might try to Google on "MFC tutorial" and that will give you a different view than what msdn provides.
Good luck,
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
Thanks for the information, I've got a lot of reading and planning to do.
|
|
|
|
|
David Chamberlain wrote:
With operator input being required in certain modes, you could also use this as a training aid and help operators learn what happens when they screw up the schedule, or how to maximize customer throughput.
That is the long term end goal of this program. Operators can see what effect not paying attention, waiting that extra second, double checking the restraint, or just chatting with a child can have on riders per hour. Of course the ultimate goal is not perfect efficiency, as safety would likely be compromised. Every operator is different, and is more or less confident than another, therefore some operators may need more time to be sure that a vehicle is safe to advance.
The program should not be used to make rides less safe, that is quite counterproductive. It should be used to identify and track variances in operational efficiency.
It would also aid in optimizing an existing system. Vehicle load times and group times would be added to the simulation, so one could say something similar to "For every one second the dispatch position has to wait for the vehicle loader to finish loading, we lose x riders per hour."
The program would also aid the supervisors in deciding how many vehicles should be on the track. For example, in one ride at a southern california theme park, statistics have shown that riders per hour increases until vehicles on track equals 14. When 15 vehicles are in operation on the track, it depends on the efficiency of the operators in the station whether rph will increase over the amounts for 14 vehicles or actually decrease. 14 vehicles with a slow station is more efficient than 15 vehicles and a slow station. Such a pattern is not obvious unless one has a model (what I want to create) readily available, or a great deal of hourly statistics (which we had in that study).
|
|
|
|
|
hi,
How can i programmatically close a document open using CDocManager::OpenDocumentFile or the file->open command in an MFC MDI application? Please shed some light. Thanks
What happened in the program is I call CDocManager::OpenDocumentFile at a specific time in a day, how do I close a document at a specific time?
|
|
|
|
|
If it's an SDI application, you'll never have more than one document open at a time anyway, so a File/Open operation will close the current document before opening a new one. If it's an MDI application, this sounds a bit counterintuitive to me.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
It is an MDI application, my program has to open a document file automatically at a specific time and close it at a specific time too. Thanks.
|
|
|
|
|
You can use the following code snippet to close the active document. Since you are wanting to close a specific document, you'll need to provide a way of finding it.
CMDIFrameWnd *pWnd;
pWnd = (CMDIFrameWnd *) GetMainWnd();
if (NULL != pWnd)
pWnd->MDIGetActive()->DestroyWindow();
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Iwant to read some data from gif file. Dont know how to go about it. Can anyone help.
Thanks
|
|
|
|
|
According to what you want to do, one option could be to use OleLoadPicture and the IPicture interface. Have a look to the sample 218972[^] from MSDN.
HTH,
K.
New, what do you own the world?
How do you own disorder?
|
|
|
|
|
i would like to set my USB memory stick as a removable media so that it can autorun. does anyone know how to achieve this thru vc++?
can it be done?
if not, how about getting windows to look for the specific USB serial number and 'force' it to autorun?
thanx in advance
m
|
|
|
|
|
Is there anyone know how to do coding which can register an application to Microsoft Sti. From microsoft web site i found this command "IStillImage::GetSTILaunchInformation " but don't know how to apply it. Even I read thru the article but still cannot make it.
I will be happy if source is given.
Thank You
|
|
|
|
|
I like to write lines of code that are very short and very simple to understand. Is there a way that I can communicate this in a shorter more compact form?
CEdit *idcinput = (CEdit *) GetDlgItem(IDC_INPUT);
char cinput[255];
idcinput->GetWindowText(cinput, 255);
CString sinput = cinput;
Thank you,
Eric Sepich
|
|
|
|
|
don't use C string when using MFC.
replace with
CEdit *idcinput = (CEdit *) GetDlgItem(IDC_INPUT);
CString sinput;
idcinput->GetWindowText(sinput );
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
esepich wrote:
I like to write lines of code that are very short and very simple to understand
If you made the edit control a member variable, then your code could be accomplished with:
CString sinput;<br />
m_EditCtrl.GetWindowText(&sinput);
|
|
|
|
|
Or declare a CString member variable of the IDC_INPUT in ClassWizard
and call
UpdateData(TRUE);
m_strYourdata; //your data already being updated and m_strYourdata is ready to be used.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
CString sData;
GetDlgItemText( IDC_INPUT, sData );
|
|
|
|
|
I'm about to attempt to write my own parser/compiler which would have to translate a certain language into specific machine codes or whatever. The thing is though i don't have any experience on this, but i'd just like to learn how to write parser code already. Like.. something that can check syntax and keywords and all that, but i would just make a mess, so if anyone can point me to a tutorial or example where they show how to do this in a structured way i'd very much appreciate it
thx
Kuniva
--------------------------------------------
|
|
|
|
|
Ah, this is brings back fond memories... One of my MS theses (circa 1984) was a virtual computer that included a parser for a (very simple) high level language. The compiler generated assembly language code which was run thru the virtual machine's interpreter.
Anyway, to answer your question, here are the basic steps you'd need to take:
- Define the grammar for your language
- Write a lexical analyzer that spits out language tokens
- Write a parser that creates a parse tree from a stream of tokens
- Write a code generator that translates a parse tree into machine instructions
- Optional: write an optimizer to optimize the machine instructions
I strongly recommend looking at a decent book on the subject. I used the Dragon Book[^] eons ago.
Writing a compiler is a labor of love and imho, a necessary part of learning and appreciating Computer Science. (Learning assembly language is like learning geometry - we do it because it teaches us how to think).
Good luck and have fun!
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
I used the Dragon Book[^] eons ago
Aaah! the Dragon Book does bring back memories !!!
This[^] might also be useful...
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
Are you taking a class on compiler construction at a college?
Check out these books on compiler construction.
The Dragon Book by Aho
Crafting a Compiler by Fisher and LaBlance
Kuphryn
|
|
|
|
|
Nope not yet, it's only my first year, we are learning Oberon now but.. blech :P
Kuniva
--------------------------------------------
|
|
|
|
|
|
|
I quite like Modern Compiler Design[^].
Most courses and texts cover simple parsing algorithms such as LL(1), LL(k) and LALR(1). These algorithms are powerful, but you really have to structure your grammar carefully to make them work - you tend to have to compromise your language, designing it around the parsing algorithm.
Famously, Bjarne Stroustrup did not do this, with the end result that C++ cannot be parsed by an LALR(1) algorithm (you must typically feed back into the lexer).
Generalised LR parsing algorithms are beginning to perform nearly as well as LALR parsers generated by yacc or bison . If you just want to parse your language and be done with it, consider the Elkhound[^] parser generator.
|
|
|
|