Click here to Skip to main content
15,892,965 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: 'Forward Class Declaration' Not Working Pin
AmbiguousName12-May-12 22:29
AmbiguousName12-May-12 22:29 
GeneralRe: 'Forward Class Declaration' Not Working Pin
Richard MacCutchan12-May-12 22:34
mveRichard MacCutchan12-May-12 22:34 
AnswerRe: 'Forward Class Declaration' Not Working Pin
AmbiguousName12-May-12 22:56
AmbiguousName12-May-12 22:56 
GeneralRe: 'Forward Class Declaration' Not Working Pin
Richard MacCutchan13-May-12 1:18
mveRichard MacCutchan13-May-12 1:18 
AnswerRe: 'Forward Class Declaration' Not Working Pin
krmed13-May-12 3:34
krmed13-May-12 3:34 
GeneralRe: 'Forward Class Declaration' Not Working Pin
Richard MacCutchan13-May-12 5:04
mveRichard MacCutchan13-May-12 5:04 
GeneralRe: 'Forward Class Declaration' Not Working Pin
AmbiguousName13-May-12 6:59
AmbiguousName13-May-12 6:59 
QuestionSubclass Procedure failed for edit control Pin
vishalgpt12-May-12 3:09
vishalgpt12-May-12 3:09 
Hi to all, I am subclassing an EDIT Control. But the WM_CREATE is not fired in Subclassed Procedure EditProc. What is wrong, i am unable to find. I had tried WM_NCCREATE also, but failed.

pls help.. Frown | :( Confused | :confused:

C++
#include <Windows.h>
#include "resource.h"

WNDPROC OldEditProc;
HINSTANCE hInst;
HFONT hFont;
	
WNDPROC SUBCLASS(HWND hControl,WNDPROC newWindowProc)
{
	return (WNDPROC)SetWindowLong(hControl,GWL_WNDPROC,(LONG)newWindowProc);
}


LRESULT CALLBACK EditProc(HWND hWnd,UINT Msg, WPARAM wParam, LPARAM lParam)
{
	switch(Msg)
	{
	case WM_CREATE:
		SetWindowText(hWnd,L"Welcome");
		break;
	}
	return OldEditProc(hWnd,Msg,wParam,lParam);
}

LRESULT CALLBACK stdEditProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{

	switch(Msg)
	{
	case WM_INITDIALOG:
		OldEditProc = SUBCLASS(GetDlgItem(hWnd,IDC_EDIT1),EditProc);
		break;
	case WM_CLOSE:
		EndDialog(hWnd,TRUE);
		break;
	}
	return FALSE;
}

INT APIENTRY wWinMain( __in HINSTANCE hInstance, __in_opt HINSTANCE hPrevInstance, __in_opt LPWSTR lpCmdLine, __in int nShowCmd )
{
	hInst = hInstance;
	return DialogBox(hInst,MAKEINTRESOURCE(IDD_DIALOG1),NULL,(DLGPROC)stdEditProc);
}

Regards,
Vishal

AnswerRe: Subclass Procedure failed for edit control Pin
«_Superman_»12-May-12 4:25
professional«_Superman_»12-May-12 4:25 
GeneralRe: Subclass Procedure failed for edit control Pin
vishalgpt12-May-12 4:40
vishalgpt12-May-12 4:40 
GeneralRe: Subclass Procedure failed for edit control Pin
«_Superman_»12-May-12 4:47
professional«_Superman_»12-May-12 4:47 
GeneralRe: Subclass Procedure failed for edit control Pin
vishalgpt12-May-12 5:36
vishalgpt12-May-12 5:36 
QuestionOpening files in c++ Pin
Jirik60727713612-May-12 2:38
Jirik60727713612-May-12 2:38 
AnswerRe: Opening files in c++ Pin
Richard MacCutchan12-May-12 2:51
mveRichard MacCutchan12-May-12 2:51 
GeneralRe: Opening files in c++ Pin
Jirik60727713612-May-12 2:56
Jirik60727713612-May-12 2:56 
AnswerRe: Opening files in c++ Pin
«_Superman_»12-May-12 4:29
professional«_Superman_»12-May-12 4:29 
Question64 bit option not coming Pin
appollosputnik11-May-12 7:28
appollosputnik11-May-12 7:28 
AnswerRe: 64 bit option not coming Pin
Albert Holguin11-May-12 8:08
professionalAlbert Holguin11-May-12 8:08 
QuestionRe: 64 bit option not coming Pin
Randor 11-May-12 8:38
professional Randor 11-May-12 8:38 
AnswerRe: 64 bit option not coming Pin
«_Superman_»11-May-12 17:34
professional«_Superman_»11-May-12 17:34 
GeneralRe: 64 bit option not coming Pin
Chris Losinger11-May-12 17:39
professionalChris Losinger11-May-12 17:39 
AnswerRe: 64 bit option not coming Pin
Luc Pattyn12-May-12 6:34
sitebuilderLuc Pattyn12-May-12 6:34 
QuestionCHtmlView for FireFox and other browsers Pin
BadJerry11-May-12 1:32
BadJerry11-May-12 1:32 
AnswerRe: CHtmlView for FireFox and other browsers Pin
Chris Losinger11-May-12 3:41
professionalChris Losinger11-May-12 3:41 
GeneralRe: CHtmlView for FireFox and other browsers Pin
BadJerry11-May-12 3:56
BadJerry11-May-12 3:56 

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.