Click here to Skip to main content
15,905,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Redistributing MFC from the web Pin
Cathy3-Aug-03 7:54
Cathy3-Aug-03 7:54 
GeneralWindow not receiving all its messages Pin
Marcus Spitzmiller3-Aug-03 6:07
Marcus Spitzmiller3-Aug-03 6:07 
GeneralRe: Window not receiving all its messages Pin
Cathy3-Aug-03 7:59
Cathy3-Aug-03 7:59 
GeneralRe: Window not receiving all its messages Pin
Marcus Spitzmiller3-Aug-03 8:08
Marcus Spitzmiller3-Aug-03 8:08 
GeneralRe: Window not receiving all its messages Pin
Cathy3-Aug-03 13:48
Cathy3-Aug-03 13:48 
GeneralRe: Window not receiving all its messages Pin
Joe Woodbury3-Aug-03 9:14
professionalJoe Woodbury3-Aug-03 9:14 
GeneralRe: Window not receiving all its messages Pin
Marcus Spitzmiller3-Aug-03 10:37
Marcus Spitzmiller3-Aug-03 10:37 
GeneralRe: Window not receiving all its messages Pin
Joe Woodbury3-Aug-03 18:11
professionalJoe Woodbury3-Aug-03 18:11 
I have a wave in/out class that doesn't have a problem.

First, due to where the code is used, I don't use MFC when I create the callback window. I also create it with CreateWindowEx with WS_EX_NOPARENTNOTIFY. Here's a snippet from my code:

LRESULT CALLBACK CBWaveCallback(
	HWND    hwnd,
	UINT    msg,
	WPARAM  wParam,
	LPARAM  lParam)
{
	CBWave *pWave = (CBWave *)::GetWindowLong(hwnd, 0);
	if (pWave)
	{
		switch(msg)
		{
			case MM_WOM_DONE:
				pWave->OnDataOut((HWAVEOUT) wParam, (WAVEHDR *) lParam);
				return 0L;

			case MM_WIM_DATA:
				pWave->OnDataIn((HWAVEIN) wParam, (WAVEHDR *) lParam);
				return 0L;
		}
	}

	return (DefWindowProc(hwnd, msg, wParam, lParam));
}

static TCHAR nameBase[]	= _T("CBWaveCallback");

HWND CBCreateWaveWindow(
	HINSTANCE hInst,
	HWND hWndParent,
	LONG waveClassThisPtr)
{
	TCHAR className[32];
	_tcscpy(className, nameBase);
	_tcscat(className, _T("Class"));

	WNDCLASS wndClass;
	if (!::GetClassInfo(hInst, className, &wndClass))
	{
		wndClass.style         = 0;
		wndClass.lpfnWndProc   = CBWaveCallback;
		wndClass.cbClsExtra    = 0;
		wndClass.cbWndExtra    = 4;
		wndClass.hInstance     = hInst;
		wndClass.hIcon         = NULL;
		wndClass.hCursor       = NULL;
		wndClass.hbrBackground = NULL;
		wndClass.lpszMenuName  = NULL;
		wndClass.lpszClassName = className;

		if (!::RegisterClass(&wndClass))
			return (HWND) 0;
	}
	TCHAR windowName[32];
	_tcscpy(windowName, nameBase);
	_tcscat(windowName, _T("Window"));

	HWND hWnd = ::CreateWindowEx(WS_EX_NOPARENTNOTIFY, className, windowName,
									hWndParent ? WS_CHILD : WS_POPUP, 0, 0, 0, 0, hWndParent, NULL, hInst,	NULL);

	::SetWindowLong(hWnd, 0, waveClassThisPtr);
	return hWnd;
}

GeneralRe: Window not receiving all its messages Pin
Marcus Spitzmiller4-Aug-03 3:20
Marcus Spitzmiller4-Aug-03 3:20 
GeneralFlat CComboBox and CIPAddressCtr Pin
Eugene Pustovoyt3-Aug-03 5:41
Eugene Pustovoyt3-Aug-03 5:41 
GeneralRe: Flat CComboBox and CIPAddressCtr Pin
PJ Arends3-Aug-03 8:45
professionalPJ Arends3-Aug-03 8:45 
GeneralRe: Flat CComboBox and CIPAddressCtr Pin
Eugene Pustovoyt3-Aug-03 9:07
Eugene Pustovoyt3-Aug-03 9:07 
GeneralRe: Flat CComboBox and CIPAddressCtr Pin
PJ Arends3-Aug-03 9:24
professionalPJ Arends3-Aug-03 9:24 
GeneralRe: Flat CComboBox and CIPAddressCtr Pin
Eugene Pustovoyt3-Aug-03 17:52
Eugene Pustovoyt3-Aug-03 17:52 
GeneralRe: Flat CComboBox and CIPAddressCtr Pin
PJ Arends3-Aug-03 18:36
professionalPJ Arends3-Aug-03 18:36 
QuestionDetected memory leaks..Did I solve it ? Pin
Hesham Amin3-Aug-03 5:03
Hesham Amin3-Aug-03 5:03 
AnswerRe: Detected memory leaks..Did I solve it ? Pin
John R. Shaw3-Aug-03 9:55
John R. Shaw3-Aug-03 9:55 
GeneralWndProc Within a class Pin
M.Mostafa3-Aug-03 1:16
M.Mostafa3-Aug-03 1:16 
GeneralRe: WndProc Within a class Pin
S O S3-Aug-03 3:15
S O S3-Aug-03 3:15 
GeneralRe: WndProc Within a class Pin
John R. Shaw3-Aug-03 10:05
John R. Shaw3-Aug-03 10:05 
Generalgetting files and directory. Pin
Anonymous3-Aug-03 0:40
Anonymous3-Aug-03 0:40 
GeneralRe: getting files and directory. Pin
HPSI3-Aug-03 0:54
HPSI3-Aug-03 0:54 
GeneralRe: getting files and directory. Pin
Bob Stanneveld3-Aug-03 7:49
Bob Stanneveld3-Aug-03 7:49 
Questionhow to get the other window's scrollbar handle ? Pin
yoyo2-Aug-03 23:22
yoyo2-Aug-03 23:22 
AnswerRe: how to get the other window's scrollbar handle ? Pin
HPSI3-Aug-03 1:25
HPSI3-Aug-03 1:25 

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.