Thread: New to Dev C++/<windows.h>...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    11

    New to Dev C++/<windows.h>...

    Generally, my programming skills originate from Borland C++ and I'm trying Dev C++. This simple program that I got from a book does not work in Dev C++.

    Code:
    #include <stdio.h>
    
    void main()
    {
              printf("Testing...\n");
    }
    I understand what I need to do to get this working but under different functions (i.e using namespace std....) for the standard functions. I am wondering what compiler runs this program without syntax errors/other errors. (again I am new and know only so much at the moment.) Also, the simplest windows application...

    Code:
    #define WIN32_LEAN_AND_MEAN
    
    #include <windows.h>
    
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
    {
        MessageBox(NULL, "\tHello, world!", "My first windows application", NULL);
        return 0;
    
    }
    Is presented with an unwanted standard dev c++ output window with the actual Window (working as intended) in front of the standard dev c++ output screen. For these types of programs, what compiler do you reccomend? What compiler should I use for OpenGL Programming?

    EDITS: How do I remove the standard c++ output pane when running a windows.h program?

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    127
    Code:
    #include <stdio.h>
    
    int main()  //GCC is a c++ standard conforming-compiler
    {
              printf("Testing...\n");
    }
    Code:
    MessageBox(NULL, "\tHello, world!", "My first windows application", NULL);
    should be
    MessageBox(NULL, "\tHello, world!", "My first windows application", MB_OK);
    >What compiler should I use for OpenGL Programming?
    You can create the OpenGL project with Dev-C++
    Nana C++ Library is a GUI framework that designed to be C++ style, cross-platform and easy-to-use.

  3. #3
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    >>EDITS: How do I remove the standard c++ output pane when running a windows.h program?

    If you mean the console window, just make sure when you make a new project to select "Windows Application" (or you can change it from project options after you create the project)
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    11
    EDITS: Oh ok, Ill try that.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Whats better, C-Free or Dev C++??
    By i_can_do_this in forum Tech Board
    Replies: 10
    Last Post: 07-07-2006, 04:34 AM
  2. Glut and Dev C++, Programs not Quitting?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-29-2004, 08:43 PM
  3. openGL programming - From MSVC++ to Dev C++
    By WDT in forum Game Programming
    Replies: 3
    Last Post: 03-08-2004, 08:47 PM
  4. openGL programming - From MSVC++ to Dev C++
    By WDT in forum Game Programming
    Replies: 1
    Last Post: 03-08-2004, 05:19 PM
  5. DEV C++ Limitations?
    By Kirdra in forum Game Programming
    Replies: 3
    Last Post: 09-09-2002, 09:40 PM