Print Page | Close Window

GetWindowText problem in CXTPContolComboBox

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7104
Printed Date: 10 September 2025 at 6:49pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: GetWindowText problem in CXTPContolComboBox
Posted By: Ashok
Subject: GetWindowText problem in CXTPContolComboBox
Date 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);

else

DeleteDC(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);

}

}




Replies:
Posted By: Oleg
Date Posted: 11 May 2007 at 1:44am
CXTPControlComboBox is not CWnd derived class...
 
use SetEditText instead.
 
 


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net