I see. That makes more sense.
So much to do to avoid memory leaks :)
Type: Posts; User: Halloko
I see. That makes more sense.
So much to do to avoid memory leaks :)
I have a follow-up question regarding this:
How do you make, say, a vector handle memory management if you are allocating your objects on the heap which you would probably do to avoid copying...
So you would go for the second or third example presented in my original post?
It's fun how you keep talking about error messages. Personally, I'm much more interested in the actual type of error, what caused it and how I can make the application continue. The error message is...
You are making a very good point, Mario, and I will certainly consider using exceptions more in the future.[/qUOTE]
HOWEVER, as you said yourself, the memory to deallocate and additional cleaning...
But if you are checking the return values anyway, why not just handle the error locally instead of throwing an exception which is caught in a catch-statement further down?
Am I missing the point...
But what if you wanted to read multiple files and you wanted different things to happen based on the file you opened?
Also, if you wanted to analyze the actual error you'd want to examine the...
I guess you have a point. It does also mean, however, that you need to wrap every single C-style API you want to use instead of just going for plain error-checking.
As mentioned earlier, I think...
That wasn't really what I meant by "old-fashioned". I merely meant that I did things the c-style way, that is, not using exceptions when I could avoid it.
As has become evident in this thread, for...
Yes, I was talking about using exceptions for everything. And I definitely agree that a mixed approach is the way to go. For this particular case, using exceptions definitely seems to be the less...
Like vectors and strings, as Daved pointed out? But isn't that pretty much refraining from using new/delete directly?
I disagree. Using try/catch blocks remove your focus from the actual flow of...
I'm a bit old-fashioned (or whatever you'd like to call it). I prefer actually checking return values rather than cluttering my code with try/catch statements.
I completely agree.
So you're...
Hey,
Over the past few weeks I've experienced the same dilemma during coding:
If you want to use the constructor to initialize some class member variables (such as allocating memory), what is...
Just to dig further into this. So even though both threads call the same function (that is, they call the same shared member function since they have a pointer to the same class object) the local...
Hah, that just tells something about how bad my research was before asking :)
Thanks a lot mate!
Hey all,
I was wondering how you guys cope with passing parameters when creating a modal dialog box.
Since calling DialogBox() transfers focus to the modal dialog box there's no way to pass any...
Awesome! I didn't know that.
Guess I'll be switching to critical sections pretty soon :)
I usually use mutexes, but it comes out on the same I guess.
Thanks guys. :p
Hey all,
Since I'm not sure whether to put this in the C++ or Windows section I'm just going to dump it here.
I have a question regarding classes and threads. Say you have a class which has two...
Thanks for the reply.
First of all I'm not using MFC but plain Win32 for this project.
Second, I'm aiming to link the DLL statically, not dynamically at run-time.
Do you have an alternative to...
First of all, I realize this has been asked before but they all concerned MFC so I'll just go ahead ;)
I'm creating a DLL for an application which includes an .rc file with dialogs, bitmaps, etc....
Thanks for the helpful replies, guys. I, too, like to have clean headers and use files with other extensions, such as .cpp, to deal with the actual definitions.
I'll come up with a style of some...
Just to brush up on this reasonably old thread :)
.ipp as in "include-pp file" ? How is that any better than including .cpp files?
Also, just a quick rehap. So it is required that all...
Of course.
I found the solution, though. I had to set the main dialog's Control Parent property to TRUE and all the child dialogs' Control property to TRUE.