views:

19

answers:

1

This is a fairly basic question, but I haven't been able to find any from->to guides from VS6->VS2008. I have a dialog box that contains controls of various types, I've discovered the way of auto-generating OnBnClickedMyFooBarButtonHere() methods via the Properties dialog on the dialog editor.

I can also use CWnd::GetDlgItemText(int ,CString &) to extract text, and the oddly paramaterized GetDlgItemInt(int, bool*, bool) to extract signed integers, but is there really no other option for a Date or Time value other than

  • Manually adding in all the DDX_ crap that the class wizard used to do in VS6
  • Using GetDlgItemText and then parsing whatever it gives me?

Is there a standard approach to this?

In the past I've done "DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER2, m_TimePicker);" in the DoDataExchange override, it seems a bit strange that there is no direct analogue.

+1  A: 

What control had you previously used to get a date and time? Essentially any 32-bit ActiveX control should still be usable (in pretty much the same way) with a newer version of VS.

Jerry Coffin
Sorry if I was unclear. In the past, the Class Wizard provided a fairly convenient interface for binding dialog elements to class variables, now that we seem to have lost that interface, I'm trying to figure out what the standard way of dealing with non-textual/non-integer data is. Considering that it appears that neither Ints nor Text require the DoDataExchange method to be overridden at all.
jkerian
You still have pretty much the same ability to bind a control to a variable -- it's just less convenient (though you might prefer VS 2010, which has resurrected the ClassWizard). In VS 2008, you normally right-click on the control in the dialog, click "Add Variable..." and add a variable about like you would have in VS 6 with the ClassWizard.
Jerry Coffin
Ahh... THERE it is... knew it was something simple I was missing. Google was producing thousands of instructions on how to find the Class Wizard, even with "VS2008" specified.
jkerian