|
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.
|
|
|
|
|
I haven't been able to get this to work yet, but I know it does (my code is just messed up I think)... it's pretty simple to understand it if you read through it properly.
http://www.codeguru.com/listview/edit_subitems.shtml[^]
good luck (if you run into the same problem as me, see my recent post, and figure out how to fix it, please let me know!!)
|
|
|
|
|
Hiya b_girl.
Thanks for that. That is some of the code I can't get to work for me. Will give it another go and let you know.
IrishSonic
|
|
|
|
|
Sounds good. I'm still trying to get it to work for me as well, so if I get it, I'll let you know as well.
|
|
|
|
|
I have it basically working now (finally). In my application I never wanted to give the user the ability to edit the first column, only the second column (there will only ever be 2 columns in my app). So what I did was just remove the code that determines the column number, and replace it with just setting colnum = 1
So now, a user can click anywhere in the row (I have the extended style LVS_EX_FULLROWSELECT set) and the second column will be available for in-place editing.
My only problem now, is it messes up on vertical scroll. I have removed the functionality for the horizontal scroll because I don't need it. But I can't figure out how to even get that vertical scroll function to be called. I'm not able to use the WM_VSCROLL message, and I think that's what I need to do, so I'm stuck again.
If you're doing something similar to me (having 2 columns and only ever needing to edit the second one) and you're still needing a bit of help let me know.
|
|
|
|
|
Hiya b_girl
Couldn't at all get the sample code to work for me. Tried for at least 3 days.
Anyway went searching the net again and found a different example
www.codeproject.com/listctrl/editing_subitems_in_listcontrol.asp
Got this to work for me last night. For my project I did have to tweak it for my needs. The code is alot simplier than the other one and it is one of those projects that compiles and works. Nothing more annoying than downloading a project and it doesn't compile.
You should definitely check it out.
|
|
|
|