at the moment, the the program in initialised, the connects to the server, and the server thread then waits for the login details.
the only problem here is, that if the incorrected login details are send, the server threads are ended.
To solve this, im trying to create the socket connections when the login button is pressed.
only problem to this is that the main form need the use these created sockets as well, so i though id use pointers:D
the idea is, id parse the int pointers (which have been initialised as 0) to the login form when its created
so the login form will deal with the pointers, and the main form would have the in variables. when the sockets are created in the login form, it used the pointer to store the socket number in the variable in the main form.
only thing is, it seems that forms prefere to deal with managed pointers.
my experience with managed C++ is rather limited, and im sorta learning as i go.
Form1(void)
{
MONITORING = false;
CONNECTED = false;
int ^monPtr = &monitorSocket; //command socket and monitor socket are int variables.
int ^cmdPtr = &commandSocket;
//connectSockets();
myDelegate = gcnew AddTextBoxString(this, &Form1::OutPutBoxWork);
InitializeComponent();
Application::Run(gcnew loginForm(cmdPtr, monPtr));
loginForm(int ^commandSocket, int ^monitorSocket)
1>h:\serverclientproject\networkadmingui\networkadmingui\Form1.h(51) : error C2440: 'initializing' : cannot convert from 'cli::interior_ptr<Type>' to 'System::Int32 ^'
1> with
1> [
1> Type=int
1> ]
1> No user-defined-conversion operator available, or
1> There is no context in which this conversion is possible
1>h:\serverclientproject\networkadmingui\networkadmingui\Form1.h(52) : error C2440: 'initializing' : cannot convert from 'cli::interior_ptr<Type>' to 'System::Int32 ^'
1> with
1> [
1> Type=int
1> ]
1> No user-defined-conversion operator available, or
1> There is no context in which this conversion is possible

New Topic/Question
Reply



MultiQuote


|