-
What Hit this Code!!!!
this Code is not work ??? Why
[cod]
#include<afxwin.h>
class mywin :public CFrameWnd
{
mywin()
{
Create(NULL,"Esmaee.com");
}
};
class app: public CWinApp
{
BOOL InitInstance()
{
m_pMainWnd=new CFrameWnd();
m_pMainWnd->ShowWindow(m_nCmdShow);
return TRUE;
}
};
app aap;
[/cod]
I have to creat and show window but instead this I recieve this message :
--------------------Configuration: Cpp1 - Win32 Debug--------------------
Linking...
libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Cpp1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
please Help!!!
-
It's looking for main( ) because you have created a win32 console application instead of a win32 application probably. Just go into Project->Settings->Link .. then under Project Settings: look for the line:
/subsystem:console
and change that to
/subsystem:windows
You should be set. Next time make your project a Win32 Application , no console!
-
Also, as you are creating an MFC app.....when you create the project chose MFC Application as opposed to Win32 Application or Console Application...this will bring in the nessasary settings and libraries
-
Thank you!
I have done...
Now I don't recieve link message!
I recieve an warning from the Windows:
-------------------------------------------
Debug Assertion Failed!
Program : C:\................................ .exe
File: winocc.cpp
Line: 301
For information on how your program can cause an assertion
faolure,see.................................
-----------[aburt]--------[Retry]-----------[Ignor]------
when I sellect retry I recieve the will known message:
Cpp1.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
[send report] [don't send]
!!!!!