Click here to Skip to main content
15,914,795 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Execute Program without waiting for termination Pin
swaroopvtk31-Mar-05 15:59
swaroopvtk31-Mar-05 15:59 
GeneralRe: Execute Program without waiting for termination Pin
Ryan Binns31-Mar-05 17:44
Ryan Binns31-Mar-05 17:44 
GeneralRe: Execute Program without waiting for termination Pin
DasdaDAS31-Mar-05 18:27
DasdaDAS31-Mar-05 18:27 
GeneralRe: Execute Program without waiting for termination Pin
Tareq Ahmed Siraj31-Mar-05 18:41
Tareq Ahmed Siraj31-Mar-05 18:41 
GeneralRe: Execute Program without waiting for termination Pin
balaclavabob1-Apr-05 3:04
balaclavabob1-Apr-05 3:04 
GeneralExport from Access DB to MSSQL and Back Pin
gearly31-Mar-05 8:11
gearly31-Mar-05 8:11 
GeneralRe: Export from Access DB to MSSQL and Back Pin
NewbieStats31-Mar-05 9:49
NewbieStats31-Mar-05 9:49 
GeneralMFC Newbie - need help to get started Pin
TheSatori31-Mar-05 7:45
sussTheSatori31-Mar-05 7:45 
Hello there Smile | :)

I am new to MFC, and to learn it, I am following a tutorial which can be found at:

http://www.functionx.com/visualc/Lesson01.htm

(amongst other places)

When I compile the file, I get the following error:

LNK1561: entry point must be defined.

I am using Windows XP Professional, and programming with Visual Studio .NET 2003. I created an empty C/C++ project ("Empty Project(.NET)"), and added the single file specified below.
I have set the following properties for my project (accessed via. Project -> [ProjectName] Properties):

General:
- Use of MFC: Use MFC in a shared DLL

C/C++ -> Precompiled headers:
- Create/use precompiled headers: Not Using precompiled headers

I did this due to some other errors which occurred when I did not make these other alternations. I google-d the error-messages to know what to change in my project properties.

However, this problem completely eludes me. I read somewhere that it could be because there is no main() method (makes sense - the app won't know where to start), but when I added it, the program compiled, and ran, but all it did was to pop up a console window for about 5 seconds, and then program exited with no errors. The main I added looks like this:

int main() {<br />
return 1;<br />
}


(since there is a global variable theApp which represents the Frame/application (see below), it gets initialized before "return 1" occurs).

I am using the below code for my application (and nothing else):

CExerciseApp.cpp
#include <afxwin.h><br />
<br />
class CExerciseApp : public CWinApp<br />
{<br />
public:<br />
	virtual BOOL InitInstance();<br />
};<br />
<br />
class CMainFrame : public CFrameWnd<br />
{<br />
public:<br />
	CMainFrame();<br />
};<br />
<br />
CMainFrame::CMainFrame()<br />
{<br />
	Create(NULL, "MFC Fundamentals");<br />
}<br />
<br />
BOOL CExerciseApp::InitInstance()<br />
{<br />
	m_pMainWnd = new CMainFrame;<br />
	m_pMainWnd->ShowWindow(SW_NORMAL);<br />
<br />
	return TRUE;<br />
}<br />
<br />
CExerciseApp theApp;


I need this to work to continue on with the example, and really start learning MFC - help Sniff | :^)
GeneralRe: MFC Newbie - need help to get started Pin
Christian Graus31-Mar-05 13:33
protectorChristian Graus31-Mar-05 13:33 
Generalfunction for size of file Pin
smriti12331-Mar-05 7:42
smriti12331-Mar-05 7:42 
GeneralRe: function for size of file Pin
Chris Meech31-Mar-05 8:22
Chris Meech31-Mar-05 8:22 
GeneralRe: function for size of file Pin
David Crow31-Mar-05 9:36
David Crow31-Mar-05 9:36 
GeneralRe: function for size of file Pin
Blake Miller1-Apr-05 5:10
Blake Miller1-Apr-05 5:10 
GeneralRe: function for size of file Pin
David Crow1-Apr-05 5:21
David Crow1-Apr-05 5:21 
GeneralAncient Newbie Can't Find Class Wizard Pin
dhamilton31-Mar-05 7:36
dhamilton31-Mar-05 7:36 
GeneralRe: Ancient Newbie Can't Find Class Wizard Pin
Nemanja Trifunovic31-Mar-05 9:03
Nemanja Trifunovic31-Mar-05 9:03 
GeneralRe: Ancient Newbie Can't Find Class Wizard Pin
dhamilton31-Mar-05 9:19
dhamilton31-Mar-05 9:19 
GeneralExternal C++ Scripts Pin
NewbieStats31-Mar-05 7:20
NewbieStats31-Mar-05 7:20 
GeneralRe: External C++ Scripts Pin
Chris Losinger31-Mar-05 8:36
professionalChris Losinger31-Mar-05 8:36 
GeneralRe: External C++ Scripts Pin
toxcct31-Mar-05 19:59
toxcct31-Mar-05 19:59 
GeneralPassing arguments to a worker thread function Pin
gecool31-Mar-05 7:04
gecool31-Mar-05 7:04 
GeneralRe: Passing arguments to a worker thread function Pin
Chris Meech31-Mar-05 8:17
Chris Meech31-Mar-05 8:17 
GeneralRe: Passing arguments to a worker thread function Pin
ThatsAlok31-Mar-05 17:58
ThatsAlok31-Mar-05 17:58 
GeneralQuestion about CFileDialog Pin
Fernando A. Gomez F.31-Mar-05 6:33
Fernando A. Gomez F.31-Mar-05 6:33 
GeneralRe: Question about CFileDialog Pin
Chris Losinger31-Mar-05 6:58
professionalChris Losinger31-Mar-05 6:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.