Sign in to follow this  

Win32 VS2005 Dialog box classes

This topic is 3569 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was trying to make a class for my dialog box ( just learned about this a couple of hrs ago by mistake) and im pretty much confused tho i sorta now whats going on. Was wondering if any one knows any good tutorials sites? I have been looking for some the past hr or so and cant find jack. Thanks.

Share this post


Link to post
Share on other sites
Check out FunctionX .. Google search it its got some good stuff for win32 api.

As for future post it does help us out greatly here at game dev if you tell use what langauge you are currently useing for the project or what you are learning so we know what direction you are trying to head in.

Regards Jouei.

Share this post


Link to post
Share on other sites
Sorry for the lack of information the topic was new to me. Just found out the topic is Microsoft Foundation Class (MFC) I am looking for a good tutorial to make a simple MFC class where I can make a modeless dialog boxes for the interface of the program which will be a Lan server for the game I am working on.

I have found some stuff but they do too indepth and I dont want to do anything fancy I have other stuff to learn (working on group project and I am doing networking) and this is not really important for the project I am worknig on. I am coding in VS2005 and using C++.

I found this tutorial

Quote:

http://www.devarticles.com/c/a/Cplusplus/Using-MFC-in-Cplus-Basic-Application-Skeleton/


It was originally done in VS 6 and when I compile the turial in VS2005 I get errors ive managed to sus most of them out except for a couple so its kinda anoying me.

This is the error I get

Quote:

------ Build started: Project: FFS!, Configuration: Debug Win32 ------
Compiling...
MYclass.cpp
WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)
Linking...
MYclass.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_MSGMAP const * __thiscall CMainWin::GetMessageMap(void)const " (?GetMessageMap@CMainWin@@MBEPBUAFX_MSGMAP@@XZ)
C:\Documents and Settings\Kelvin\My Documents\Visual Studio 2005\Projects\FFS!\Debug\FFS!.exe : fatal error LNK1120: 1 unresolved externals


And here is the code i have in the .h



class CMainWin : public CFrameWnd

{

public:

CMainWin();

DECLARE_MESSAGE_MAP()

};

class CApp : public CWinApp

{

public:

BOOL InitInstance();

};




and in the .cpp


// Header for the MFC classes
#include <afxwin.h>

#include "MYclass.h"

CMainWin::CMainWin()

{

Create(NULL, "My MFC Application");

}

BOOL CApp::InitInstance()
{
try

{

m_pMainWnd = new CMainWin;

m_pMainWnd->ShowWindow(m_nCmdShow);

m_pMainWnd->UpdateWindow();

return TRUE;

}

catch(...)

{

return FALSE;

}
}



If it helps I went to new project then chosse Win32 Project, the i picked empty project and created it, then in Properties and Genral I changed "Use Unicode Character Set" to "Use Multi-Byte Character Set" and I also chose "Use MFC in a Shared DLL".

thanks for any helps guys.

Share this post


Link to post
Share on other sites
I'm not at all an MFC expert (I've never even used it, I just know some basics), but I'm pretty sure you need to but the BEGIN_MESSAGE_MAP() macro in the class implementation for CMainWin. Something like this:


BEGIN_MESSAGE_MAP(CMainWin, CFrameWnd)
ON_WM_CREATE()
END_MESSAGE_MAP()



You need to define the method "GetMessageMap" since it's declared as part of the DECLARE_MESSAGE_MAP macro.


Share this post


Link to post
Share on other sites

This topic is 3569 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this