Click here to Skip to main content
16,004,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Setting color to Picture control Pin
sabapathy_806-Jan-09 0:38
sabapathy_806-Jan-09 0:38 
GeneralRe: Setting color to Picture control Pin
Hamid_RT6-Jan-09 7:21
Hamid_RT6-Jan-09 7:21 
QuestionUnhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Radhakrishnan G.5-Jan-09 22:40
Radhakrishnan G.5-Jan-09 22:40 
AnswerRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Cedric Moonen5-Jan-09 22:42
Cedric Moonen5-Jan-09 22:42 
GeneralRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Radhakrishnan G.5-Jan-09 22:49
Radhakrishnan G.5-Jan-09 22:49 
GeneralRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Cedric Moonen5-Jan-09 23:07
Cedric Moonen5-Jan-09 23:07 
AnswerRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Jijo.Raj5-Jan-09 23:11
Jijo.Raj5-Jan-09 23:11 
GeneralRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. [modified] Pin
Radhakrishnan G.5-Jan-09 23:29
Radhakrishnan G.5-Jan-09 23:29 
Here is the code of Dialog Proc
INT_PTR CALLBACK DisplaySettingsPage::DisplaySettingsPageDlgProc( HWND hWnd_i,
                                                                  UINT uMessage_i,
                				                  WPARAM wParam_i,
                                                                  LPARAM lParam_i )
{
    // Get user data from the window.
    DisplaySettingsPage* pDisplaySettingsPage = reinterpret_cast<displaysettingspage*>( GetWindowLong( hWnd_i, GWL_USERDATA ));
    switch (uMessage_i)
    {
    case WM_INITDIALOG:
		{
			pDisplaySettingsPage = reinterpret_cast<displaysettingspage*>( lParam_i );
			if( 0 != pDisplaySettingsPage )
			{
                                // Set user data
				SetWindowLong( hWnd_i, GWL_USERDATA, lParam_i );
				pDisplaySettingsPage->m_hWnd = hWnd_i;
				pDisplaySettingsPage->OnInitDialog();
			}
			return TRUE;
		}
        break;
	case WM_CTLCOLORSTATIC:
		{
			if( IDC_STATIC_BKCOLOR == GetDlgCtrlID( (HWND)lParam_i ))
			{
				RECT stRect;
				GetClientRect( (HWND)lParam_i, &stRect );
				FillRect( (HDC)wParam_i, &stRect, pDisplaySettingsPage->m_hBkBrush);
				return (BOOL)GetStockObject(NULL_BRUSH);
			}
		}
		break;
	case WM_NOTIFY:
		{
			NMHDR* pstNMHDR = reinterpret_cast< NMHDR*>( lParam_i );
			if( PSN_APPLY == pstNMHDR->code )
			{
			}
		}
		break;
	case WM_COMMAND:
		{
			int nCtrlCode = LOWORD( wParam_i );
			if( IDC_BTN_CHANGE_COLORS == nCtrlCode )
			{
				pDisplaySettingsPage->OnChangeColor();
			}
		}
		break;
    }
    return DefWindowProc( hWnd_i, uMessage_i, wParam_i, lParam_i );
}

Here is the Display setting page class
class DisplaySettingsPage  
{
public:
	DisplaySettingsPage();
	~DisplaySettingsPage();
	
        operator LPPROPSHEETPAGE();

        static INT_PTR CALLBACK DisplaySettingsPageDlgProc( HWND hWnd_i, UINT uMessage_i,
		                                            WPARAM wParam_i, LPARAM lParam_i );
	
	void OnInitDialog();
	void OnChangeColor();
	
private:
	
    HWND          m_hWnd; // Handle to the Property page
    HBRUSH        m_hBkBrush;
    PROPSHEETPAGE m_stPropertyPage; // Property page information.

};


Initializing Property page information in constructor
DisplaySettingsPage::DisplaySettingsPage() : m_hWnd( 0 ),
											 m_hBkBrush( 0 )
{
    ZeroMemory( &m_stPropertyPage, sizeof( PROPSHEETPAGE ));
    m_stPropertyPage.dwSize     = sizeof( PROPSHEETPAGE );
    m_stPropertyPage.dwFlags    = PSP_DEFAULT;
    m_stPropertyPage.pszTemplate = MAKEINTRESOURCE( IDD_DISPLAY_SETTINGS_PAGE );
    m_stPropertyPage.lParam     = reinterpret_cast<lparam>( this );
    m_stPropertyPage.hInstance  = GetModuleHandle( 0 );
    m_stPropertyPage.pfnDlgProc = DisplaySettingsPageDlgProc;
}</lparam>


modified on Tuesday, January 6, 2009 5:55 AM

GeneralRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Jijo.Raj6-Jan-09 0:08
Jijo.Raj6-Jan-09 0:08 
AnswerRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Naveen6-Jan-09 0:01
Naveen6-Jan-09 0:01 
AnswerRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Radhakrishnan G.6-Jan-09 0:21
Radhakrishnan G.6-Jan-09 0:21 
AnswerRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Stuart Dootson6-Jan-09 0:44
professionalStuart Dootson6-Jan-09 0:44 
GeneralRe: Unhandled exception in PathEdit.exe (COMDLG32.DLL): 0xC0000005: Access Violation. Pin
Radhakrishnan G.6-Jan-09 4:02
Radhakrishnan G.6-Jan-09 4:02 
QuestionCreateSerivce get stuck for 2.5 minutes Pin
Green Fuze5-Jan-09 22:00
Green Fuze5-Jan-09 22:00 
AnswerRe: CreateSerivce get stuck for 2.5 minutes Pin
Randor 6-Jan-09 19:16
professional Randor 6-Jan-09 19:16 
QuestionHow to retrieve drive letter of a USB device from WMI for a given DeviceID Pin
Subrat Patnaik5-Jan-09 21:34
Subrat Patnaik5-Jan-09 21:34 
AnswerRe: How to retrieve drive letter of a USB device from WMI for a given DeviceID Pin
Sarath C5-Jan-09 21:41
Sarath C5-Jan-09 21:41 
AnswerRe: How to retrieve drive letter of a USB device from WMI for a given DeviceID Pin
Hamid_RT5-Jan-09 21:52
Hamid_RT5-Jan-09 21:52 
Questionhow to get installed font list of Windows XP?? Pin
vijay.victory5-Jan-09 20:32
vijay.victory5-Jan-09 20:32 
AnswerRe: how to get installed font list of Windows XP?? Pin
Naveen5-Jan-09 20:46
Naveen5-Jan-09 20:46 
GeneralRe: how to get installed font list of Windows XP?? Pin
Hamid_RT5-Jan-09 20:54
Hamid_RT5-Jan-09 20:54 
GeneralRe: how to get installed font list of Windows XP?? Pin
Naveen5-Jan-09 20:59
Naveen5-Jan-09 20:59 
GeneralRe: how to get installed font list of Windows XP?? Pin
Cedric Moonen5-Jan-09 21:13
Cedric Moonen5-Jan-09 21:13 
GeneralRe: how to get installed font list of Windows XP?? Pin
Naveen5-Jan-09 21:20
Naveen5-Jan-09 21:20 
GeneralRe: how to get installed font list of Windows XP?? Pin
Hamid_RT5-Jan-09 21:24
Hamid_RT5-Jan-09 21:24 

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.