Quick question

in Help Center
I know this may sound stupid but how would I go about creating a instance of the communicator in C++?
I am not using the Ice Application.
In my LoginState.h I have Ice::CommunicatorPtr communicator;
Then in my enter method I put communicator = new Ice::Communicator(); which results in errors:
Error 1 error C2259: 'Ice::Communicator' : cannot instantiate abstract class c:\Users\Empire Games\Desktop\Prototype Client\Source\Prototype Client\Prototype Client\Source\LoginState.cpp 19 Prototype Client
I am not using the Ice Application.
In my LoginState.h I have Ice::CommunicatorPtr communicator;
Then in my enter method I put communicator = new Ice::Communicator(); which results in errors:
Error 1 error C2259: 'Ice::Communicator' : cannot instantiate abstract class c:\Users\Empire Games\Desktop\Prototype Client\Source\Prototype Client\Prototype Client\Source\LoginState.cpp 19 Prototype Client
0
Comments
I put:
communicator = Ice::initialize();
everything compiles just fine and even though calling any of the server methods results in the client crashing same thing happens on my test console client which uses the Ice Application so I dont think it has anything to do with the communicator not getting initialized correctly.
That is correct, i suggest you to take a look to demo/Ice/minimal/ the demo shows how to create clients and servers that doesn't use Ice::Application.
We need more details to know what is going on, the best will be to provide a self contained example that demonstrate the problem. We also need to know what Ice , c++ compiler, and Os versions do you use.
Best Regards,
José
Debug/Release library mix-up is is a very common cause of crashes on Windows. See this FAQ for more information.
The client crash indicates a problem with your client code, if there was simply a problem with server you will get a exception of some kind, it doesn't matter what the server does, a client crash means there is a problem in client code.
This doesn't mean that there isn't an error in the server, but it should not made the client crash, if the client code was correct.
Best Regards,
José
LoginState.h
com::empiregames::generated::network::ServerException _Error;
LoginState.cpp
enter method:
_Error = com::empiregames::generated::network::ServerException();
onRequestLogin method:
_Server->login(nickname,password);
if(_Error.errorCode == 100001)
{
//Username->setText("Incorrect Information!");
}
else
{
StateManager::getSingleton().advance("WorldState");
}