|
when I execute my simple program that I have implmented
serialization with.
scenario:
I go about drawing a few shapes, which are added to my element list,
and then save the file, which it successfuly does
but a problem occurs when I select "new" or "open file":
The previous content is still shown on 'new' and also with a
the opened file:
So I have then added code to the mfc-document "onNewDocument()"
to delete all the elements in the list.
And I have also added the code to remove all the elements
as well to the virtual function I have added "OpenDocument" which also works fine.
My only problem know is, if I save a document,
and then do some extra drwaing, and then try to reload the
the last save, the current drawing I am doing, remains, and the saved document remains unseen.
Can anybody know why this implkmentation is not working,
my understanding that mfc serialzation automatcaly takes care
of these automatically
Thanks V much if you can help
Simon
|
|
|
|
|
simon alec smith wrote: element list
Display the declaration for this.
simon alec smith wrote: mfc serialzation automatcaly takes care
of these automatically
That depends, what does your implementation of CDocument::Serialize look like?
|
|
|
|
|
You may be approaching this wrong.
First, since you didn't say, I'm guessing that you have an SDI application. If that's the case, the document is never destroyed until the application exits.
When you choose "new" or "open" the framework calls the CDocument's DeleteContents() function. You need to override that and clean up any previous work or data you may have created - basically, return all values to the point they would be when you first open the application.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
modified on Thursday, August 20, 2009 6:32 AM
|
|
|
|
|
thanks, what you said helps
Simon
|
|
|
|
|
Hey everyone!
I am currently working on a project that requires the capture of video from a video capture card. This video needs to be recorded for later analysis.
There are many different examples online, and a few here on CodeProject, but I would really like some advice. Which API or method is the best for video capture with the requirements below?
1. Ability to select from multiple devices. In this particular case, I need support for a TV capture card or a webcam.
2. Ability to preview video in realtime.
3. Ability to record the output to a file or series of files.
4. Has to be compatible with Visual C++.
Thanks for the help!
-Nathan
modified on Wednesday, August 19, 2009 2:49 PM
|
|
|
|
|
DirectX DirectShow is the answer your questions.You could use it to capture and configurate web cams,capture video from files,capture from TV tuners,capture network streams and etc.Microsoft Media Foundation which starts from Windows Vista as alternative of DirectX and Windows media SDK also could be useful.
Life is a stage and we are all actors!
|
|
|
|
|
Thank you for the quick response to my question! Yes, I've heard mention of DirectShow.
I have tried reading some of the DirectShow documentation, but I am not exactly sure where I should get started with the API. Do you have any suggestions of resources that I should read? The regular MSDN documentation seems a bit clunky to navigate, and I'm not exactly sure what my starting point should be.
|
|
|
|
|
There isn't many to many samples how to work with DirectShow in C++.The reason is that COM is not the favourite model for most of the developers.Here is nice sample how to capture single frame from web camera using C++.You could easy adapt it to your MFC app for example.I highly recommend to test your graphs with GraphEdit or GraphStudio or some similar graph configuration testing tool before you create them programatically.
Life is a stage and we are all actors!
modified on Wednesday, August 19, 2009 12:30 PM
|
|
|
|
|
Thank you, Hristo.
Those resources look good (much better than my searches were yielding). I will read up on them and I will attempt to test them within GraphEdit.
|
|
|
|
|
Always glad to help you.
There is plenty of articles at codeproject how to use DirectShow with .NET.I believe that code translation from .NET to C++ style shouldn't be difficult.
Regards!
Life is a stage and we are all actors!
|
|
|
|
|
last time i looked, there were a whole bunch of samples in the DirectShow SDK. i found them quite useful for what i had to do (frame grabbing).
|
|
|
|
|
As Hristo Bojilov's, so does my vote also go to DirectShow.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
i have just entered into c,c++ programming.how can i improve my c,c++ programming skills.Anybody please help me out.
|
|
|
|
|
madhu9124 wrote: how can i improve my c,c++ programming skills.
By first realizing that they are two separate languages. Just because you know one (C) does not automatically mean you know the other (C++). When I see folks write "C/C++" on resumes and such, that's a big red flag.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
He posted the same thing in Java.
He must have finished them all at the same time! *phew* and who said this stuff was difficult...
|
|
|
|
|
Both Java and Java++?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Practice, practice, practice...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
and to add to that, find a good tutor/mentor, either at school or at your job.
This signature was proudly tested on animals.
|
|
|
|
|
study good books in C and C++. try to practice given examples. We don't have any shortcuts
Thanks and Regards,
Selvam,
http://www.wincpp.com
|
|
|
|
|
First of all, are there any previous languages that you have learned, or is this your first one? Knowing which languages you might already use can help to direct you to decent learning resources.
There are differences between C and C++.
C is a standardized language. One of the major benefits of C is the fact that it does not change (as quoted from one of my CS professors). C can be compiled to many systems, and it is very, very fast. However, C also has a few drawbacks to the language. Dynamic memory is one issue (having a variable that stores strings of various sizes, for example) and requires more complex programming requiring things such as Malloc() and Free(). Another element is the fact that C is not an Object Oriented language. This is why C++ was developed.
C++ is an Object Oriented language. It builds upon the basic building blocks of C and extends it quite a bit. Classes are the biggest difference, allowing to group your various functions into "objects" (hence the Object Oriented). The nice thing about C++ is that it is backwards compatible with C.
All right. Resources.
CPlusPlus.com is a wonderful resource. They have one of the most comprehensive sets of documentation that I've seen on C and C++ to date. Also, they have very good, detailed tutorials.
You may also consider purchasing a textbook on the subject. The industry standard for C appears to be The C Programming Language by Kerrigan and Ritchie. I own both the first and second editions of this text, and I have used them extensively.
Hopefully this will be of help to you. Best of luck!
|
|
|
|
|
General Rule Applicable for any Programming language
*Read the Concept.
*Understand the Program logic.
*Practice
All the very best Pal
Thanks,
Rane
|
|
|
|
|
The first step is to read introductory books. You should probably learn C first because C is a subset of C++, so you'll already know the C part when you study C++.
The next step is to practice writing programs. Programming is like swimming in that you have to do it to learn it. You can't learn to swim just from reading about it.
Reading and understanding other peoples' code is also helpful.
Then more advanced books will help. I recommend Effective C++ by Scott Meyers. Design Patterns is a good book for learning how to effectively use the object-oriented features of C++.
|
|
|
|
|
Hi everybody,
I received a task that need to automatic download an internet page. I just have an URL and, from my software, whould like get it into a directory.
Someone can help me with this ?
Tanks for read my question
|
|
|
|
|
|
Can you use URLDownloadToFile() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|