Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ C++/CLI Javascript HTML COM , +
Hi,
 
My question is simple, it just to make a simple chat program, via web instead of using server/clients. However, it could be using the following URL:
 
http://www.sbox.ws/sbox_ws.php?name=Name&website=&shoutid=1b867wq7jorwwf4u0qwk
 
I mean by this above, this site has button, named submit and the small text for entering the message then for submit the text as chat program exactly :
 
In c++, I got the following codes:
#include "afxinet.h" 

BOOL DoSubmitURLText(const char *url, CString &errorMessage) { 
TCHAR szCause[255]; errorMessage = "OK"; 
TRY { 
CInternetSession session; 
session.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 1000); session.SetOption(INTERNET_OPTION_CONNECT_RETRIES, 3); 
session.OpenURL(url, 1 ,INTERNET_FLAG_TRANSFER_ASCII |INTERNET_FLAG_FORMS_SUBMIT); }
 CATCH_ALL(error)
 { 
error->GetErrorMessage(szCause,254,NULL); 
errorMessage.Format("%s",szCause); 
return FALSE; 
} END_CATCH_ALL; 
return TRUE; 
}
 
In OpenURL, has the function for open this URL, without open it in the browser.
 
I mean, by I would like to make this action, by sending also the message via that website(shoutbox above ) also to submit it.
 
Is there any codes in c++ for control this ? adding or modified something ?
 
Thank in advance!
Posted 3-Aug-12 13:25pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Instead of trawling the web for random code, start from the top. A simple chat program, via the web, is probably going to be in a browser. Therefore, you'd write it using a back end like ASP.NET, and with lots of javascript/AJAX to handle the chatting.
  Permalink  
Comments
skonliner at 3-Aug-12 18:59pm
   
Yes, it could be. But I mean by using it in c++ program application, and it controls that web site. by using it as sub party. means what, using the codes are actually within c++ application. but non using by any server/clients applications. SO, the messages are reaching at short times easily instated of stupid messages for accepting and receiving messages for communication and perhaps, fails connections between the server and clients.
Christian Graus at 3-Aug-12 19:02pm
   
Basically you'd need to write code to send and receive pages the way a browser does, and then parse them in order to send and receive the data that the browser collects in the UI. This is obviously more complex than writing a web page, where half of it is done for you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 535
1 OriginalGriff 275
2 Shweta N Mishra 244
3 BillWoodruff 235
4 Deepu S Nair 230
0 OriginalGriff 6,168
1 Sergey Alexandrovich Kryukov 5,818
2 DamithSL 4,958
3 Manas Bhardwaj 4,539
4 Maciej Los 3,755


Advertise | Privacy | Mobile
Web04 | 2.8.1411019.1 | Last Updated 3 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100