Win32 / Object Oriented Programming

Very simplistic Win32 program without console. / Applying C++

Page 1 of 1

3 Replies - 2752 Views - Last Post: 26 October 2010 - 09:59 AM Rate Topic: -----

#1 Guest_Andrew*


Reputation:

Win32 / Object Oriented Programming

Posted 26 October 2010 - 09:45 AM

Hey all,

I have multi-faceted question.

1. I have a very simple win32 program that I'm compiling with code::blocks. I've just started learning win32 and until now I've just worked with the console. When I build and run the program, the console will open and run the win32 window. Is this what should be happening? What would it take to make it so the console does not open?

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
    LPSTR lpCmdLine, int nCmdShow)
{
    MessageBox(NULL, "Goodbye, cruel world!", "Note", MB_OK);
    return 0;
}



2. I've gone through C++ in 28days and have done this and that. Learning C++ and eventually getting bored like a never ending cycle. I feel like what is lacking that that applications that I make, don't Do anything. I make arrays do math, menus list goes on. I guess I'm looking for that next step, the actual Object Oriented aspect. If anyone has any tutorials with this kind of focus I'd appreciate it.

Is This A Good Question/Topic? 0

Replies To: Win32 / Object Oriented Programming

#2 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 768
  • View blog
  • Posts: 2,241
  • Joined: 20-March 10

Re: Win32 / Object Oriented Programming

Posted 26 October 2010 - 09:50 AM

You need to build it in release mode and not debug mode then the console window will not open.

There are many such tutorials on dream in code check out the tutorial section.
Was This Post Helpful? 0
  • +
  • -

#3 oscode  Icon User is offline

  • D.I.C Regular

Reputation: 109
  • View blog
  • Posts: 257
  • Joined: 24-October 10

Re: Win32 / Object Oriented Programming

Posted 26 October 2010 - 09:51 AM

1) Your program is being linked with the subsystem option "console". Create a new project which is a Win32 program (not Win32 Console Program).
2) Create something useful :), how about a program to rename your music collection? Then later you can advance it to rename based on tags, too.

This post has been edited by oscode: 26 October 2010 - 09:53 AM

Was This Post Helpful? 0
  • +
  • -

#4 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: Win32 / Object Oriented Programming

Posted 26 October 2010 - 09:59 AM

Quote

When I build and run the program, the console will open and run the win32 window. Is this what should be happening? What would it take to make it so the console does not open?
When compiling, compile as a windows and not console program. There is a distinction in Windows. If using MinGW, there is an -mwindows flag. If using MSVC, you can indicate the subsystem under linker options.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1