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

Search:

Type: Posts; User: acppdummy

Page 1 of 5 1 2 3 4

Search: Search took 0.04 seconds.

  1. Re: Have to finish reading popen( ) or not? (memory leak?)

    Update: well running the program gave me the answer. There were a bunch of messages - something like "can't write to non-existent pipe". So I should read all the output. Thanks!
  2. Have to finish reading popen( ) or not? (memory leak?)

    I just started using popen( ) to read command line output into my program. Do I have to finish reading all of the output from it or is it OK to close the file after reading just a number but not the...
  3. Replies
    8
    Views
    16,233

    Re: typedef and struct inside class definition?

    I would love to find the bug if I could. The program runs many thousands of loops. The corruption only occurs very occasionally in one or a couple of the loops. It would be a lot easier if the...
  4. Replies
    8
    Views
    16,233

    Re: typedef and struct inside class definition?

    Thank you both! The code compiles (with g++ tool) and runs fine under Cygwin. However under MinGW (also compiled with g++ tool that came with MinGW), a few simple double variables declared...
  5. Replies
    8
    Views
    16,233

    typedef and struct inside class definition?

    Can typedef and struct be put inside a class like below? Thanks!



    class classA {
    private:
    typedef void(classA::*aFnPtr_t) (); //pointer-to-member function
    struct strctA {
    ...
  6. Re: Access other members within same nested class?

    Yes in my particular situation I need a global list of certain objects of classA so a static member just fits the need. Thanks!
  7. Re: Access other members within same nested class?

    Thank you! I have changed the vector to a static member of classA instead.
  8. Re: Access other members within same nested class?

    Thank you for the quick reply! Yes I will have to redo the design.
  9. Access other members within same nested class?

    It's hard to give a precise title but here is the question in detail: I have a class, something like this:


    class classA{
    public:
    void fnA();
    ...
    };

    and another class that...
  10. Re: Access (click) buttons in other apps' widnows? (MinGW g++)

    Well I found this
    http://www.autohotkey.com/
    so I don't have to re-invent the wheel so to speak. Thanks!
  11. Access (click) buttons in other apps' widnows? (MinGW g++)

    I would like to make a simple application that clicks some buttons in other (already open) applications' windows. I also would like to avoid VC and use MinGW g++ instead. Is it possible? If so could...
  12. Replies
    14
    Views
    2,781

    Re: Member function pointer assignment

    Thank you everyone for offering to help! I will first try to duplicate the problem with a small example. If that doesn't work then I will zip up the full program and upload. Thanks again!
  13. Replies
    14
    Views
    2,781

    Re: Member function pointer assignment

    Well it's a bit complicated: the function pointer that points to either fn1 or fn2 is used inside another member function of the same class like this:

    (this->*fnptr)()

    and fn1 and fn2 actually...
  14. Replies
    14
    Views
    2,781

    Re: Member function pointer assignment

    Thank you! But I tried both

    public:
    MyClass(): fnptr(&MyClass::fn1){
    ...
    }; and

    public:
    MyClass(): {
    fnptr=&MyClass::fn1;
  15. Replies
    14
    Views
    2,781

    Re: Member function pointer assignment

    Another question: can the assignment be done in the constructor? (to initialize the pointer)

    I tried it but kept getting core dump. :confused:
  16. Replies
    14
    Views
    2,781

    Re: Member function pointer assignment

    Thanks! So if I understand it correctly, when calling from mc1,

    (this->*fnptr)()

    calls

    mc1.fn1

    and
  17. Replies
    14
    Views
    2,781

    Re: Member function pointer assignment

    Wait! When calling the function pointer it is just calling the function pointer, not the actual function. So it's still not clear to me how
    mc1.fn1 and
    mc2.fn1 are distinguished. :confused: Does ...
  18. Replies
    14
    Views
    2,781

    Re: Member function pointer assignment

    Ah yes. Now I remember another thing the compiler wants me to do is

    (this->*fnptr)(), not just
    fnptr().

    Thank you! :)
  19. Replies
    14
    Views
    2,781

    Member function pointer assignment

    I have a class with member functions and a pointer like this:


    class MyClass{
    private:
    typedef void(MyClass::*memFnPtr_t) ();
    public:
    memFnPtr_t fnptr;
    void fn1();
    void...
  20. Re: Compiler auto correct uninitialized variable? (gcc does and VC++ doesn't)

    Thanks! Point well taken - I already fixed the code when VC++ did not do the "smart optimization" and exposed the bug. The exercise of looking at the assembly code was just to understand why g++...
  21. Replies
    3
    Views
    2,028

    NetBeans Linker Order?

    Any NetBeans user out there that knows the trick? Thanks!
  22. The optimizer made the difference!

    Hello all, Thank you very much for the comments. I learned a lot from this forum as always. Here is what I found:

    Using the -S switch I let g++ produce assembly codes for each of the two...
  23. Re: Compiler auto correct uninitialized variable? (gcc does and VC++ doesn't)

    First of all sorry for my stupid comment about g++ having a "bug". I know it is a well built tool.



    I know the binaries are the same because I use BeyondCompare to do binary comparisons. When I...
  24. Re: Compiler auto correct uninitialized variable? (gcc does and VC++ doesn't)

    Thanks for the comments about '/' vs '\\'.

    Now I am still fascinated by the fact that g++ produced identical binaries from codes with different logic. So I made a small example project and tested...
  25. Replies
    4
    Views
    9,719

    Re: link.xxxxx....tlog files OK to delete?

    A related question: There are two huge files "projectname.sdf" and "projectname-xxxxxx.ipch". Can they be disabled or deleted? Thanks!
Results 1 to 25 of 105
Page 1 of 5 1 2 3 4





Click Here to Expand Forum to Full Width

Featured