this is the listing for reading the server's response :
BOOL HSock::ReceiveCommand(CString &strResponse)
{
if ((m_arIn!=NULL)&&(m_arIn->IsLoading()))
{
TRY
{
char c;
while ((m_socketFile->Read(&c,sizeof(c))>0)&&(c='\n'))
strResponse += _T(c)...
No cause it is in the same computer (localhost) i finally found a solution not using CArchive for the incoming stream but the CSocketFile (m_socketFile.Read())
Thnx for answering :)
Hi! I am writting a programm and I want to "speak" with a server. I used CSocket,CSocketFile in order to create two CArchives one for reading and one for writing.
I use the code below :
m_arOut->WriteString(szMessage);
m_arOut->Flush();
while (!m_arIn->IsBufferEmpty())
{...
Hi! I want to have a client which connects with a server written in Java. In details :
I want to send a string like : <request>command</request> and I want to receive the response which is of the type : <response>answer</response>
I know that the Java server uses the function readline to read...
you should try :
ShellExecute(hwndYourWindow,"open","my.html", NULL,NULL,SW_SHOWNORMAL);
or even better :
ShellExecute(hwndYourWindow,"open","C:\\path\\to\\my.html", NULL,NULL,SW_SHOWNORMAL);
look the MSDN documents on ShellExecute()
another command is...
I really need help here :
I have a CObject devired class named : COrderInfo
and i want to have a type safe list
that's why i try to make a list like that :
typedef CTypedPtrList<CObList, COrderInfo*> COrderList;
but it keeps outputing error in compiler. :(
NEXT I tried to define a variable...
Thnx a lot for your reply.
What I want is an Object which I insert items and I am able to determine its position
(for example :
my_object.InsertItem(my_item,position_x,position_y,hIcon[1]); )
i looked for CListView but I don't thing that i can places the items wherever.
It is very simple :
CListCtr * temp_list = (CListCtr*)GetDlgItem(ID_LIST);
and now you have your variable (it is a pointer now)
so you will use :
temp_list->InsertItem(&lvi);
i forgot to tell you that buf is a char * which has the string you want to add.
to add an item to a list control :
LVITEM lvi;
lvi.mask = LVIF_TEXT;
lvi.iItem = i;
lvi.iSubItem = 0;
lvi.pszText = (LPTSTR)(LPCTSTR)(buf);
listItem = my_list_variable.InsertItem(&lvi);
where my_list_variable is a variable of the CListCtr
I have an SDI app (derived from CFromView an I want to exit using a button.
I can do that from the menu (ID_APP_EXIT) or the status bar. I tried :
void CMyView::OnExit()
{
CFormView::OnClose();
}
but i didn't work
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.