|
-
Jan 10th, 2002, 08:47 PM
#1
Thread Starter
Fanatic Member
C++ GUI this tutorial i found isnt working.
i found a tutorial and it gave me this code
VB Code:
#include <windows.h>
#include <tchar.h>
#include "resource.h"
BOOL MainDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return FALSE;
}
int _tmain(void)
{
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG1),
NULL, (DLGPROC)MainDialogProc, 0);
return 0;
}
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
-
Jan 10th, 2002, 09:21 PM
#2
Fanatic Member
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?
-
Jan 11th, 2002, 03:12 PM
#3
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.
-
Jan 11th, 2002, 04:00 PM
#4
Thread Starter
Fanatic Member
what would i have to do to make it run for win32 application?
FlameWave Technologies - internet tools
-
Jan 11th, 2002, 06:02 PM
#5
Monday Morning Lunatic
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|