oleber
asked on
max buffer size
There is a constant that represents the maximum size of a buffer. What is his name?
something to use like
char[MAX_BUFFER_SIZE] n;
something to use like
char[MAX_BUFFER_SIZE] n;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
LONG FAR PASCAL SampleMDIChildWndProc(hWnd , msg, wParam, lParam)
HWND hWnd;
WORD msg;
WORD wParam;
LONG lParam;
// This sample MDI child window procedure can be used to prevent the
// MDI child from being maximized, minimized, or sized.
//
// Note that the child will still have a maximize button, a minimize
// button, and a thick "sizing" border. Currently, there is no way to
// prevent Windows from creating MDI children with these default
// styles.
//
// We can, however, disable the maximizing, minimizing, and sizing
// functionality by:
//
// 1. Disabling system menu options
// 2. Trapping WM_SYSCOMMAND messages
{
HMENU hSystemMenu; // the MDI child's system menu
switch (msg)
{
case WM_INITMENU:
// Disable and gray the Maximize, Minimize, and Size items
// on the MDI child's system menu
hSystemMenu = GetSystemMenu(hWnd, FALSE);
EnableMenuItem(hSystemMenu , SC_MAXIMIZE, MF_GRAYED |
MF_BYCOMMAND);
EnableMenuItem(hSystemMenu , SC_MINIMIZE, MF_GRAYED |
MF_BYCOMMAND);
EnableMenuItem(hSystemMenu , SC_SIZE, MF_GRAYED |
MF_BYCOMMAND);
break;
case WM_SYSCOMMAND:
// "Eat" these system commands to disable maximizing,
// minimizing, and sizing functionality.
// Note that wParam must be combined with 0xFFF0, using
// the C bitwise AND (&) operator, when processing
// the WM_SYSCOMMAND message.
switch (wParam & 0xFFF0)
{
case SC_MAXIMIZE:
case SC_MINIMIZE:
case SC_SIZE:
return 1L;
default:
break;
}
break;
default:
break;
}
return DefMDIChildProc(hWnd, msg, wParam, lParam);
}
HWND hWnd;
WORD msg;
WORD wParam;
LONG lParam;
// This sample MDI child window procedure can be used to prevent the
// MDI child from being maximized, minimized, or sized.
//
// Note that the child will still have a maximize button, a minimize
// button, and a thick "sizing" border. Currently, there is no way to
// prevent Windows from creating MDI children with these default
// styles.
//
// We can, however, disable the maximizing, minimizing, and sizing
// functionality by:
//
// 1. Disabling system menu options
// 2. Trapping WM_SYSCOMMAND messages
{
HMENU hSystemMenu; // the MDI child's system menu
switch (msg)
{
case WM_INITMENU:
// Disable and gray the Maximize, Minimize, and Size items
// on the MDI child's system menu
hSystemMenu = GetSystemMenu(hWnd, FALSE);
EnableMenuItem(hSystemMenu
MF_BYCOMMAND);
EnableMenuItem(hSystemMenu
MF_BYCOMMAND);
EnableMenuItem(hSystemMenu
MF_BYCOMMAND);
break;
case WM_SYSCOMMAND:
// "Eat" these system commands to disable maximizing,
// minimizing, and sizing functionality.
// Note that wParam must be combined with 0xFFF0, using
// the C bitwise AND (&) operator, when processing
// the WM_SYSCOMMAND message.
switch (wParam & 0xFFF0)
{
case SC_MAXIMIZE:
case SC_MINIMIZE:
case SC_SIZE:
return 1L;
default:
break;
}
break;
default:
break;
}
return DefMDIChildProc(hWnd, msg, wParam, lParam);
}
Jane: Emily Litella! It's "Max size", not "Maximize"
Emily: Oh.... that's different.... never mind.
Emily: Oh.... that's different.... never mind.
It was just to wrong area..... That'll teach me not to view several questions at the same time... :-)
Fo certain platform supplyer may provide something like this. Actually I saw it done for G-OS (it is some obscure OS I had to work with ) but it isn't part of a standard as far as I know.
What is the real question though? How big of a buffer you can allocation on a stack?