help ! vc++ adding winsock control to existing project

hello dear forum,

I have an existing VC++ 2008 project named MOCON ( motion control program )

I add a form MOCON1.h to this project

and added a winsock control to this form

all in the namespace MOCON

below the file MOCON1.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
namespace MOCON {
...
public:
MOCON(void)
{...
InitializeComponent();
...
public /*private*/: AxMSWinsockLib::AxWinsock^  axWinsock1;
...
void InitializeComponent(void)
...
this->axWinsock1->Enabled = true;
this->axWinsock1->Location = System::Drawing::Point(165, 124);
this->axWinsock1->Name = L"axWinsock1";
this->axWinsock1->OcxState = (cli::safe_cast<System::Windows::Forms::AxHost::State^  >(resources->GetObject(L"axWinsock1.OcxState")));
this->axWinsock1->Size = System::Drawing::Size(28, 28);
this->axWinsock1->TabIndex = 0;


this above code is added automatically to MOCON1.h - it named the control axWinsock1

now in another cpp file I include below code

1
2
3
#include "MOCON1.h"

sprintf(buffer,MOCON::axWinsock1->LocalIP); 


but in the above line when I type MOCON:: it deosnot automatically find axWinsock1

1
2
3
1>.\MyHardware.cpp(66) : error C2039: 'axWinsock1' : is not a member of 'MOCON'

1>.\MyHardware.cpp(66) : error C2065: 'axWinsock1' : undeclared identifier

and when I compile project I get this above errors - what can I do ?

thanks
Topic archived. No new replies allowed.