Thread: OOP in windows

  1. #1
    Politics&Cpp geek Da-Nuka's Avatar
    Join Date
    Oct 2004
    Posts
    104

    OOP in windows

    Why cant i do it in the plain simple old way?

    CUSTOMCLASS OBJECT;
    OBJECT.GetaFunction(0);

    When programming windows, I have to do this mess, why?

    MYCLASS *APOINTER = NULL;
    APOINTER=new MYCLASS;
    APOINTER->GetaFunction(0);



  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    No idea - it looks reasonable on the face of it.

    Posting some real code and some real error messages would be better.

  3. #3
    Politics&Cpp geek Da-Nuka's Avatar
    Join Date
    Oct 2004
    Posts
    104
    *im stuipid*

    I found out... Looks like its illegal to define global objects.
    (didnt know)

  4. #4
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    I'm not satisfied that you actually understand the problem, actually. If you post some code as Salem suggested perhaps we can set you straight.

    It seems to me you find using pointers to be something of a foreign concept. And its perfectly legal to make global objects. You just couldn't do something like:

    Example:
    Code:
    class OBJECT {
    public:
      int whatever();
    };
    
    OBJECT o;
    o.whatever();
    
    int main(void) {
      return 0;
    }
    Since it would be illegal to call a member function in that manner.

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    are we talking MFC here?
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  6. #6
    Politics&Cpp geek Da-Nuka's Avatar
    Join Date
    Oct 2004
    Posts
    104
    This thread is old, but bah
    No, we are not talking MFC, we are talking plain and simple C++
    (Object Oriented Programming, shortend OOP), which was invented by scientists from Norway (My country ofcourse)

    I shall post the code, just to make you happy
    Code:
    #include "jumpClass.h"
    JUMPCLASS jumpObject;
    jumpObject.setJumper(0); // This line is illegal it seems
    
    int WINAPI WinMain(...) {
    
    return 0;
    }
    Will it be illegal as well, if I call it with a constructor?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  2. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 05:48 PM
  3. dual boot Win XP, win 2000
    By Micko in forum Tech Board
    Replies: 6
    Last Post: 05-30-2005, 02:55 PM
  4. SDL and Windows
    By nickname_changed in forum Windows Programming
    Replies: 14
    Last Post: 10-24-2003, 12:19 AM
  5. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM