|
I don't believe that the dialog is the owner of the menu. The menu actually resides in the main dialog class, and the dialog I am working with is the child.
By calling GetMenu(), I still get a return value of 0.
Does anyone else have any suggestions? I was told this is one of the requirements I needed for the app.
Thanks in advance.
|
|
|
|
|
Hi!
I want to split the main window of an MDI-application.
On the left pane there should be an form (not the problem),
and on the right pane the child-windows should be.
The MSDN did not really help.
Similar to splitting child-windows (in CChildFrame),
I tried to split CMainFrame. But what do I have to insert
into the right pane - so that there are the child-windows.
CMainFrame can not work...
Alex
|
|
|
|
|
Do you have a CSplitterWnd object (in the parent frame)? Have you overridden the frame's OnCreateClient() method? From that, have you called CSplitterWnd::CreateStatic() and CSplitterWnd::CreateView() ?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hello!
I'm sorry to answer so late...
Yes, I have overridden the OnCreateClient() similar
to CChildFrame. But what have I to put into the
right pane?
It seems that in every pane has to be a View (or
a Frame with another CSplitterWnd object and
a view in each pane).
But on the left side, there should be the Child
Windows.
What I want is to have an form on one side of the
program where I can place several controls.
Alex
|
|
|
|
|
LionAM wrote: What I want is to have an form on one side of the
program where I can place several controls.
So can't you use CFormView for this?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I have the following pb:
I have an simple MFC app where I launch a function(INIT) that starts a thread(THREAD 1=wait for connection) that connects to a socket(CSocket).After the connection,I Detach and get the handle...now...my pb is this:
if I re-Attach the handle of the socket after the connection in the INIT function then when my server "dies"...I get the OnClose event on the CSocket object...but if I try to re-Attach the handle of the socket inside that Thread 1 or even in another Thread 2...I never receive that notification of the OnClose event
Anyone knows why, and the most important...does he have a solution for this pb ?
(I admit that I'm a begginer with MFC)
Of all the things I've lost, my mind I miss the most
|
|
|
|
|
Sorry, you lost me after the start-a-thread-that-waits-for-a-connection-that-connects-to-a-socket thing...
Have a look at the MSDN samples chatter/chatsrv that shows socket basics and see if that helps. You'll find it here[^]
If things doesn't light up for you, post again and describe what you are trying to do and why you think you need multiple threads.
Perhaps you should derive your socket class from CAsyncSocket instead...;)
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
an application has a property-sheet with multiple pages, each page is associated with a thread.
when a thread is running, I hope the property-page containing the thread is always active (at top of other pages), or other pages can NOT be selected as active-page.
how to do that?
includeh10
|
|
|
|
|
To keep a particular page from being activated, return zero from OnKillActive() . The default is to return non-zero thus all pages can be activated.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
|
I have no experience yet in dialog based programming and i have this problem..
I have several edit boxes in a dialog wich take numbers and I want to calculate another number based on these. I put a button and made the function but the number doesn't appear. It's like the edit boxes are still in 0. Should I call something to take the values fron the edit boxes?
thanks
|
|
|
|
|
You have to get the text from each individual edit box. I usually have a member variable and just call GetWindowText() and store it in another variable.
In order for you to make calculations on this number use the appropriate data conversion routines.
|
|
|
|
|
If you're using DDX with MFC or WTL you should call UpdateData() before using the associated variables.
"dire io è lento, dire noi è rock"
rechi+
|
|
|
|
|
There are 2 ways.
let's say you make an addition between two controls, and return the answer into a 3rd editBox.
1. if you have member variables for you controls, do this :
UpdateData(TRUE);
m_Answer = m_LeftOperand + m_RightOperand;
UpdateData(FALSE);
if you access your controls by pointers, you could use the following :
CString strAnswer = _T("");
CString strLeftOperand = _T("");
CString strRightOperand = _T("");
CEdit* peAnswer = (CEdit*)GetDlgItem(IDC_ANSWER_EDIT);
CEdit* peLeftOperand = (CEdit*)GetDlgItem(IDC_LEFT_OPERAND_EDIT);
CEdit* peRightOperand = (CEdit*)GetDlgItem(IDC_RIGHT_OPERAND_EDIT);
peLeftOperand->GetWindowText(strLeftOperand);
peRightOperand->GetWindowText(strRightOperand);
strAnswer.Format(_T("%f"), ::atof(strLeftOperand) + ::atof(strRightOperand));
peAnswer->SetWindowText(strAnswer);
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thanks very much, that helped..
|
|
|
|
|
I had designed a dialog box which is a "Find dialog"(what we generally see when we press "ctrl+f")..
Now in my application when i enter any " name" or "value" in the 'find dialog box',the focus should shift to that particular
place(name/value)..All the "name" & "values" are stored in the 'STL list'..I have to search those values/names and find out
whether the matching was found or not for the entered name/value in the 'find dialog'..
But the program is not responding properly..when i debug,the error shown is "Object Reference not set to an instance of an
object" for the "for loop" implemented..
for(iterator = member.begin(); iterator != member.end();iterator++)
Plz Help Me..
Thanks!!
|
|
|
|
|
I assume member is your STL list. What are the contents of the loop itself?
Bob Ciora
-- modified at 7:23 Tuesday 22nd November, 2005
|
|
|
|
|
Hi Guys!
Can anybody help me to change the background Color of a controll? I want to use a static controll and change the BG to white. I want to use it in my wizards...
Atrernativly, can somebody help me with panels? I have seen them in C# but I cant seem to locate them in C++. I am using VS 6.0! I know it is a bit dated, but any help would be appreciated!
Many thanks
|
|
|
|
|
It's easy to change the background of static control.
Just handle the WM_CTLCOLOR message.
Here is a sample from MSDN
HBRUSH CYourDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC)
{
pDC->SetTextColor(RGB(255, 0, 0));
pDC->SetBkMode(TRANSPARENT);
hbr = m_brush;
}
As far I know there is no panel in VC++ 6.0.
But what you can do is.
Create a class derived from CWnd that can act as a panel.
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Willem Le Roux wrote: Can anybody help me to change the background Color of a controll? I want to use a static controll and change the BG to white.
I have a semi-related example here, towards the bottom.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
hi,
i got a really annoying problem with my build utility in visual studio 6.0! everytime i try to launch my program (which has been compiled and linked correctly) by pressing CTRL + F5 i got a message that says some of my .obj files were out of date or could not be found and so i have to rebuild them (4 files). wtf? these files already exist and don't need to be rebuild!!! my project consists of about 60 files and only these 4 files produce this stupid message. why ??? there's nothing special about them.
is this a bug in vs 6.0 or just something that could be fixed with some compiler settings ?
thanks in advance!
-- modified at 6:55 Tuesday 22nd November, 2005
|
|
|
|
|
Hello.
Have a look at the timestamps on those 4 source files. That's one common cause of the kind of problems.
|
|
|
|
|
Have you changed any of those 4 files in a while? This might be caused by those files having a bad date...a date that's in the future and causing them to always be "out of date" since they're always newer than the final executable. Maybe try opening each of them, adding and deleting a space, then saving them back to disk.
Bob Ciora
|
|
|
|
|
no idea what exactly the problem was, but it seems that these 4 files haven't been modified for a little while and according to that they couldn't be generated well. if you ask me this doesn't make munch sense, but a little shift of some characters has solved the problem.
what a crap!!
|
|
|
|
|
Try to open those files in Notepad and then save it. This will help.
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|