Click here to Skip to main content
15,891,409 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Can not catch OnKeyup on CListCtrl Pin
Software_Developer20-Aug-12 9:15
Software_Developer20-Aug-12 9:15 
QuestionBITMAPINFOHEADER working in Debug but not in Release Pin
002comp19-Aug-12 21:15
002comp19-Aug-12 21:15 
AnswerRe: BITMAPINFOHEADER working in Debug but not in Release Pin
Endurion_19-Aug-12 22:39
Endurion_19-Aug-12 22:39 
GeneralRe: BITMAPINFOHEADER working in Debug but not in Release Pin
002comp19-Aug-12 22:43
002comp19-Aug-12 22:43 
GeneralRe: BITMAPINFOHEADER working in Debug but not in Release Pin
Endurion_20-Aug-12 5:01
Endurion_20-Aug-12 5:01 
AnswerRe: BITMAPINFOHEADER working in Debug but not in Release [Solved] but need one Suggestion Pin
002comp19-Aug-12 22:41
002comp19-Aug-12 22:41 
AnswerRe: BITMAPINFOHEADER working in Debug but not in Release Pin
CPallini19-Aug-12 23:00
mveCPallini19-Aug-12 23:00 
QuestionModeless Dialog box using win32 API only Pin
csrss19-Aug-12 7:14
csrss19-Aug-12 7:14 
Is there any way of doing it? I am trying to write some simple class for showing modeless dialog box and just cannot understand what is wrong with it. While it is pretty easy with DialogBoxParam - there seems to be no way with CreateDialog. My goal is to pass somehow a pointer to a class to call my dlgProc. The way i am doing it with modal dlgbox:
INT_PTR DoModal(UINT nResourceId)
{
	::InitCommonControls();
	return ::DialogBoxParam(::GetModuleHandle(NULL), 
                                 MAKEINTRESOURCE(nResourceId), 
                                 NULL, DlgProcModal, reinterpret_cast<LPARAM>(this));
}


static INT_PTR __stdcall DlgProcModal(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    ....
if( uMsg == WM_INITDIALOG )
{
	if( !pWnd )
	{
		pWnd = reinterpret_cast<CBaseDlgWindow *>(lParam);
		::SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)pWnd);
		pWnd->m_hWnd = hwndDlg;
	}
}
}


The way i am trying to do it with modeless and it is just not working:
INT_PTR DoModeless(UINT nResourceId)
{
	::InitCommonControls();
	if( m_hWnd = ::CreateDialog(::GetModuleHandle(NULL), MAKEINTRESOURCE(nResourceId), NULL, DlgProcModeless) )
	{
		m_bModeless = true;
		::SetWindowLongPtr(m_hWnd, GWLP_USERDATA, (LONG_PTR)this);
			
		MSG msg = { 0x00 };
		while (::GetMessage(&msg, m_hWnd, 0, 0)) 
		{ 
			if (!::IsDialogMessage(m_hWnd, &msg))
			{ 
				::TranslateMessage(&msg); 
				::DispatchMessage(&msg); 
			}
		}
	}
	::DestroyWindow(m_hWnd);
	return 0;
}


static INT_PTR __stdcall DlgProcModeless(
		HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
		)
{
	LONG_PTR lResult = ::GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
	CBaseDlgWindow * pWnd = reinterpret_cast<CBaseDlgWindow *>(lResult);
...
}

What am i doing wrong?
Thanks in advance.
011011010110000101100011011010000110100101101110
0110010101110011

AnswerRe: Modeless Dialog box using win32 API only Pin
pasztorpisti19-Aug-12 12:49
pasztorpisti19-Aug-12 12:49 
GeneralRe: Modeless Dialog box using win32 API only Pin
csrss19-Aug-12 21:03
csrss19-Aug-12 21:03 
GeneralRe: Modeless Dialog box using win32 API only Pin
pasztorpisti20-Aug-12 1:49
pasztorpisti20-Aug-12 1:49 
Generaljust want to find a friend Pin
cnmqy19-Aug-12 0:56
cnmqy19-Aug-12 0:56 
GeneralRe: just want to find a friend Pin
Richard MacCutchan19-Aug-12 2:37
mveRichard MacCutchan19-Aug-12 2:37 
QuestionHow to distinguish the broad packets or normal packets? Pin
wangningyu17-Aug-12 17:19
wangningyu17-Aug-12 17:19 
AnswerRe: How to distinguish the broad packets or normal packets? Pin
pasztorpisti18-Aug-12 0:33
pasztorpisti18-Aug-12 0:33 
AnswerRe: How to distinguish the broad packets or normal packets? Pin
Software_Developer18-Aug-12 3:56
Software_Developer18-Aug-12 3:56 
GeneralRe: How to distinguish the broad packets or normal packets? Pin
wangningyu22-Aug-12 21:11
wangningyu22-Aug-12 21:11 
QuestionCan AdjustTokenPrivileges elevate the privilege as Administrator? Pin
Falconapollo17-Aug-12 5:39
Falconapollo17-Aug-12 5:39 
AnswerRe: What's worong with Google Code? Pin
Richard MacCutchan17-Aug-12 6:55
mveRichard MacCutchan17-Aug-12 6:55 
AnswerRe: Can AdjustTokenPrivileges elevate the privilege as Administrator? Pin
Richard Andrew x6418-Aug-12 6:27
professionalRichard Andrew x6418-Aug-12 6:27 
QuestionC Functions and Macros Pin
roza12317-Aug-12 1:48
roza12317-Aug-12 1:48 
AnswerRe: C Functions and Macros PinPopular
Richard MacCutchan17-Aug-12 1:55
mveRichard MacCutchan17-Aug-12 1:55 
GeneralRe: C Functions and Macros Pin
roza12317-Aug-12 2:03
roza12317-Aug-12 2:03 
GeneralRe: C Functions and Macros Pin
Richard MacCutchan17-Aug-12 2:22
mveRichard MacCutchan17-Aug-12 2:22 
AnswerRe: C Functions and Macros Pin
Malli_S17-Aug-12 2:41
Malli_S17-Aug-12 2:41 

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.