|
I saw a very good article of sokect on the codeproject that it shows send/rev for two programs,if you search for it,it will be helpful for you.
|
|
|
|
|
|
You're welcome.
|
|
|
|
|
Sockets is looking a little difficult to me. Is it so or can I have some simple samples/articles to understand at first then move to programming them??
|
|
|
|
|
Did you search this title on the internet" Socket Programming in c/c++"?
|
|
|
|
|
Yes i got it now ... sorry was busy with my work ...
now i am going through practices
|
|
|
|
|
So you are lucky that you have work .
|
|
|
|
|
CString str;
str.Format("Value %d",m_nSides);
What is the other way to format a string NOT using CString methods?
|
|
|
|
|
In C style.
char sTmp[30] = {0};
sprintf(sTmp, "Value %d", m_nSides);
Maxwell Chen
|
|
|
|
|
using std::string maybe ?
what don't you like in CString ?
|
|
|
|
|
For ATL program with no MFC support.
|
|
|
|
|
CString is a ATL class, extended to MFC. but still you can use it in ATL.
|
|
|
|
|
Unable to use it.
error C2065: 'CString' : undeclared identifier
|
|
|
|
|
What version of Visual C++ are you using?
Maxwell Chen
|
|
|
|
|
|
OK. You chose not to support MFC in the project settings.
You can use the C style formatting.
If you need to treat strings as objects, you can use std::string from <string> header. But the format way differs.
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: you can use std::string from <string> header. But the format way differs
sure it does, there's no format() function in the STL's string class.
but Boost provides one.
however, in case you didn't read the whole thread, CString is a ATL class, so it is still usable in a ATL project...
|
|
|
|
|
toxcct wrote: however, in case you didn't read the whole thread, CString is a ATL class, so it is still usable in a ATL project...
I just created an ATL project (EXE) with VC++ 2005.
No it does not recognize CString.
Error C2065: 'CString' undeclared identifier.
#include <altstr.h>
Maxwell Chen
|
|
|
|
|
Ok., why using CString causes error?Is there any header file is missing?
|
|
|
|
|
#include <atlstr.h>
Maxwell Chen
|
|
|
|
|
Ya!! it solves the problem!
|
|
|
|
|
include the correct header buddy !
|
|
|
|
|
#include <atlstr.h>
Thanks!
Maxwell Chen
|
|
|
|
|
Sakthi_Vel wrote: For ATL program with no MFC support.
Starting from Visual C++ .NET, I think that ATL and MFC have merged together.
Maxwell Chen
|
|
|
|
|
Try using std::stringstream or boost::format[^]!
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|