I am new in mathematica programming. Actually referring this link, I tried to connect to kernel from c++ program on Windows with visual studio. I copied all these .exe files in related folder which i used in my code as well. But it does not connect after lots of separate try. this is my code,
WSENV env;
WSLINK link;
int error;
env = WSInitialize((WSEnvironmentParameter)0);
link = WSOpenString(env, "E:\\ProgrammingProjects\\PhD\\MathematicaTest\\mathfiles\\MathKernel.exe -mathlink",&error);
int res = WSConnect(link);
in this type the returned res is "0" and no connection.
I Also tried WolframKernel.exe
link = WSOpenString(env, "E:\\ProgrammingProjects\\PhD\\MathematicaTest\\mathfiles\\WolframKernel.exe -wstp",&error);
int res = WSConnect(link);
but this code block at connect function and as it said in documentation it means there is no connection. Should I do something more before running this code? Could you help me through this? Thanks