It's a pointer to a pointer to the window. There is no "name." Remember that and you'll do fine.
It's a pointer to a pointer to the window. There is no "name." Remember that and you'll do fine.
Away.
>>name of this hwnd
(value of the HWND)
When you created it with CreateDialog() CreateWindow() ect the HWND would be the return.
In the callback function one of the params is the Dialogs HWND.
OR
When you get the msg that the button has been clicked, use the macro from windowsx.h to find the buttons HWND
hWnd = GET_WM_COMMAND_HWND( wParam, lParam);
If you know the title (the text written on the top of the dilaog) then use FindWindow()
Are you using C based WIN32 or MFC (C++ wrapper for WIN32)?
Why not post some code (zip it). It might be easier if I could see what you are trying to do.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
Please learn C++ and then the WinAPI properly before using MFC. As you have learned now the MFC looks easy only on the surface. A good foundation in C++ is required and in the WinAPI very highly recommended for the use of MFC.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
i understand cornedbee, i have given up on this MFC thing because as i've already stated, i need to be more proficient in C++ before i can attempt this other stuff, i do like to finish what i started and that is why i posted this last problem. Thanks for your help novacain, here is my project file zipped. Maybe that can help, blackrat was helping me out as well but we needed to find certain function prototypes which we couldn't. Anyways, the project file is attached. Thanks for all help of course. Edit: Here is the linked filehttp://spift.com/~ripper1/ComputerProgram.zip
Last edited by Ripper1; 05-05-2003 at 04:33 PM.
just curious if anyone looked at my project? thanks
Sorry working hard here.
OK, I see the problem. Here is a simple solution.
For each radio button write a handler similar to this
Code://This function will turn off the controls not needed by this type of calculation. //in case some other controls were turned off it will try to turn them back on void CGasLawsCalcDlg::OnBoyle() { //turn these off GetDlgItem(IDC_TEMP1)->EnableWindow(FALSE); GetDlgItem(IDC_TEMP2)->EnableWindow(FALSE); GetDlgItem(IDC_MOLES1)->EnableWindow(FALSE); // CGasLawsCalcDlg::GetDlgItem(IDC_MOLES2)->EnableWindow(FALSE); //turn these back on (will do nothing if they are already on) GetDlgItem(IDC_PRESSURE1)->EnableWindow(TRUE); GetDlgItem(IDC_PRESSURE2)->EnableWindow(TRUE); GetDlgItem(IDC_VOLUME1)->EnableWindow(TRUE); GetDlgItem(IDC_VOLUME2)->EnableWindow(TRUE); }
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
THANK YOU NOVACAIN!!! you have been a tremendous help with this! thank you very much, it is now complete!
I tried to download the project but could not download it. It seems that you are doing everything correctly. The only thing that I can think of is that the buttons are not in the correct order. You could have entered other controls in between entering the radio buttons. You should try to display whatever output the value of m_RADIO1 is . You may be surprised at what the value is. If the value is not what you expect delete the radio buttons and place them again in the dialog.
example
Code:void CChemCalcDlg::OnCalculate() { UpdateData(TRUE); CString sRadioValue; sRadioValue.Format("%d", m_RADIO1); MessageBox( sRadioValue ); }
zMan