|
Hi
I can't get your meaning. I check my code again. The address of the variable ltime is valid. All things looks like in order. But the error always occur.
Help!
Regards!
whiteclouds
|
|
|
|
|
|
I think I had resolved this problem. My solution is to instead the time_t with SYSTEMTIME structure. Then everything looks right. Otherwise I don't know the detail of it. I think maybe this structure was obsoleted.
|
|
|
|
|
Glad you got it working.
Thanks for sharing this.
|
|
|
|
|
I am developing an application using C++ and MFC. Please consider the following code from a Windows RC (Resource Script) file:
<br />
<br />
IDR_MAINFRAME MENU<br />
BEGIN<br />
POPUP "&File" {<br />
MENUITEM "&New", CALC_FILE_NEW<br />
MENUITEM "Calculate" CALCULATE<br />
MENUITEM "Abort Calculation" ABORT_CALCULATION,GRAYED<br />
MENUITEM "&Exit", CALC_FILE_EXIT<br />
}<br />
.<br />
.<br />
.<br />
I would expect the third menu selection to be grayed out. That is, the user should not be able to select it. However, this is not what happens. I would like to know why?
Thanks
Bob
|
|
|
|
|
I think you also have to specify that it's disabled as well.
|
|
|
|
|
Richard,
Thanks for the response. However, I do not think DISABLED is a valid option for creating the menu item. When I tried it, it would not going through the resource compiler. The line I tried
was:
<br />
MENUITEM "Abort Calculation" ABORT_CALCULATION,GRAYED,DISABLED<br />
Was that what you meant?
Bob
|
|
|
|
|
You're right. I checked the docs, and the word I was thinking of is "INACTIVE", not "disabled".
However, it says that GRAYED should do what you are looking for.
Can you say what behavior you are observing when you use just GRAYED?
|
|
|
|
|
Richard,
What I would like is the menu option to be set in such a way that the user cannot select it. In addition, when the menu is displayed, it should be displayed in such a way that it looks disabled to the user.
Thanks
Bob
|
|
|
|
|
I see that you are missing commas in a couple of locations in your MENUITEM list.
Perhaps that is the cause of the malfunction?
You're missing commas on the Calculate and Abort Calculation menu items.
|
|
|
|
|
Richard,
Thanks for the response. I tried adding those missing commas as you suggested but it did not solve my problem.
Bob
|
|
|
|
|
Hi
I need Amcap c++ source code(Active Movie Capture c++ sample), but I can not not find it in visual studio folder or in internet!
please give a link to it's source code,
thanks
www.logicsims.ir
|
|
|
|
|
|
Thank you
But I can't download Windows SDK, it's too big, I just wanna Amcap source code, I know it's DirectShow sample, and I've seen that 'How to compile AMCap' page,
www.logicsims.ir
|
|
|
|
|
Would you direct me to an address to download a "C++" Base64 De/En coding Class for free please?
Thank you masters!
|
|
|
|
|
|
|
Why not just implement the frackin thing. It is probably one of the simpler encoding schemes to implement and is about one page of code for the encoder method and one page for the decoder method.
IMO, a C/C++ programmer should have implemented the algorithm at least once in their career. Libraries are nice but implementing this one helps keep the rust out and gives you a tad more independence.
All the necessary information and links to the RFC's and sample source code are here[^]
|
|
|
|
|
How do you create a window so when someone clicks on it the click event go to the window under it? (not the parent)
thanks in advance
|
|
|
|
|
What do you mean by "the window under it"? Do you mean in the z-order, or perhaps the window that created the current window??? "the window under it" could be any window.
Whichever window you mean, it's pretty easy to notify another window of an event in the current window.
First add a WM_LBUTTONDOWN handler to both windows. (http://msdn.microsoft.com/en-us/library/ms645607(VS.85).aspx[^])
in the window class header files under DECLARE_MESSAGE_MAP()
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
in the window class source file for the window being clicked:
...
void CMyWnd::OnLButtonDown(UINT nFlags, CPoint point)
{
m_NotifyWnd.SendMessage(WM_LBUTTONDOWN);
}
...
ON_WM_LBUTTONDOWN()
...
where m_NotifyWnd is whatever window you want to notify of the click.
Also remember to add the message map for the window receiving the notification.
I did not preserve wparam and lparam across the SendMessage call, you will probably want to read up on the message (link above) and finish the code with the wparam and lparam arguments.
Insofar as finding the correct window to notify, I direct you to the following CWnd member functions to check out (since I'm not quite sure what you're looking for):
CWnd::GetParent[^]
CWnd::GetOwner[^]
CWnd::GetParentOwner[^]
Additionally you can create a member of your class to store a pointer or reference to some other window to notify.
Hope that helps
Chris Smith
|
|
|
|
|
Create a layared window. For more pls check SetLayeredWindowAttributes() in MSDN for how to create a layared window.
Then set the Transparent property( WS_EX_TRANSPARENT ) for the dialog.
Now the messages to the layared wnidow will be transferred to the window underlying it.
aks
|
|
|
|
|
|
Hi,
I need to break the infinite loop by pressing some key, 'x' for example.
How can I do it in C or C++ for console application?
Thanks.
|
|
|
|
|
Could you please explain what you are trying archive? Do you want to check whether the 'x' key is pressed, in between your loop? In that case check this - Non-Blocking input in Console Applications[^].
Just ignore my reply. Mark's idea is cool!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
modified on Thursday, January 1, 2009 2:13 PM
|
|
|
|
|
Just one way...
#include <conio.h>
...
int ch = 0;
do
{
if (_kbhit())
{
ch = _getch();
ch = toupper(ch);
}
} while (ch != 'X');
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|