• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Help Visual C++ 2008

2pi

Newbie Spellweaver
Joined
Oct 30, 2009
Messages
40
Reaction score
2
OK,i'm learning C/C++(i read in that vocation the books C complete and total and C++ How to Program)but the books just explain how make console programs(black screen)in the c complete and total've a part that he explain how to make Windows programs,but the way what they use(pragraming by API)it's so hard!And after i found the visual IDEs but i don't know how use them.Can somebody help me?:(:

That's all folks!:thumbup:
 
Experienced Elementalist
Joined
Sep 4, 2009
Messages
248
Reaction score
69
API/WinAPI/MFC. Pretty much no other choice, except making a CLI program. MFC, I wouldn't go with it. I would stick to making console programs for now, until you have a firm grasp of the C/C++ language. Then start working with API, WinAPI or MFC.
 

2pi

Newbie Spellweaver
Joined
Oct 30, 2009
Messages
40
Reaction score
2
Ok,so i'll to use the lcc win32 to program windows.
 
Ginger by design.
Loyal Member
Joined
Feb 15, 2007
Messages
2,340
Reaction score
653
Those books won't teach you much if anything at all. Get a real C++ book and follow all of the examples, do all of the problems presented, and read code from real projects. Then learn data structures and algorithms. That's the only way you have a chance of actually learning how to write software, and at that point, making GUI applications would be trivial because you'd be able to easily learn something like Qt.
 

2pi

Newbie Spellweaver
Joined
Oct 30, 2009
Messages
40
Reaction score
2
Guy,i read the best c/c++ books,but well i'll program using another API,Wxwidgets,nowdays it's the best form of code a software bacause that API's multiplataform.But thanks.
 
Legendary Battlemage
Loyal Member
Joined
Apr 7, 2009
Messages
647
Reaction score
25
C++ is essentially console applications.
Windows is just a GUI wrapper for MS-DOS.

So, if you want to show a window, either use WinForms or use a window handle (HWND).
 
Skilled Illusionist
Joined
Apr 22, 2009
Messages
301
Reaction score
19
C++ is essentially console applications.
Windows is just a GUI wrapper for MS-DOS.

So, if you want to show a window, either use WinForms or use a window handle (HWND).

C++ is not essentially console applications even thought it is not a RAD oriented language and :

Windows is not anymore a "GUI wrapper for MS-DOS" windows 95 was, wake up.
 
Last edited:

2pi

Newbie Spellweaver
Joined
Oct 30, 2009
Messages
40
Reaction score
2
Ah i don't understand,that's not a API code?
Code:
 #include <windows.h>

    LRESULT CALLBACK WinProc(HWND window,UINT msg,WPARAM wParam,LPARAM lParam);
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
        LPSTR lpCmdLine, int nCmdShow)

    {

    HWND hwnd;
    WNDCLASSEX win;//Declara variável para a classe da janela
    MSG message;

    win.cbClsExtra=0;//Quantidade extra de dados alocados na meória pela classe
    win.cbSize=sizeof(win);//Tamanho da estrutura
    win.cbWndExtra=0;//Quantidade extra de dados alocados na meória pela classe por cada janela do tipo especifidado.
    win.hbrBackground=GetSysColorBrush(COLOR_WINDOW);//Cor de fundo da janela
    win.hCursor=LoadCursor(NULL,IDC_ARROW);//Ponteiro do mouse
    win.hIcon=LoadIcon(NULL,IDI_APPLICATION);//O ícone da janela
    win.hIconSm=LoadIcon(NULL,IDI_APPLICATION);//Ícone da janela quando é pressionado ALT+TAB.
    win.hInstance=hInstance;//Instância da janela, o mesmo valor declarado em WinMain.
    win.lpfnWndProc=WinProc;//Função que irá receber as mensagens enviadas à nossa janela. Esta é a função que controla os eventos, como cliques, movimento de mouse, etc.
    win.lpszClassName="Janela";//Nome da classe da janela
    win.lpszMenuName=NULL;//Especifica o nome de do menu a ser utilizado na janela.
    win.style=0;//Especifica o tipo inicial da janela.
    if(!RegisterClassEx(&win))//Registra nossa classe, caso ocorra um erro, o programa encerra.
    return 0;
    hwnd = CreateWindowEx(0,"Janela","Minha janelinha",WS_OVERLAPPED|WS_SYSMENU,300,****400,400,NULL,NULL,hInstance,NULL);

    if(hwnd == NULL)
    return 0;

    ShowWindow(hwnd,SW_SHOW);
    UpdateWindow(hwnd);

    while(GetMessage(&message,0,0,0)){
    TranslateMessage(&message);
    DispatchMessage(&message);
    }
    return message.wParam;

    }

    LRESULT CALLBACK WinProc(HWND window,UINT msg,WPARAM wParam,LPARAM lParam){

    switch(msg)
        {
            case WM_CLOSE:
                DestroyWindow(window);
            break;
            case WM_DESTROY:
                PostQuitMessage(0);
            break;
            default:
                return DefWindowProc(window, msg, wParam, lParam);
    }
      return 0;

    }
So i try exit this,know?That's a stupid code,visual c++ seems to me an exit of that monster,but i can't find a good manual,tutorial,anything about the visual c++(i'm talking about the CRL windows forms aplication).
But i think too:Windows is just a MS-Dos GUI,for me windows is more or less a KDE or Gnome for a MS-DOS(windows "kernel"),but the MS-DOS of the windows isn't the Ancient MS-DOS,for me he's a new version,but based in the original MS-DOS.
 
Skilled Illusionist
Joined
Apr 22, 2009
Messages
301
Reaction score
19
Windows is not based on MS-DOS but on Windows NT kernel.
 

2pi

Newbie Spellweaver
Joined
Oct 30, 2009
Messages
40
Reaction score
2
Windows is "closed source",so all about it is just expeculation.
 
Legendary Battlemage
Loyal Member
Joined
Apr 7, 2009
Messages
647
Reaction score
25
C++ is not essentially console applications even thought it is not a RAD oriented language and :

Windows is not anymore a "GUI wrapper for MS-DOS" windows 95 was, wake up.

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces (GUIs)
It is a GUI wrapper.

And C++ can only create console applications UNLESS you state to draw stuff by creating a handle (HWND).
 

2pi

Newbie Spellweaver
Joined
Oct 30, 2009
Messages
40
Reaction score
2
But,is the NT kernel MS-DOS based?If yes,he's a MS-DOS.
 
Skilled Illusionist
Joined
Apr 22, 2009
Messages
301
Reaction score
19
Yes it 'was' but untill windows Me only then since windows 2000 they based windows on there windows NT kernel... Just try to boot on MS-DOS from your windows XP as you could do in windows 98 and windows 95, you would have to install MS-DOS on it's own partition.
 
Ginger by design.
Loyal Member
Joined
Feb 15, 2007
Messages
2,340
Reaction score
653
Guy,i read the best c/c++ books,but well i'll program using another API,Wxwidgets,nowdays it's the best form of code a software bacause that API's multiplataform.But thanks.

You haven't read the best books or you wouldn't be asking any questions here.

Further, wxWidgets is actually quite terrible. Cross platform is easy.

Use Qt. It's the best there is right now.
 

2pi

Newbie Spellweaver
Joined
Oct 30, 2009
Messages
40
Reaction score
2
But guys you don't understand my question,i just wanna know,ohw to use the visual c++ express edition,haven't anybook that you can to learn the my question,The majority books about c/c++ don't explain about the WIN32 API,but the book C complete reference(C complete and total in brazillian portuguese)exolain About the WIN32 API.
 
Ginger by design.
Loyal Member
Joined
Feb 15, 2007
Messages
2,340
Reaction score
653
But guys you don't understand my question,i just wanna know,ohw to use the visual c++ express edition,haven't anybook that you can to learn the my question,The majority books about c/c++ don't explain about the WIN32 API,but the book C complete reference(C complete and total in brazillian portuguese)exolain About the WIN32 API.

You REALLY don't want to use the win32 api.

But since you can't google:

 
Joined
Jun 8, 2007
Messages
1,985
Reaction score
490
I think you should listen to Merlin, he's just trying to help you from the experience point of view.. If you're going to learn something, I'd suggest doing the research first, and if there are different things you can learn that do similar things, than picking the best, most versatile, and easiest in the long-run solution is essential. Merlin did all the research for you, so just learn how to use Qt..
 
Ginger by design.
Loyal Member
Joined
Feb 15, 2007
Messages
2,340
Reaction score
653
This is why people shouldn't start out with C++. There's no difference between CLI and GUI applications. If you don't understand how things really work and what's going on, you tend think the compiler or something else is doing magical things. And further, misunderstanding "api" and that EVERYTHING is some kind of "api." -.-
 
Back
Top