I'm writing a protocol analyzer for a college project. Its going suprisingly well, except because I'm new to Visual C++ .Net 2003 I'm having problems with the basic stuff
My latest problem is displaying a second form! I have two forms, form1.h and createfilter.h. In form1.h I've added #include "createfilter.h" but it still doesnt recognise the createfilter form.
The following code is in form1.h:
private: System::Void menuItem25_Click(System::Object * sender, System::EventArgs * e)
{
createfilter *filterform = new createfilter;
filterform->Show();
}
This gives the errors:
error C2061: syntax error : identifier 'createfilter'
error C2065: 'createfilter' : undeclared identifier
error C2065: 'filterform' : undeclared identifier
error C2227: left of '->Show' must point to class/struct/union
error C3861: 'filterform': identifier not found, even with argument-dependent lookup
and heres a bit of createfilter.h:
#pragma once
//#include "Form1.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:ata;
using namespace System:rawing;
namespace stuff
{
public __gc class createfilter : public System::Windows::Forms::Form
{
public:
createfilter(void)
{
InitializeComponent();
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super:ispose(disposing);
}
Is the problem that they have different namespaces?
Initially both forms had the same namespace but I switched the second forms namespace to "stuff" (I've a bad imagination) when the compiler complained that the same namespace was used more than once.
Can anyone see what I'm doing wrong?
Any help is seriously appreciated.
My latest problem is displaying a second form! I have two forms, form1.h and createfilter.h. In form1.h I've added #include "createfilter.h" but it still doesnt recognise the createfilter form.
The following code is in form1.h:
private: System::Void menuItem25_Click(System::Object * sender, System::EventArgs * e)
{
createfilter *filterform = new createfilter;
filterform->Show();
}
This gives the errors:
error C2061: syntax error : identifier 'createfilter'
error C2065: 'createfilter' : undeclared identifier
error C2065: 'filterform' : undeclared identifier
error C2227: left of '->Show' must point to class/struct/union
error C3861: 'filterform': identifier not found, even with argument-dependent lookup
and heres a bit of createfilter.h:
#pragma once
//#include "Form1.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:ata;
using namespace System:rawing;
namespace stuff
{
public __gc class createfilter : public System::Windows::Forms::Form
{
public:
createfilter(void)
{
InitializeComponent();
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super:ispose(disposing);
}
Is the problem that they have different namespaces?
Initially both forms had the same namespace but I switched the second forms namespace to "stuff" (I've a bad imagination) when the compiler complained that the same namespace was used more than once.
Can anyone see what I'm doing wrong?
Any help is seriously appreciated.