Original Post
I've got a problem; and I have no idea where it is. It's really annoying- I've looked over my code millions of times; each time getting a little more frustrated... I just can't find it.
The error doesn't make any sense- and, like always, it's not on the same line as the compiler says.
#include <afxwin.h>
#include <afxcmn.h>
#include "resource.h"
const unsigned short int MAX = 31;
class CStatusDialog: public CDialog
{
public:
CStatusDialog(char* CDialogName, CWnd* Owner):
CDialog(CDialogName, Owner) { this->DoModal(); }
BOOL OnInitDialog();
afx_msg void OnStatusDialogOk();
private:
CStatusBarCtrl StatusBar;
DECLARE_MESSAGE_MAP()
};
afx_msg void CStatusDialog::OnStatusDialogOk()
{
char UsernameBuffer[32];
char PasswordBuffer[32];
CEdit* pEdit1 = (CEdit *) GetDlgItem(IDC_EDIT1);
pEdit1->SetLimitText(MAX);
pEdit1->GetWindowText(UsernameBuffer, MAX);
CEdit* pEdit2 = (CEdit *) GetDlgItem(IDC_EDIT2);
pEdit2->SetLimitText(MAX);
pEdit2->GetWindowText(PasswordBuffer, MAX);
StatusBar.SetText("Connecting to server", 2, 0);
}
BOOL CStatusDialog::OnInitDialog()
{
RECT r;
r.left = 0;
r.right = 0;
r.top = 0;
r.bottom = 0;
int PartCoords[2] = { 45, 280 };
//7,73,172,13
CDialog::OnInitDialog();
StatusBar.Create(WS_VISIBLE | WS_CHILD, r, this, 1000);
StatusBar.SetParts(2, PartCoords);
StatusBar.SetText("Status: ", 0, 0);
StatusBar.SetText("Not connected to server", 1, 0);
return TRUE;
}
class CApp: public CWinApp
{
public:
BOOL InitInstance();
};
BOOL CApp::InitInstance()
{
CStatusDialog StatusDialog("StatusDialog", NULL);
//This line (above) is the source of the problem
//according the compiler
return TRUE;
}
BEGIN_MESSAGE_MAP(CStatusDialog, CDialog)
ON_COMMAND(IDOK, OnStatusDialogOk)
END_MESSAGE_MAP()
CApp App;
error C2143: syntax error : missing ';' before 'constant'
error C2064: term does not evaluate to a function
I can't find the problem anywhere! Could someone please help me.
[edited by - way_out_west on March 13, 2003 1:50:14 AM]