| View previous topic :: View next topic |
| Author |
Message |
manc Grandmaster Cheater
Reputation: 1
Joined: 16 Jun 2006 Posts: 551
|
Posted: Tue Sep 16, 2008 8:31 pm Post subject: [C++] Error |
|
|
Anyone know what this means
| Code: |
Linking...
LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
C:\Documents and Settings\Matt\Desktop\TestingGUI\Debug\TestingGUI.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Matt\Desktop\TestingGUI\TestingGUI\Debug\BuildLog.htm"
TestingGUI - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
Trying to make a simple dialog that looks like this:
[img=http://img262.imageshack.us/img262/142/83851255sx0.th.png]
Its just a .h + .rc so far, no .cpp. Just a plain dialog. Do I have to have a source file and define it and whatnot for it to simply exist?
_________________
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Tue Sep 16, 2008 8:33 pm Post subject: |
|
|
If there's no CPP source file, there's no entry point, meaning you will obviously have errors.
Add a CPP File, with a WinMain entry point.
_________________
|
|
| Back to top |
|
 |
Overload Master Cheater
Reputation: 0
Joined: 08 Feb 2008 Posts: 293
|
Posted: Tue Sep 16, 2008 8:40 pm Post subject: |
|
|
You need a main method. Either int main() or WINMAIN
_________________
Blog
| Quote: | Rhys says:
you can be my maid
Rhys says:
ill buy you a french maid outfit
Tyler says:
Sounds good
Rhys says:
ill hold you to that |
|
|
| Back to top |
|
 |
manc Grandmaster Cheater
Reputation: 1
Joined: 16 Jun 2006 Posts: 551
|
Posted: Tue Sep 16, 2008 8:42 pm Post subject: |
|
|
Wouldnt
| Code: | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
} |
work?
MSVC++ gives errors.
_________________
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Tue Sep 16, 2008 8:52 pm Post subject: |
|
|
Warning: Coded in quick-reply
| Code: | #include <windows.h>
#include <tchar.h>
#include <commctrl.h>
#include "resource.h"
#pragma comment (lib, "comctl32.lib")
BOOL DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_CLOSE:
case WM_DESTROY:
EndDialog(hDlg, 0);
break;
}
return TRUE;
}
BOOL WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nShowCmd)
{
INITCOMMONCONTROLSEX Init;
Init.dwSize = sizeof(INITCOMMONCONTROLSEX);
Init.dwICC = ICC_STANDARD_CLASSES;
InitCommonControlsEx(&Init);
// Change "IDD_DIALOG1" to the name of the dialog you made in the .rc
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC)DlgProc);
return TRUE;
} |
_________________
|
|
| Back to top |
|
 |
manc Grandmaster Cheater
Reputation: 1
Joined: 16 Jun 2006 Posts: 551
|
Posted: Tue Sep 16, 2008 9:00 pm Post subject: |
|
|
I see. My .rc dialog was named IDD_DIALOG1 so it worked fine. However, the only things that showed up were checkbox, ok, and cancel. There was no background, no titlebar, nothing.
Also, WTF?
[img=http://img291.imageshack.us/img291/2203/35407549vx9.th.png]
Why is | Code: | | 'TestingGUI.exe': Loaded 'C:\Program Files\Internet Download Manager\idmmkb.dll" | even happening? Internet Download Manager? How the hell is that involved?
_________________
|
|
| Back to top |
|
 |
|