Board index » cppbuilder » wchar_t* problem

wchar_t* problem


2004-08-04 06:34:46 PM
cppbuilder83
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
 
 

Re:wchar_t* problem

You have posted in the newsgroup for the old Borland C++ compiler.
That compiler does not have forms or AnsiStrings. Post your C++
Builder questions in C++ Builder newsgroups, groups with the word
'cppbuilder' in their name.
. Ed