How do you set this up?

This is a discussion on How do you set this up? within the Windows Programming forums, part of the Platform Specific Boards category; I have a console program I’m trying to put into an dialog MFC api… I’ve implemented the class… fixed syntax ...

How do you set this up?

I have a console program I’m trying to put into an dialog MFC api… I’ve implemented the class… fixed syntax and linking errors and so on but now that I’m trying to actually use it I’m having some problems.

But, this I couldn’t axcess any of the Trade class functions from event handlers attached the buttons in the dialog. I figured it might calling maybe calling the constructor over and over causing problems… I’m not experaince in Windows Programming. So I created a connect button (that way I could make sure it would only be called once. But, when I click connect now I get the

Code:

AfxMessageBox("You connected to the server.");

Dialog but then the program just hangs. So I guess my question is how do you referance and create an object of another class which I can repeatly referance from a dialog box, this dialog box loops until the user hits an exit button.

BOOL CBasic_Order_WindowDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
Trade tc;
return TRUE; // return TRUE unless you set the focus to a control
}

But, I still get errors in my member functions when I try to referance that object.