hi, Its good that i experienced the same problem. And found the solution for myself. This really works: Here is the header file : class cSmithChart:public CDialog { public: int m_iChartSize;int m_iLineColor; cSmithChart(); ~cSmithChart(); void drawSmithChart(); afx_msg void OnPaint(); DECLARE_MESSAGE_MAP() }; The implementation file : cSmithChart::cSmithChart():CDialog() { DLGTEMPLATE *tmplate = new DLGTEMPLATE[4]; DLGTEMPLATE tmpl; tmpl.cdit=0; tmpl.style=DS_NOFAILCREATE |WS_CAPTION | WS_SYSMENU; tmpl.x=0; tmpl.y = 0; tmpl.cx = 500; tmpl.cy = 500; tmpl.dwExtendedStyle=0; tmplate[0] = tmpl; tmplate[1].style=0; tmplate[1].dwExtendedStyle=0; int nresult = InitModalIndirect(tmplate,NULL);; if( nresult == 0) { int error = GetLastError(); AfxMessageBox("Dialog Creation Failed"); } }; cSmithChart::~cSmithChart() { }; BEGIN_MESSAGE_MAP(cSmithChart, CDialog) ON_WM_PAINT() END_MESSAGE_MAP() void cSmithChart::OnPaint() { CDialog::OnPaint(); drawSmithChart(); } void cSmithChart::drawSmithChart() { //Draw the smithchart } AS you could see i solved this for drawing a smithchart, which was a distributed .Lib file.. This is a production code. See if it works for you. Good Luck. John Silvester A Asst. Manager -Projects, SRA Systems Ltd., Chennai India
J
John Silvester
@John Silvester