Re: Serial port usage
I added to AdelphiPresetDlg.cpp the following:
void CAdelphiPresetDlg::OnClcc() //button to run second dialog
{
// pass reference of port to AdelphiCLCC
AdelphiCLCC dlgAdelphiCLCC(port);
// hide main dialog window
AfxGetMainWnd()->ShowWindow (SW_HIDE);
dlgAdelphiCLCC.DoModal();
// unhide main dialog window on return
AfxGetMainWnd()->ShowWindow (SW_SHOW);
}
==============================================
I modified the constructor in AdelphiCLCC.h file
class AdelphiCLCC : public CDialog
{
// Construction;
public:
AdelphiCLCC(CSerialCom& serport, CWnd* pParent = NULL);
// AdelphiCLCC(CWnd* pParent = NULL); // standard constructor commented
==============================================
Lastly I modified AdelphiCLCC.cpp
//AdelphiCLCC::AdelphiCLCC(CWnd* pParent /*=NULL*/) //commented out
// : CDialog(AdelphiCLCC::IDD, pParent) //commented out
AdelphiCLCC::AdelphiCLCC(CSerialCom& serport, CWnd* pParent /*= NULL*/)
: CDialog(AdelphiCLCC::IDD), port(serport)
{
//{{AFX_DATA_INIT(AdelphiCLCC)
.......
//}}AFX_DATA_INIT
}
==============================================
What did I miss???
Thanks
On Sat, 31 Dec 2011 13:44:03 -0800 (PST), ScottMcP [MVP] wrote:
On Dec 31, 3:39?pm, Me <m...@right.her> wrote:
I did as you stated and now when I build it I get the following error:
AdelphiCLCC.cpp(29) : error C2614: 'AdelphiCLCC' : illegal member
initialization: 'port' is not a base or member
Thanks for your help.
That should be obvious: I made it a member in my first response.