|
|
Perhaps you could try getting the dimensions of the CStatusBarCtrl that is contained within a CStatusBar ?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
The size of a status bar is application-dependent. You'll need to take the height of the main window and then subtract other heights from it like caption, menu, non-client area, and border. There may be other values, too.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Get the window handle to the status bar's window.
Then can call GetWindowRect.
Take the height of the rectangle as the height of the status bar.
|
|
|
|
|
How can I get the handle?
I tried the following from my View-class:
<br />
CMyView::OnInitialUpdate()<br />
{<br />
...<br />
<br />
CRect rcStatusBar;<br />
<br />
CFrameWnd* pFrame = (CFrameWnd*) GetParent();<br />
CStatusBar* pStatusBar =<br />
(CStatusBar*) pFrame->GetControlBar(AFX_IDW_STATUS_BAR);<br />
CStatusBarCtrl& statusBarCtrl = pStatusBar->GetStatusBarCtrl();<br />
<br />
statusBarCtrl.GetWindowRect(rcStatusBar);<br />
<br />
...<br />
}<br />
But this leaves me with a CRect with the size of 0 height and 0 width...
|
|
|
|
|
These are all MFC Window objects. It is possible that during the OnInitialUpdate that the true 'window' have not yet been created?
You can check with:
::IsWindow(pFrame->m_hWnd)
and if that is not true, your windows don't exist yet, so all widnow rectangles will return empty rectangles.
You might have to investigate something like RecalcLayout and call it from some other location once the windows exist.
|
|
|
|
|
i had finished an application that communicate with server by web services. i programmed it by VC++.net 2003 on win2003. it's ok when setup on win2003 but not ok on win2000, when it ran on win2000, it could not get any data from web services(written by C#). My msi had included soap3_core.msm,msxml4sys32.msm,vc_user_mfc71_rtl_x86_---.msm,vc_user_stl71_rtl_x86_---.msm,vc_user_crt71_rtl_x86_---.msm.
Z.J.Chen @ CZoneSoft --http://www.cnblogs.com/babyblue
|
|
|
|
|
Hi
I have a client server application.
Server is an mfc dialog based application.
Client is an mfc sdi application.
Winsock2 is used for communication.
Both client & server are asynchronous in nature credits to WSAAsyncSelect().
The client & the server are connected to each other:
Now whenever i close the client socket, FD_CLOSE notification is send to the server but the vice versa is not happening.
The client donot gets the FD_CLOSE notification when the server socket is closed.
What cud be the possible problem?
waiting for suggestions
Regards
|
|
|
|
|
Hi everyone!
Can anyone tell me how to insert additional bytes in a memory mapped file?
|
|
|
|
|
Look at the ZwExtendSection native API
(you will need to google for it, it's not documented by MS)
James
http://www.catch22.net
|
|
|
|
|
Is it Possible to make in one time all controls on a form in blank ?
I am using Visual C++ 6.0 MFC
I am learning my self
|
|
|
|
|
the only way to do this is to use UpdateData() when no values where stored into the controls' copy
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
there is not "automatic" way of making all controls "blank", you need to go one-by-one.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
i don't agree, using UpdateData() allow users to do such behavior, unless you used this function to transfer datas between your dialog and your associated class...
however i don't agree with the totality of this[^] article, the author talks about that special point...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
but you still need to set all values to something before using UpdateData.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
|
As toxcct alludes to, you can use DDX and then initialize each variable before calling UpdateData() or if you're not using DDX you could write a loop that would loop through all the controls on the dialog and then using the SetWindowText message, blank all controls.
Cheers,
Tom Archer - Archer Consulting Group
"Eat your brussel sprouts, Junior. There are starving Chinese children American programmers that would kill for that food!"
|
|
|
|
|
I am using SQL SERVER 2000 database,in my table, there are some fields without data .
I am using Visual C++ 6.0, when I show this record on my form, i am seeing abnormal writting on these fields that are empty(like !!!!!!)
In the date field that i have not write any thing I see 1/1/1900, why ?
What to do please ?
Urgent
I am learning my self
|
|
|
|
|
mikobi wrote:
Urgent
yeah man, first of all, if you want a quick answer that satisfy you, begin with express yourself clearly.
well, now, don't you use a default constructor of your date object that fills it with 1/1/1900 ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
No,these date fields are empty when i introduce data on the records.
when a look on the SQl server 2000 database I see this. This problem is not Visual c++ but SQl server.
|
|
|
|
|
I'm trying to use resetText () to reset values of some text boxes to their default. I'm using it as follows,
<br />
myTextbox->ResetText ();<br />
but all this seems to be doing is clearing the text instead of resetting defaults.
Any ideas???? Because I'm stuck.
|
|
|
|
|
richiemac wrote:
myTextbox->ResetText ();
I Believe there is No CEdit::ResetText() function exist!, are you using custom EditBox
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Sorry it's not a MFC application. It's a .net application so it's System::Windows::Forms::TextBox __gc *.
Does that help or should I be asking this elsewhere??
|
|
|
|
|