:-O Please, Can anybody helps me ? I want to catch the CWnd pointer for the current dialog to use it in the CButton::Create() method. I tried to use "this" instead of CWnd in the OnButtonClick() its works ok, but when I tried to use "this" inside Custom Class (I created it) it doesn't work because the "this" pointer was pointing to the Current class.So " How can I get CWnd pointer for the current dialog ? " Thank you at all. Dr Abudawood
drabudawood
Posts
-
" How can I get CWnd pointer for the current dialog ? " -
Creating Control Object DynamicallyThank you very much MR\ Mike I will test it in MFC. Dr Abudawood
-
Creating Control Object DynamicallyHow can I create a control object at runtime dynamically and join it to the dialog. eg. If I want to create many buttons at runtime after the user choosen some options(like no. of buttons he wants to use it).So what can I do. Could anybody helps me please ?:sigh: Dr Abudawood
-
Calculate the required size of text to fit in column:) Now I got the answer. after your help it was very easy as next: void CTestScrolDlg::AdjustColSize(int ColNo,CString s) { //Global variable Array width[ColNo] int Gab = 15; int size=m_ListControl.GetStringWidth(s)+Gab; if( width[ColNo] < size ) { m_ListControl.SetColumnWidth(ColNo,size); width[ColNo]=size; } };) Dr Abudawood
-
Calculate the required size of text to fit in column:-O Tanke you very mush Mr .Michael Dunn for your help. And I'll try to do your advice. Dr Abudawood
-
Calculate the required size of text to fit in column:confused:How can I calculate the required size of text which can be placed in one column of CListCtrl object and fits in. when I tried to use the next code, some text did not appear all, I get three dots at the end of the appeared text on the column. Can you help me please what is wrong with code ? void CMyDialogDlg::AdjustColSize(int ColNo,CString s) { CClientDC dc(this); CSize sz; CFont *f = m_ListControl.GetFont(); dc.SelectObject(f); sz = dc.GetTextExtent(s,_tcslen(s)); sz.cx += GetSystemMetrics(SM_CXBORDER); if( width[ColNo] < sz.cx ) { m_ListControl.SetColumnWidth(ColNo,sz.cx); width[ColNo]=sz.cx; } } Dr Abudawood
-
what function will convert a char to its number value/* ATOF.C: This program shows how numbers stored * as strings can be converted to numeric values * using the atof, atoi, and atol functions. */ #include #include void main( void ) { char *s; double x; int i; long l; s = " -2309.12E-15"; /* Test of atof */ x = atof( s ); printf( "atof test: ASCII string: %s\tfloat: %e\n", s, x ); s = "7.8912654773d210"; /* Test of atof */ x = atof( s ); printf( "atof test: ASCII string: %s\tfloat: %e\n", s, x ); s = " -9885 pigs"; /* Test of atoi */ i = atoi( s ); printf( "atoi test: ASCII string: %s\t\tinteger: %d\n", s, i ); s = "98854 dollars"; /* Test of atol */ l = atol( s ); printf( "atol test: ASCII string: %s\t\tlong: %ld\n", s, l ); } Output atof test: ASCII string: -2309.12E-15 float: -2.309120e-012 atof test: ASCII string: 7.8912654773d210 float: 7.891265e+210 atoi test: ASCII string: -9885 pigs integer: -9885 atol test: ASCII string: 98854 dollars long: 98854 :) Dr Abudawood