I made a dialog that has 2 sets of a radio button and combo box. When one radio button is set, it disables the other combo box (and enables it's own combo box) and vice versa. I can't seem to find an example where that can be done in the articles. I also want to return the results of the dialog to the calling function. I know it has to do with the DoDataExchange function. I've read though examples but they just say "do this and do that" but they don't tell me how to get it working with my own program. If I can get a set of steps to get it working, I can try and figure it out, I just need some breadcrumbs.
Any help would be greatly appreciated because the data exchanging thing is a very important part of MFC, thanks in advance.
One method is to create the radio button variables as controls not ints, and create event handlers that enable and disable controls when the respective button has been clicked. Then the OnOK can be overridden. This part is dangerous. I would recommend instead, creating a public variable that stores the radio button state, and then after the DoModal() function returns IDOK pull the value from the variable. Let me know if you would like more detail.
I understand that but I would like more on your recommendation. From what I read, you are supposed to create an integer public variable for only the first radio button and that will indicate which other radio button is selected. Beyond that, it's each variable for itself, at least the controls I'm using.
Mickael Dunn'advice is good.but I think there must be a method to do it by using member's function of menu class in MFC.you can refer to Microsoft Internet Explorer, bitmap lies of left of the items in "favourite"
I'm wanting to add a OnTimer event to me UI thread class, but cannot seem to get it to work. I assume that the time only works with some kinda dialog, but my thread does not have that, only my main app does. Is there a way to add this event to my thread with out adding a dialog?
Let me ask you this. According to the MSDN is says that the hWnd is
Handle to the window to be associated with the timer. This window must be owned by the calling thread. If this parameter is NULL, no window is associated with the timer and the nIDEvent parameter is ignored.
My thread does not have a window associates to it. And I need for SetTimer to look at the nIDEvent parameter because I have three timers doing three different things.
Can I just pass the handle from my main app and still have the timer work in my UI thread?
I've searched for a few days and the best class that I've found where I can easily read data from a spreadsheet was one that is posted on this site named CSpreadsheet. It works great, with one exception, I cannot get it to read check boxes (and to see whether or not they are checked). In the sheet in Excel, I can see the name of the checkbox is Check Box 1 ... but I can not find any class(es) or code samples that shows me how to read them. Can anyone point me in the right direction? I would really appreciate it
I'm trying to find the number of directories (subfolders) in a certain user-defined folder.
I'm having to retrieve files from these subdirectories according to extension, and recursive algorithms traverse ALL subfolders, making my application very slow.
What I am planning on doing is retrieving the number of folders, partitioning them, and creating three or four threads to traverse each partition. This should enhance my execution time considerably.
Please help! Is there a function that will retrieve the number of directories in a folder?
When the going gets tough... write a computer program to do it for you
Last Visit: 31-Dec-99 19:00 Last Update: 3-Mar-21 15:34