43a Subj : wchar_t* problem To : borland.public.cpp.borlandcpp From : George Date : Wed Aug 04 2004 12:34 pm I am using DBI Tech Calendar Tools and have a problem with the wchar_t element when sending text to a date. Can someone take a look at the following and let me know if it is ok? .. /*************************************************************** int wcbf = TablesForm->BaseCalendar->FieldByName("HolidayType")->AsString.Length() + 1; wchar_t *wcp = new wchar_t[wcbf]; AnsiString ht = TablesForm->BaseCalendar->FieldByName("HolidayType")->AsString; StringToWideChar(ht, wcp, wcbf); ctMonth1->set_DateText2(mDate.ToInt(), wcp); // set_DateText2(int Index, wchar_t* text) delete [] wcp; wcp = NULL; *****************************************************************/ I use the AnsiString ht rather than putting the source direct because it seems to cut down on the error count (????) Either I have missed something very fundamental or the activex component has a problem. (Always start by assuming it is my fault). Cheers George . 0