|
Terry O`Nolley wrote:
Is there a way to tell VisualStudio to show all of the windows messages?
There is a filter within the class wizard, that based upon the MFC class that your class inherits from, the wizard will filter what messages it will build for you. Fortunately you can change the filter. I can't remember the tab, but within the wizard dialog somewhere you change the setting from CDialog to CWnd, the wizard will allow to pick from other messages like WM_GETMINMAXINFO.
Chris Meech
If you spin a Chinese person around, do they become dis-oriented?
Why do people in this time period worry so much about time traveler's destroying their worldline when they have no problem doing it themselves every day? John Titor.
|
|
|
|
|
|
Is it a form view class?
If so then you need to do it within the ChildFrame (not FormView)
|
|
|
|
|
No, it is a dialog-based app.
|
|
|
|
|
In that case you have to write a OnSizing handler...
something like this:
void CMyDlg::OnSizing(UINT fwSide, LPRECT pRect)
{
CDialog::OnSizing(fwSide, pRect);
int nMinHeight = GetSystemMetrics(SM_CXHSCROLL)*12;
if (pRect->bottom - pRect->top < nMinHeight)
{
if (fwSide == WMSZ_TOP|| fwSide == WMSZ_TOPLEFT || fwSide == WMSZ_TOPRIGHT)
pRect->top = pRect->bottom - nMinHeight;
else pRect->bottom = pRect->top + nMinHeight;
}
} // OnSizing
|
|
|
|
|
Thanks much! Between DavidCrow showing me how to set absolute width and height by handling GetMinMaxInfo and your pointer to the OnSizing handler (I had been trying to do all of this in OnSize - which is sent after the resize) so I can force the window to stay proportional, I think I am finished.
So now that I have written it I can begin documenting it
|
|
|
|
|
Try looking up WM_SIZING. It looks like it should help.
Or possibly WM_WINDOWPOSCHANGING.
Iain.
|
|
|
|
|
I am trying to display my result this way:
Volumes Amounts
22 12
45 89
897 954
Total: 1055
When I run the program I get this:
Please help
Volumes Amounts
22 12
45 89
897 954
Total: 1055
cout<<"\nTotal number of bills: "<<num<<endl;
if (num="">0)
{
cout<
|
|
|
|
|
sardinka wrote:
I am trying to display my result this way:
Volumes Amounts
22 12
45 89
897 954
Total: 1055
When I run the program I get this:
Please help
Volumes Amounts
22 12
45 89
897 954
Total: 1055
What you want and what you are getting appear to be the same. So what is the problem?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
sardinka wrote:
I am trying to display my result this way:
Volumes Amounts
22 12
45 89
897 954
Total: 1055
When I run the program I get this:
Volumes Amounts
22 12
45 89
897 954
Total: 1055
I'm not sure what you are asking. To me, the output looks exactly the way you described it should look.....
Could you edit your post and use the < PRE> tags if you are having a spacing problem - without the < PRE>tags, youd output looks just like you describe it.
|
|
|
|
|
I am trying to display my result this way:
Volumes Amounts
22 12
45 89
897 954
Total: 1055
When I run the program I get this:
Volumes Amounts
22 12
45 89
897 954
Total: 1055
|
|
|
|
|
get rid of one of the \t's in your output.
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
I am creating a button control and I want to set some parts of this button to be transparent. I am using SetLayeredWindowAttributes API but it is not giving any result.
It returns FALSE value and when I get the last error I got “The parameter is incorrect”. Is there something wrong in what I am doing or may be this API does not work with controls?
My code is as follows:
int CMyButtonCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (COleControl::OnCreate(lpCreateStruct) == -1)
return -1;
SetWindowLong(m_hWnd, GWL_EXSTYLE, GetWindowLong(m_hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);
HMODULE hUser32 = GetModuleHandle(_T("USER32.DLL"));
g_pSetLayeredWindowAttributes = (lpfn)GetProcAddress(hUser32,
"SetLayeredWindowAttributes");
COLORREF col = RGB(255, 0, 0);
BOOL bResult = g_pSetLayeredWindowAttributes(m_hWnd, col, 150, LWA_COLORKEY);
if (!bResult)
{
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL);
AfxMessageBox((LPCTSTR)lpMsgBuf);
}
}
Any ideas?
Daed
|
|
|
|
|
As I recall, you can set WS_EX_LAYERED style only to Popup windows...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
What type has CONTROL resource ?
For enumerating ActiveX controls in a Cdialog Template
in call
[code]
BOOL EnumResourceNames(
HMODULE hModule,
LPCTSTR lpszType,
ENUMRESNAMEPROC lpEnumFunc,
LONG_PTR lParam
);
[/code]
This enumerates all controls in module,
but is there method that enumertates controls in
choosed CDialog template ?
thanks.
|
|
|
|
|
Hi,
I'm looking for some code that can manipulate 64 bit integers via 2 32bit vars. And what would be even better would be to wrap them in a class and provide operator overloads so you could just treat it like a regualr integer. something like
class int64 {
public:
unsigned long hi;
unsigned long lo;
};
int64 i = 23;
int64 h = 2234343433234;
i++;
i = h + i * 23;
Anyone ever done anything like this? I haven't found much yet (though I'm still looking)
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
I do these with things with shifting ( << or >> ) but if you do a little more, its better to make a class.
It helps to eliminate bugs.
Try this @ home. (B&B)
|
|
|
|
|
how do you do the adding with the 2 32bit vals (hi and lo) using the shift operators? (sorry if this is a stupid question I've never done this)
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
64-bit integers are handled by the compilor, just
use INT64 instead of int
if you need to access the hi and lo parts, then I suppose, you could just define a union
|
|
|
|
|
Let me qualify:
the solution needs to work on non VC compilers and cross platform. So using an INT64 is out.
Plus even if you did, I don't think it will let you write
INT64 num1;
INT64 num2 = 48939434434343;
num1 = 23 + 34 + num2;
Will it?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
See if either of these two articles give you any ideas:
http://www.codeproject.com/cpp/cint96.asp
http://www.codeproject.com/system/cfile64.asp
They don't directly answer your question, but every little bit helps! Also, try searching the Net for ULARGE_INTEGER and see how it is handled.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
http://www.codeproject.com/cpp/cint96.asp
is SOOO close to what I want. But when I looked at how PJ did it, he cheated!! He used the internal MS __int64 type to help with the math routines. Unfortunately I need to make this work on multiple compilers, so I can't use this. Damn. Oh well there are still some good ideas.
Thanks
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
I remember Jack Crenshaw published 64 bit integer math library in Embedded System Programming several years ago. I don't think it was a class, just a typedef with basic math functions written in C.
Good luck. If you find anything useful let us know.
|
|
|
|
|
I will, whatever I figure out I intentend to write an article on.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Hiya I need some code to make my subitems in list control editable. I have downloaded code samples and tryed them all, to incorporate them into my project, but with all of them, it is a nightmare to get it in to work.
I have the item and subitem index numbers.
Can someone plz give me some simple code to edit the chosen subitem??
Thanks,
IrishSonic.
|
|
|
|