Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - GetWindowText problem in CXTPContolComboBox
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

GetWindowText problem in CXTPContolComboBox

 Post Reply Post Reply
Author
Message
Ashok View Drop Down
Senior Member
Senior Member


Joined: 02 May 2007
Status: Offline
Points: 164
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ashok Quote  Post ReplyReply Direct Link To This Post Topic: GetWindowText problem in CXTPContolComboBox
    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);

}

}

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2007 at 1:44am
CXTPControlComboBox is not CWnd derived class...
 
use SetEditText instead.
 
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.078 seconds.