Click here to Skip to main content
15,913,055 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: How to get pointer to MainFrame window in WTL? Pin
El'Cachubrey13-Jul-03 21:26
El'Cachubrey13-Jul-03 21:26 
GeneralWTL and Windows CE Pin
Joshua Nussbaum12-Jul-03 12:51
Joshua Nussbaum12-Jul-03 12:51 
GeneralRe: WTL and Windows CE Pin
Mike Dimmick13-Jul-03 7:18
Mike Dimmick13-Jul-03 7:18 
GeneralRe: WTL and Windows CE Pin
Tim Smith13-Jul-03 15:36
Tim Smith13-Jul-03 15:36 
GeneralATL7 Attributes and Registry Pin
Paul A. Howes12-Jul-03 7:09
Paul A. Howes12-Jul-03 7:09 
GeneralHTML parsing... Pin
nw6031211-Jul-03 6:47
nw6031211-Jul-03 6:47 
GeneralRe: HTML parsing... Pin
Heath Stewart11-Jul-03 8:30
protectorHeath Stewart11-Jul-03 8:30 
GeneralWindow Class :: richedit implementation error! Pin
tareqsiraj10-Jul-03 20:23
tareqsiraj10-Jul-03 20:23 
Hi ppl, I am new to ATL and trying to add a simple richedit control in a window. But i get "syntax error: missing ';' ..." everytime. Following is my source code.

CMainWindow.h
#ifndef CMainWindow_h
#define CMainWindow_h

#include "stdafx.h"
#include "CNoteEdit.h"

class CMainWindow : public CWindowImpl < CMainWindow >
{
	public:
	DECLARE_WND_CLASS_EX(TEXT("NoteMainWindowClass"), CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS, COLOR_BTNFACE)

private:
	BEGIN_MSG_MAP(CMainWindow)
		MESSAGE_HANDLER(WM_CREATE, OnCreate)
		MESSAGE_HANDLER(WM_CLOSE, OnClose)
		MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
	END_MSG_MAP()

	LRESULT OnCreate(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnClose(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnDestroy(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
};

#endif


CNoteEdit.h
#ifndef CNoteEdit_h
#define CNoteEdit_h

#include "stdafx.h"

class CNoteEdit : public CWindowImpl < CNoteEdit >
{
public:
	DECLARE_WND_SUPERCLASS(NULL, RICHEDIT_CLASS)

	BEGIN_MSG_MAP(CNoteEdit)
	END_MSG_MAP()

	CNoteEdit();
	virtual ~CNoteEdit();
};

#endif


main.cpp
#include "stdafx.h"

CComModule _Module;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	_Module.Init(0, hInstance);

	CMainWindow _MainWindow;

	_MainWindow.Create(0, CWindow::rcDefault, "Note - ", WS_OVERLAPPEDWINDOW);

	_MainWindow.ShowWindow(nShowCmd);
	_MainWindow.UpdateWindow();

	MSG msg;
	while (::GetMessage(&msg,0,0,0) > 0)
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}

	_Module.Term();
	return msg.wParam;
}

In the CMainWindow.cpp, its just code for closing the window and in CNoteEdit.cpp, it has an empty constructor and destructor. Now, if i just remove the CNoteEdit _noteEdit; line from CMainWindow.h then everything is ok (but no richedit Cry | :(( ). I know i have to create the CNoteEdit object inside my main window, but i have to get pass the error first ... i think. Plz help me find out the error! Thankx in advance.

-Tareq
GeneralRe: Window Class :: richedit implementation error! Pin
Michael Dunn11-Jul-03 17:15
sitebuilderMichael Dunn11-Jul-03 17:15 
Generalcommand_id_handler Pin
harishv10-Jul-03 11:15
harishv10-Jul-03 11:15 
GeneralRe: command_id_handler Pin
Heath Stewart11-Jul-03 8:40
protectorHeath Stewart11-Jul-03 8:40 
GeneralRe: command_id_handler Pin
harishv14-Jul-03 5:10
harishv14-Jul-03 5:10 
Generalcopying items from a map to a list Pin
User 988510-Jul-03 10:40
User 988510-Jul-03 10:40 
GeneralRe: copying items from a map to a list Pin
Andrew Walker10-Jul-03 12:16
Andrew Walker10-Jul-03 12:16 
GeneralRe: copying items from a map to a list Pin
ZoogieZork10-Jul-03 12:29
ZoogieZork10-Jul-03 12:29 
QuestionHow to modify rcBounds CRect pass t o OnDraw Pin
bachelier9-Jul-03 4:25
bachelier9-Jul-03 4:25 
GeneralCAtlArray and ETraits::INARGTYPE Pin
Peter Weyzen8-Jul-03 16:34
Peter Weyzen8-Jul-03 16:34 
Generalpair as key of map Pin
Anonymous8-Jul-03 3:05
Anonymous8-Jul-03 3:05 
GeneralRe: pair as key of map Pin
AlexO8-Jul-03 3:44
AlexO8-Jul-03 3:44 
GeneralRe: pair as key of map Pin
Anonymous8-Jul-03 4:18
Anonymous8-Jul-03 4:18 
GeneralRe: pair as key of map Pin
AlexO8-Jul-03 4:37
AlexO8-Jul-03 4:37 
GeneralRe: pair as key of map Pin
Anonymous8-Jul-03 4:46
Anonymous8-Jul-03 4:46 
GeneralRe: pair as key of map Pin
AlexO8-Jul-03 6:32
AlexO8-Jul-03 6:32 
GeneralRe: pair as key of map Pin
Joaquín M López Muñoz8-Jul-03 6:48
Joaquín M López Muñoz8-Jul-03 6:48 
GeneralRe: pair as key of map Pin
Phil Martin7-Sep-03 14:57
professionalPhil Martin7-Sep-03 14:57 

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.