Type: Posts; User: jfaust
Search took 0.06 seconds.
January 14th, 2009, 10:12 AM
Anything's possible--it's only software after all. It's just a matter of cost. I've learned that venturing off the beaten MFC path is fraught with peril. We're looking to other...
January 13th, 2009, 02:09 PM
I did try handling WM_GETMINMAXINFO. It did correctly restrict the size of the window, but it still behaved maximized. It lost the title bar. Also when it was the active window, the other...
January 13th, 2009, 12:57 PM
Thanks for the answer. I tried it, and this solution only blocks the action of clicking on the maximize button. So, double clicking on the title bar still maximizes. There's likely...
January 13th, 2009, 11:37 AM
I have an MDI application with windows that can maximize, minimize, etc.--all the default functionality you'd expect.
I have one MDI child window that behaves as a modeless dialog that I want to...
April 19th, 2007, 10:31 PM
Post your code, please.
April 12th, 2007, 05:04 PM
Yes. You can use it, change it, redistribute it. It can be used in open source and commercial projects. It's a completely open license that is much more relaxed than GPL, for instance. It does...
April 12th, 2007, 03:27 PM
I would suggest using both boost::filesystem and boost::regex. They are both portable and powerful.
April 9th, 2007, 11:46 AM
Take your example of adding a derived class 'truck'. In the casting example, it would compile and run without any changes, perhaps leading to undesired behavior.
In the Visitor example, you will...
April 3rd, 2007, 02:56 PM
Unit tests should not care about inheritance or polymorphism, but about testing interfaces, pre and post conditions, functionality, etc.
"Unit testing" is over used and can mean different things. ...
April 3rd, 2007, 02:51 PM
vector will always be contiguous, even after reallocating.
The usual reason for choosing a deque over a vector is that it may not be possible for the OS to find a large block of contiguous memory,...
December 18th, 2006, 03:03 PM
Intersting. You must be calling this a lot. I'm assuming that you are profiling on a release build, not a debug build, and running outside the debugger.
Just out of curiousity, what are the...
December 17th, 2006, 04:03 PM
I missed the dll requirement. This will only work as statically linked.
One option, if you know all the types that will be used, is to move the getInstace to an implementation file and...
December 17th, 2006, 03:34 PM
This works for me:
using namespace std;
template <class T>
December 17th, 2006, 10:22 AM
And if you're not using vc++ 6.0 (which has a bug), you can also make the destructor private.
December 15th, 2006, 12:49 PM
Definitely a Visitor should have a pure virtual interface. The resulting compile error generated when a new type is added is what separates the Visitor Pattern from type checking. It forces you to...
December 15th, 2006, 11:38 AM
The overhead isn't bad: it's a double-dispatch technique, resulting in two virtual function calls. This is usually not an issue.
One last recommendation: boost::variant is a simple object...
December 14th, 2006, 05:41 PM
Sounds good to me! I think you're on the right track.
If you get tripped up with the code, let us know.
December 14th, 2006, 11:22 AM
But that's a different problem, with varying solutions that don't sacrifice the fundamental design. The file/folder relationship is simple and obvious, and should be modeled in a simple and obvious...
December 14th, 2006, 10:58 AM
December 14th, 2006, 10:52 AM
Reading this thread, I was also going to suggest the Visitor pattern.
Be aware that having isFile()/isFolder() methods is just as bad as using dynamic_cast<> from a design standpoint. They both...
December 13th, 2006, 03:49 PM
'for' begins another scope, allowing you to hide outer-scope variables.
'float i = 0.0f, j = 0;' defines two floats, i and j.
solution: set j = 0 before the loop:
int j = 0;
for(float i =...
December 13th, 2006, 03:03 PM
And also the reason I used the word "clarify" in my post :D
December 13th, 2006, 02:48 PM
To confuse even more (and hopefully clarify by doing so):
A a1(a0); // copy constructor
A a2 = a1; // copy constructor
a2 = a1; // assignment operator
December 12th, 2006, 02:53 PM
Although there is some amount of error inherent in floating point calculations, you can keep that error constant by avoiding operations that accumulate the error. For instance, to iterate over a...
December 12th, 2006, 10:40 AM
You can use boost::rational for exact computation.
However, your application most likely does not need it. A certain amount of error is acceptable in most applications, including virtually all...
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!