![]() |
GetWindowText problem in CXTPContolComboBox |
Post Reply ![]() |
Author | |
Ashok ![]() Senior Member ![]() Joined: 02 May 2007 Status: Offline Points: 164 |
![]() ![]() ![]() ![]() ![]() Posted: 10 May 2007 at 11:47am |
Hai, I have a class which is derived from CXTPControlComboBox, the problem is the GetWindowText method is giving error. ie.,
error C2660: 'GetWindowTextA' : function does not take 2 arguments Actually it is looking for handle to the window ie., m_hWnd.
How can I get the handle to the window.
Please go thru the below code where GetWindowText gives problem,any solution.
void CControlForamtFontSizeComboBox::FillSizeComboBox()
{ SZ szFaceName[LF_FACESIZE+1]; BOOL bPrintDC; bPrintDC = TRUE; HDC hDC = GetPrinterDC(NULL); JSASSERT(hDC,"Can't get printer dc"); if (!hDC) { bPrintDC = FALSE; HDC hDC = ::GetDC(NULL); JSASSERT(hDC,"Can't get screen dc"); } ResetContent(); CUIntArray arSizeArray; GetWindowText(szFaceName,LF_FACESIZE+1); - Problem if(!hDC || !szFaceName[0]){ TRY{ for(int i = 0; i < ELEMENTSOF(uNSizes); i++)arSizeArray.SetAtGrow(i,uNSizes); } AND_CATCH_ALL(e) { JSASSERT(0, "Unable to create size array");} END_CATCH_ALL; } else{ FILLSIZECOMBO fs; fs.puArray = &arSizeArray;; fs.hPrinterDC = hDC; EnumFontFamilies(hDC,szFaceName[0],&fs); } if(!bPrintDC)::ReleaseDC(NULL,hDC); elseDeleteDC(hDC); for(int i = 0; i < arSizeArray.GetSize(); i++){ SZ szSize[10]; _itot_s(arSizeArray, szSize, 10, 10); JSASSERT(CB_ERR == FindStringExact(-1,szSize), "Adding string twice");AddString(szSize); } } |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
CXTPControlComboBox is not CWnd derived class...
use SetEditText instead.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |