|
you forgot:
Rektangel class default constructor (declaration & definition).Kvadrat(int laengde, int bredde) constructor definition.Kvadrat destructor definition
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You beat me to it, you addict.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: You beat me to it, you addict.
Shhhhhhhhhh, don't spread such rumors.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
hi i was just wondeing if anyone knew how to use the mircosoft sam voice just to make a fun little program, an example would be say an edit box for user input then a button to have the computer speak the words, i found this documentation on mircosoft but my compiler, Borland 6, had some problems with the included header files.. ick. http://msdn2.microsoft.com/en-us/library/ms717065(VS.85).aspx[^] thats the microsoft page, any help would be appricated
thanks in addvance
sorry about the crappy spelling
i ned more skooling
|
|
|
|
|
codeinelogic wrote: ...i found this documentation on mircosoft but my compiler, Borland 6, had some problems with the included header files..
And what did you think would happen?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Problem Description:- I want to show a message when any windows is closing, but only when user clicks on the right most X symbol of the window, not with ALT-F4 key press and any other method like for example file->exit.
I have one working solution with me but just wanted to know whether the function which i am using is correct or not. Basically wanted to know about the GetAsyncKeyState because i read this in MSDN
-------
Although the least significant bit of the return value indicates whether the key has been pressed since the last query, due to the pre-emptive multitasking nature of Windows, another application can call GetAsyncKeyState and receive the "recently pressed" bit instead of your application. The behavior of the least significant bit of the return value is retained strictly for compatibility with 16-bit Windows applications (which are non-preemptive) and should not be relied upon.
--------
can anybody suggest me that GetAsyncKeyState is fine or any other function on which we can rely upon
Here is the code snippet:
LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg,WPARAM wParam, LPARAM lParam)
{
LRESULT result=0L;
int k=0;
switch(Msg)
{
case WM_NCLBUTTONDOWN:
if (wParam!=HTCLOSE) // allow clicks on system menu to continue and proceed
{
DefWindowProc(hWnd, Msg, wParam, lParam);
return 0;
}
GetAsyncKeyState(VK_LBUTTON);
break;
case WM_NCLBUTTONUP:
if ((int)wParam ==HTCLOSE && !(GetAsyncKeyState(VK_LBUTTON)))
{
k=MessageBoxA(NULL, "Do u wish to close ", "getasynckeystate", MB_YESNO);
if (k==IDYES)
{
PostMessage(hWnd, WM_CLOSE, 0, 0L);
return 0;
}
else
{
DefWindowProc(hWnd, Msg, wParam, lParam);
}
}
DefWindowProc(hWnd, Msg, wParam, lParam);
break;
case WM_DESTROY:PostQuitMessage(WM_QUIT);// then close it
break;
default : return DefWindowProc(hWnd, Msg, wParam, lParam);// Process the left-over messages
}
return result;
}
Bibhakar Ranjan
|
|
|
|
|
1/ Use the pre tags as the posting guidelines at the top of the forum say - your code was unreadable until I pasted it into VC++ and auto formatted it. And I only did that because I'm waiting for a phone call. Most people aren't this nice - I'm not normally.
2/ Your actual question. Looking at the page for GetASyncKeyState...
However, it checks on the state of the physical mouse buttons, not on the logical mouse buttons that the physical buttons are mapped to.
So from the very start your code is not right - what about a left handed user?
Also:
due to the pre-emptive multitasking nature of Windows, another application can call GetAsyncKeyState and receive the "recently pressed" bit instead of your application
So, you're not safe if another program uses the function either. Basically, this is a 16bit cooperative multitasking function, of no use in any program written after 1998.
I'm assuming you're using it to make sure that when you look at a WM_NCLBUTTONUP message, it had an earlier down?
I think you'll need to monitor the following messages:
WM_NCLBUTTONDOWN:
As you've done, but set a flag saying you're now interested.
WM_CAPTURECHANGED:
If the "I'm interested" flag is set, clear it.
WM_NCLBUTTONUP:
If your flag is set, post a "do my custom quite message box" message, and handle that, otherwise pass on the message.
That should be a bit safer for you, I hope! I've include the capture changing message, as I'm pretty sure it will help, in case someone clicks down on the X, moves the mouse away, then let's go of the button. Set a breakpoint and see if I'm a genius, or talking rubbish.
Good luck!
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Hi,
I have written a code like this:
.h file
=======
class CPressuresResultsPropertyPage : public CPropertyPage
{
CBitmapButton m_BitMapButton;
};
.cpp file
=========
BOOL CPressuresResultsPropertyPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
m_BitMapButton.AutoLoad(IDC_ROTATE,this);
}
After VS2005 conversion the button is not loading the bitmap IDC_ROTATE.Before that it was working properly.
If the dialogs immediate base class is CDialog then it is loading the bitmap.Eventhough CPropertyPage is inherited from CDialog
the bitmap is not getting loaded.
Thanks.
|
|
|
|
|
are you sure the bitmap ID is valid?
Please break into CBitmapButton::AutoLoad function in debug mode and check what is the strange thing happening?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
yes,bitmap id is valid.If i go into Autoload,it is returning success.
Please help.It is urgent.
Thanks.
|
|
|
|
|
Did you set bitmap to true of preperty window of Button?
|
|
|
|
|
Hi,
Thanks for your suggestion.
Bitmap is set to false.That way it is working before VS2005 conversion.Not only that if we make the base class CDialog then tha bitmap is coming.CPropertyPage also has tha base class as CDialog.
But as per the design i cannot chabge the base class to CDialog.
Please suggest a solution.
Regards.
|
|
|
|
|
You must set bitmap to true if you want bitmap on the button but also yo can use of OwnerDraw for set bitmap and some effects to button.
|
|
|
|
|
Hi,
We are settignowner draw to true and then trying to load the bitmap on to the button.It was working properly before VS2005.
Please help.
Thanks.
|
|
|
|
|
Does it work on the vs2003 and not work at vs2005?
|
|
|
|
|
In Visual Studio 6.0 it was working.In Visual Studio 2005 it is not working.
|
|
|
|
|
|
I'm looking to add namespaces to my project, but am confused about some technicalities.
Situation
- I have a number of normal .h and .cpp files for each class.
- To the top of the .h files I've added (with corresponding close brackets):
<br />
namespace proj {<br />
namespace data {<br />
- To the top of the .cpp files I've added
<br />
using namespace proj::data;<br />
- I've got the additional using namespace X for lower-level namespaces.
This is all okay, but namespaces do not lead to compiler visibility, so I still need all the #includes I used to have.
Potential Solution?
I've started creating .h files to include all the classes in a namespace, so you get something along the lines of:
<br />
#include "ns_proj_data.h"<br />
...<br />
using namespace proj::data;<br />
As I put all the files back into my project, I can foresee a situation where I need to be careful about these #includes to know exactly what files are going where.
Question:
Do other people use namespaces like this, or am I getting the wrong end of the stick?
Should I just ditch the idea of namespaces and just use the #includes I've used for years?
Thanks for your time,
Dave.
|
|
|
|
|
davidgsteadman wrote: This is all okay, but namespaces do not lead to compiler visibility, so I still need all the #includes I used to have.
Sure.
Namepaces do not need to visibility, they lead to invisibility.
They are a tool to allow programmers to have several classes name CProperty in their Project.
One in the namespace Widget and one in the Namespace Thingie.
You then tell the comoiler (via direct :: notation or via using) which class you want to use.
The compiler still has to know the declarations of the Classes to use them.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
I need to convert DWORD to Date time. Can any one suggest me
|
|
|
|
|
Please detail.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I have a DWORD value 524642425 I need to see this value in Date Time
Can i know how to use to get the value using COleDateTime.
|
|
|
|
|
OK. But what does it represent (i.e. How did you obtained it? Is it the result of any API call?)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
What CPallini wanted to know (I suppose) is how is your date coded into your DWORD ?
|
|
|
|
|
Yes I using a dll the DWORD is return from that dll and the Datetime is coded in that value.I want to check that date and time in vc++
|
|
|
|