At the same time I'm not so sure that you can define a constructor and initialize the elements of the class as it is a struct. This sintax is forcing a little the flexibility of the C++ language. I mean that this time probally it is better if you spend some time writing ALL the initialization by hand.
I am working on a project in which It is sending the packet on the Internet server at the interval of 3 sec. The packet is roughly of 1KB(kilo Bytes) size. And when I check the programme in the Taskbar it show the CPU Usage to 50%.
The project is a simple Dialog based WIN32 application. And it uses SOCKET and Timer to send and receive the data from Internet Server.
Is there any way I can reduce the memory usage.
Or please tell me what are the possible flaws that can lead to this type of proble.
Thanks for your assistance.
I added those lines to my project.
But, when I build the project, there was an error : error C2065: 'ListenSocket' : undeclared identifier
So I added this line : SOCKET ListenSocket;
Then I build it again, although I got some warning : warning C4700: uninitialized local variable 'ListenSocket' used
there was no error.
Then I debug, try to connect from other computer.
It was connected, could read the buffer, but my program shows "0.0.0.0" as client's IP address.
You guess it right.
I've just begin Socket Programming, understand nothing about socket programming, but I found that the article about "Java Style Socket Programming in C++" is easy to use. By just change the example program a bit, I could communicate between two computers.
Anyway, I've tried to find the "Java-like-Sockets",
change something in main source,
but still doesn't work.
Actually i want to write a html file or .html page and i don't know how to do it using MFC. I know how to write a .txt file using CStdioFile class and using WriteString API's. Can any body tell me how to do it.
It is the same.
Simply save tha text file as htm (or html) instead txt, then you can open it with a browser.
If you need an example you can look to the source on this page, or surely you can find more simple examples in the net.
Of course, first you need to learn HTML (in the web there are a lot of free manual)