|
A module is a unit of related code. It is just an organizational term. For example, you may have an accounting module that supports balancing checkbooks, producing income statements, calculating interest and dividends, etc., that is all compiled into a library and used by the main application (which, presumably, would have something to do with accounting). Alternatively, that module could be built as part of the application itself.
The term "module" doesn't convey enough information to tell you how the application is organized, just that it is organized into compartments.
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
|
|
|
|
|
OK.
I am coding a program that has seprate dialog boxes that do something with budget, payroll, piecharts etc. There are no individual libirary made but the dialog boxes have their own classes. So can I call safely call budget, payroll as modules?
Fortitudine Vinsinues!
|
|
|
|
|
Technically, anything that is encapsulated and full-functional by itself (that is, doesn't rely on something else to fulfill its purpose) can be called a "module". In your case, it is better to call them classes (assuming that is what they are) since the term "class" is a specific type of module (that is, it conveys more information than just calling it a "module").
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
|
|
|
|
|
Module is probably one of the most frequently used terms in software development. This is a definition from Wiki:
"In computer science, a module is a software entity that groups a set of (typically cohesive) subprograms and data structures. Modules are units that can be compiled separately, which makes them reusable and allows multiple programmers to work on different modules simultaneously. Modules also promote modularity and encapsulation (i.e. information hiding), both of which can make complex programs easier to understand..."
Best,
Jun
|
|
|
|
|
TheinstruTara wrote: What exactly are modules?
One example would be Microsoft Office. The modules that comprise it are Word, Excel, Access, etc. You can add or remove the modules without affecting the others.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How are they made? How do I go about making them in vc++6. Is mfc enough?
Fortitudine Vinsinues!
|
|
|
|
|
As you see now, module is a pretty vague term. On Windows, they can be a library (Lib/DLL), COM component, executable, now assembly, etc.
TheinstruTara wrote: How do I go about making them in vc++6.
Approximately, if you have a peice of code that accomplish some well defined functionality and you want it to be reusable by other applications, you may build it into a module.
TheinstruTara wrote: Is mfc enough?
Yes. Many other tools/technologies are available as well, like Win32, ATL, etc.
Best,
Jun
|
|
|
|
|
Thank you.
Fortitudine Vinsinues!
|
|
|
|
|
TheinstruTara wrote: How do I go about making them in vc++6.
However you want.
TheinstruTara wrote: Is mfc enough?
Certainly.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello everybody, I come directly to the point. I want to make a simple game that starts with a DialogBox(using MFC probably?) and then the user can choose between windowed mode and fullscreen(graphics) mode so I could use the OpenGL libraries.The problem is that I can't figure out how to create the fullscreen mode after the user pushes the coresponding button.Do I have to use any API functions or MFC?
|
|
|
|
|
Getting the basics done won't be too hard, but handling some more complex actions will be (I'll explain that in a minute). To create a full-screen window, you will need to create a window type that grabs the whole screen instead of the client area. You can look at some of the screen saver examples on this site for that, or look at some of the OpenGL and/or DirectX examples all over the internet.
The tricky part is going to be handling things like Alt-Tab (which means a loss/restore of the screen device and all input devices).
Instead of showing the dialog, you could approach it the way that most games do these days and allow for a command line switch (if you use the DirectX helper classes, this is built in for you). I'm not sure if the OpenGL libraries give that to you for free, but I've seen a number of samples that allow for it, so at the very least, it wouldn't be too difficult to find a solution for it.
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
|
|
|
|
|
http://nehe.gamedev.net/[^] has some good tutorials. I think Lesson 2 shows how to toggle between windowed and full screen mode.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Unfortunatelly NeHe doesn't explain how to do that using MFC,only using windows API and its very difficult to create a dialog box by this way
|
|
|
|
|
nyquisttt wrote: I am new to managed c++.
So, why posting in the C++ forum ? Use the managed forum[^] instead.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
|
nyquisttt wrote: you are write sorry.
What does it mean?
Best,
Jun
|
|
|
|
|
That's a spelling mistake. I think he ment You are right. Sorry.
Fortitudine Vinsinues!
|
|
|
|
|
Hi All
working on a dialog based application, where the entire registry is scaneed for errors, For Registry using SDK functions ( RegOpenKey(), RegEnumKey( ) etc.)
Now what my problem is:
while scanning is going on ( there is a button "STOP" on the dialog)
if user press or click on the STOP button then the the scanning of Registry should be stopped and a messagebox should appear for resume or exit operation.
I think problem would be clear...
So please suggest me the scenario to implement this and better if provide some code snippet for the same.
Thanks
|
|
|
|
|
Start the scanning of the resgistry in a separate thread that runs an "infinite loop". This loop can be finished either when the scan is complete or when a variable is set to false. Something like that (pseudo-code):
while (bContinue)
{
if (LastKey == true)
bContinue = false;
}
This variable can be set through the main thread but you have to make it thread safe (for example use a critical section). If you are new to thread, I suggest you read some documentation about that because it can be difficult for a beginner.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
First, I would like to recommend instead a message box, two buttons "Pause" and "Stop" in your main dialog.
Perform the registry scanning in a worker thread. When press "Pause", call SuspendThread dunction in order to suspend registry scanning and change the button caption from "Pause" to "Resume". When the user press "Resume", call ResumeThread to start scanning again.
When the user press "Stop" you can call TerminateThread.
Ovidiu
Microsoft MVP - Visual C++
@to Cédric: Why "infinite loop"?
-- modified at 10:09 Friday 23rd June, 2006
|
|
|
|
|
ovidiucucu wrote: Why "infinite loop"?
I prefer using a loop that you can fully control instead of killing the thread with terminate thread. The reason is if you want to make some 'clean-up' after the loop (ok, maybe infinite loop was not the right word but I meant a loop that finishes when one of the condition is met).
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
You are double-right.
First when say "maybe infinite loop was not the right" because registry is a finite stuff and sooner or later its scanning have to finish, regardless the user pushes "Stop" or not.
Second, indeed for the sake of good recommendations we have to avoid TerminateThread, which in our case can let a registry key open for reading which can lead in unpredictable, catastrophic effects.
Ovidiu
Microsoft MVP
-- modified at 10:25 Friday 23rd June, 2006
|
|
|
|
|
Using SuspendThread() and TerminateThread() is very risky, and not nearly as simple as you've described here. Before a thread suspends itself, it needs to ensure that by being suspended, the calling thread is not affected. If a synchronization object is being held by the thread, it would need to be released. Suspending a thread from another, without taking all of the precautions, is not a good idea because the thread being suspended might be in the middle of something important (e.g., memory allocation). This could result in your application entering a "hung" state. If a thread calls TerminateThread() on itself, there is no chance for cleanup. The thread goes away right then and there.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
So, instead of SuspendThread/ResumeThread the right solution is...
Ovidiu
Microsoft MVP
|
|
|
|
|
I didn't indicate they couldn't be used. You have to be very careful when using them, however.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|