|
Rajkumar_R wrote: if we disabled range checking it affects all STL containers we use .
That's exactly what I want to happen in a release build. In my opinion, and that of many others, checked iterators should not be enabled in release builds by default anyway. I use code like this in my precompiled header to get it to work this way:
#ifdef NDEBUG
#define _SECURE_SCL 0
#endif
I encourage you to do this and have another look at the release build's machine code. For most operations a vector 's performance will be the same as that of a raw array (as it was in the MSVC6 code I posted). All the member functions are simple inline functions.
Steve
|
|
|
|
|
I want to set 24 hr time format using Date Time Picker Control not 12 hr time format.Please give information about how to change it.
|
|
|
|
|
Hi,
use DateTime_SetFormat(win32) / CDateTimeCtrl::SetFormat(MFC)
and in the format string use HH(24hrs) instead of hh(12hrs)
eg: pCtrl->SetFormat(_T("hh-m-s")); will be pCtrl->SetFormat(_T("HH-m-s"));
Best Regards
Raj
|
|
|
|
|
Thanks,SetFormat() really work.
|
|
|
|
|
Hi everybody,
i already wrote a function which changes the view of a MDIFrame ( hide old view, show new view )
SetActiveView(New_View);
i add even a New_View->SetDlgCtrlID(AFX_IDW_PANE_FIRST);
and ::SetWindowLong(New_View->m_hWnd,GWL_ID,AFX_IDW_PANE_FIRST);
It works nearby perfect. Only if i minimize the frame.
The new view gets the OnSize-Message and the old view too ( 2 times)
So i've an effect of non-drawing on the new view.
I put a "if(isHidden) return;" in the OnSize-Handler of the old view ( isHidden is setted into the old view to TRUE during the view-changing ) it also don't resolve the problem
Big thanks for help
|
|
|
|
|
please be clear in your question...
|
|
|
|
|
I have 2 Views with the same Parent ( Frame )
One of them is active (ActiveView) and displayed ( ShowWindow(SW_SHOW) )
If i minimize the frame and restore it again, the two frames get the OnSize Message ...
Probably correct, that the two views fits all the time into the frame.
But if i restore the frame, the active view will not be drawn ...
Even an Invalidate() doesn't redraw the view
I hope you can understand my problem
|
|
|
|
|
I do a tool that need check wireless net connection;
some one said "use GetAdaptersInfo",but I do know how do that.
thank.
|
|
|
|
|
|
Hi all,
In a program I use "RemoveDirectory (LPCTSTR szName)" to remove a directory. However, this never seems to work. GetLastError () claims that "the process cannot access the file because it is being used by another process", which is not the case. I have no problem in removing the same directory from either a command-line or from the explorer. I am sure that the directory is empty (this is done in a preceeding bit of code in the same program).
Anyone any ideas?
Thanks in advance,
William
|
|
|
|
|
Wim Engberts wrote: I am sure that the directory is empty (this is done in a preceeding bit of code in the same program).
A missing FindClose(), maybe?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
You are absolutely right! Never thought I'd need that after FindNext returned FALSE!
Thank you very much.
William
|
|
|
|
|
You are welcome.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I Created a dynamic Static control using CStatic.So i need to draw controls inside the Static control.
The problem is adding a Scrollbar , enable and using it.
CStatic temp = new CStatic();
temp ->Create(NULL, SS_GRAYFRAME |WS_VSCROLL| SS_REALSIZECONTROL , rect, parent);
So because of using WS_VSCROLL the Scroll was there but i dont know how to enable and use it.So please tell me how to do it or tell me a good web site about that.
hemajith
|
|
|
|
|
Why don't you declare it directly as a scrollbar?
CScrollBar *temp = new CScrollBar;
temp->Create (NULL,.......);
In that case you would have all the normal scrollbar's access.
William
|
|
|
|
|
Hi
Can anyone tell me how to override the F1 key, or any Function Keys from within a SDI application
thanks
simon
|
|
|
|
|
Handle WM_KEYDOWN event and check if the user presses the F1 key
if(nChar==VK_F1)
// Do something
else
// Do something else
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
thanks, but the code you suggested works with all keys apart from F1
any ideas ?
|
|
|
|
|
si_69 wrote: thanks, but the code you suggested works with all keys apart from F1
any ideas ?
ignore this, i now have it working
thanks
|
|
|
|
|
|
|
I was writing a control "CColorEdit" which is derived from CEdit. I have override its OnKeyUp() and OnKeyDown. When I pressed the key "Enter", the OnKeyDown was invoked, but OnKeyUp wasn't invoked. I feel very confused. Does anyone have ever occured this kind of think.
Waiting for answer.
Best Regards.
|
|
|
|
|
For sure you have put the messagebox code in OnKeyDown. Since the messagebox pops up in OnKeyDown, the focus is gained by the messagebox, so the OnKeyUp will not be handled on the edit box. I tested myself without the messagebox, and for me both keydown and keyup are working fine on a derived class of CEdit.
Habeeballah Hasnoddin
|
|
|
|
|
I think my code is OK. But it still doesn't work.
void CTestEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
if ( nChar == 13 )
{
//MessageBox("Down");
SetWindowText( "Bye Bye Bye" );
}
CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
}
|
|
|
|
|
I got the point.
==> You must have "Multiline" and "WantReturn" properties set on this edit box.
As I observed while testing, the following is true.
--> If you set just the "Multiline" then only keydown gets fired and not the keyup.
--> If you set just the wantreturn and not the Multiline then only keyup gets fired and not keydown.
thats it.
Habeeballah Hasnoddin
|
|
|
|