Results 1 to 5 of 5

Thread: C++ GUI this tutorial i found isnt working.

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2001
    Posts
    746

    C++ GUI this tutorial i found isnt working.

    i found a tutorial and it gave me this code
    VB Code:
    1. #include <windows.h>
    2. #include <tchar.h>
    3. #include "resource.h"
    4.  
    5. BOOL MainDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
    6. {
    7.     return FALSE;
    8. }
    9.  
    10. int _tmain(void)
    11. {
    12.     DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG1),
    13.         NULL, (DLGPROC)MainDialogProc, 0);
    14.     return 0;
    15. }
    im using VC++ compiler so i went to insert and made a new dialog and saved it. i then compiled it and got the following errors:

    --------------------Configuration: test GUI4 - Win32 Debug--------------------
    Compiling...
    source.cpp
    Linking...
    LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
    Debug/test GUI4.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    test GUI4.exe - 2 error(s), 0 warning(s)


    So can someone please tell me why it isnt working?
    FlameWave Technologies - internet tools

  2. #2
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    make sure ur doing a win32 application, not a console application

    this place has good win32 tutorials, check it out
    http://www.free-ed.net/fr03/lfc/030203/122/
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    No. You wrote the function main, so you need to make it a console application, not a normal application.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2001
    Posts
    746
    what would i have to do to make it run for win32 application?
    FlameWave Technologies - internet tools

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Code:
    int __stdcall WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *lpCmdLine, int nCmdShow) {
        DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG1), NULL, MainDialogProc, 0);
        return 0;
    }
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width