M
MyCatAlex
Guest
I am trying to mutilate a Microsoft/GitHub code and adjust it to my particular needs in a C++ application. As a part of my "game" I need to activate a PipeServer. I chose Named Pipe Server Using Overlapped I/O. I envision my task as creating a monoplex client-server combination with a possibility of using 2-3 clients in the future with one server. It should be a byte system, not the message one. so I created a class NewMultiClientPipeServer where I copied the server code as presented at the link I posted. In the same cpp file I wrote another class:
class DoWork
{
public:
void DoWorkW (void)
{
int bb;
DoWork(); // constructor
NewMultiClientPipeServer * newServ = new NewMultiClientPipeServer();
bb = newServ->_tmain();
std::cout << bb;
}
} NewWork;
My intention is to activate this Server by calling _tmain from winmain.cpp. Here is the place I think will be appropriate:
INT WINAPI wWinMain(HINSTANCE,HINSTANCE,LPWSTR,INT)
{
if (!GetConsole())
MessageBox(NULL, TEXT("Could not obtain console"), TEXT("GetConsole() failed"), MB_OK);
int x = 42; // variable for printf
printf("Value of x is %d\n", x);
// CALLING SEQUENCE HERE??
HWND hwnd = 0;
Nothing I tried so far worked for me. I need help.
Thanks, - MyCatAlex
Continue reading...
class DoWork
{
public:
void DoWorkW (void)
{
int bb;
DoWork(); // constructor
NewMultiClientPipeServer * newServ = new NewMultiClientPipeServer();
bb = newServ->_tmain();
std::cout << bb;
}
} NewWork;
My intention is to activate this Server by calling _tmain from winmain.cpp. Here is the place I think will be appropriate:
INT WINAPI wWinMain(HINSTANCE,HINSTANCE,LPWSTR,INT)
{
if (!GetConsole())
MessageBox(NULL, TEXT("Could not obtain console"), TEXT("GetConsole() failed"), MB_OK);
int x = 42; // variable for printf
printf("Value of x is %d\n", x);
// CALLING SEQUENCE HERE??
HWND hwnd = 0;
Nothing I tried so far worked for me. I need help.
Thanks, - MyCatAlex
Continue reading...