CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: jfaust

Page 1 of 65 1 2 3 4

Search: Search took 0.21 seconds.

  1. Replies
    6
    Views
    1,672

    Re: modeless dialog in MDI app

    zerver,

    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...
  2. Replies
    6
    Views
    1,672

    Re: modeless dialog in MDI app

    Alin,

    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...
  3. Replies
    6
    Views
    1,672

    Re: modeless dialog in MDI app

    zerver,

    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...
  4. Replies
    6
    Views
    1,672

    [RESOLVED] modeless dialog in MDI app

    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...
  5. Re: How to convert a string into an array of char?

    Post your code, please.

    Jeff
  6. Re: Is there a standard C++ wildcard filter / matcher class?

    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...
  7. Re: Is there a standard C++ wildcard filter / matcher class?

    I would suggest using both boost::filesystem and boost::regex. They are both portable and powerful.

    Jeff
  8. Replies
    16
    Views
    3,602

    Re: Casting - bad design?

    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...
  9. Replies
    4
    Views
    895

    Re: Testing strategies

    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. ...
  10. Replies
    2
    Views
    711

    Re: reallocating vectors

    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,...
  11. Replies
    39
    Views
    7,837

    Re: How to avoid dynamic_cast/static_cast

    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...
  12. Replies
    7
    Views
    1,368

    Re: template classes & static members

    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...
  13. Replies
    7
    Views
    1,368

    Re: template classes & static members

    This works for me:



    #include <iostream>

    using namespace std;

    template <class T>
    class Singleton
  14. Replies
    7
    Views
    1,368

    Re: template classes & static members

    And if you're not using vc++ 6.0 (which has a bug), you can also make the destructor private.

    Jeff
  15. Replies
    39
    Views
    7,837

    Re: How to avoid dynamic_cast/static_cast

    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...
  16. Replies
    39
    Views
    7,837

    Re: How to avoid dynamic_cast/static_cast

    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...
  17. Replies
    4
    Views
    893

    Re: Singly Linked Lists: Clarification Needed

    Sounds good to me! I think you're on the right track.

    If you get tripped up with the code, let us know.

    Jeff
  18. Replies
    39
    Views
    7,837

    Re: How to avoid dynamic_cast/static_cast

    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...
  19. Replies
    39
    Views
    7,837

    Re: How to avoid dynamic_cast/static_cast

    timestamp?

    Jeff
  20. Replies
    39
    Views
    7,837

    Re: How to avoid dynamic_cast/static_cast

    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...
  21. Replies
    3
    Views
    936

    Re: another float/int/for question

    '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 =...
  22. Replies
    6
    Views
    876

    Re: Copy Constructor ????

    And also the reason I used the word "clarify" in my post :D

    Jeff
  23. Replies
    6
    Views
    876

    Re: Copy Constructor ????

    To confuse even more (and hopefully clarify by doing so):


    A a0;
    A a1(a0); // copy constructor
    A a2 = a1; // copy constructor
    a2 = a1; // assignment operator


    Jeff
  24. Replies
    23
    Views
    2,296

    Re: Mathematical problem with a template

    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...
  25. Replies
    23
    Views
    2,296

    Re: Mathematical problem with a template

    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...
Results 1 to 25 of 1605
Page 1 of 65 1 2 3 4





Click Here to Expand Forum to Full Width

Featured