I have written a C++ Builder VCL Forms application with a TMonthCalendar control called TMonthCalendar.
I am wanting to set some of the days with the control to be bold.
Here is my current code:
TMonthCalendar->BoldDays([1,8], MonthBoldInfo);
However I am getting the following error:
E2193 Too few parameters in call to '_fastcall TCommonCalendar::BoldDays(unsigned int *,const int,unsigned int &)'
Can I please have some help to do this?
Here is a link to the documentation: http://docwiki.embarcadero.com/Libraries/XE3/en/Vcl.ComCtrls.TMonthCalendar.OnGetMonthInfo
I see no difference between my code and the documentation. Yet I still get errors.
thanks
UPDATE
I am trying the following code:
unsigned int arr[2] = {1,8};
TMonthCalendar->BoldDays(arr, 1, MonthBoldInfo);
Yet am getting the following errors:
[BCC32 Error] Assessment2.cpp(361): E2357 Reference initialized with 'unsigned long', needs lvalue of type 'unsigned int' Full parser context Assessment2.cpp(359): parsing: void _fastcall TformMain::TMonthCalendarGetMonthInfo(TObject *,unsigned long,unsigned long &)
and
[BCC32 Error] Assessment2.cpp(361): E2342 Type mismatch in parameter 'MonthBoldInfo' (wanted 'unsigned int &', got 'unsigned long') Full parser context Assessment2.cpp(359): parsing: void _fastcall TformMain::TMonthCalendarGetMonthInfo(TObject *,unsigned long,unsigned long &)
UPDATE
I am wanting to retrieve all the days of a certain month from a vector and then set the days to bold via the TMonthCalendar control.
Here is my code:
vector<appointment> appointmentsOnMonth = calCalendar.getAllAppointmentsOnMonth(TMonthCalendar->Date);
if (appointmentsOnMonth.size() > 0)
{
unsigned int arr[appointmentsOnMonth.size()];
for (int i = 0; i < appointmentsOnMonth.size(); i++)
{
int dayOfAppointment = DayOf(appointmentsOnMonth[i].getAppDateTime());
arr[i] = dayOfAppointment;
}
TMonthCalendar->BoldDays(arr, 1, reinterpret_cast<unsigned int&>(MonthBoldInfo));
}
The dayOfAppointment variable is working correctly and gets the value as an integer of the days that should be displayed in bold. I am after some help to please display these days as bold days.
I am getting some errors to do with the unsigned int arr[] and displaying the bold days. Here they are:
[BCC32 Error] Assessment2.cpp(366): E2313 Constant expression required [BCC32 Error] Assessment2.cpp(372): E2034 Cannot convert 'int[1]' to 'unsigned int *'
I think this is because the static array requires compile time constants and thus the second code will never compile. Is there a way around this?