Click here to Skip to main content
16,011,170 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: not really Pin
Nish Nishant6-Mar-02 9:43
sitebuilderNish Nishant6-Mar-02 9:43 
Generalwinsock server accepting multiple clients, sending data back to all clients Pin
Kuniva29-Sep-01 0:25
Kuniva29-Sep-01 0:25 
GeneralRe: winsock server accepting multiple clients, sending data back to all clients Pin
29-Sep-01 2:44
suss29-Sep-01 2:44 
GeneralShell API Pin
vijayaramaraju28-Sep-01 23:47
vijayaramaraju28-Sep-01 23:47 
GeneralRe: Shell API Pin
Paolo Messina29-Sep-01 0:17
professionalPaolo Messina29-Sep-01 0:17 
GeneralRe: Shell API Pin
vijayaramaraju29-Sep-01 1:48
vijayaramaraju29-Sep-01 1:48 
GeneralRe: Shell API Pin
vijayaramaraju29-Sep-01 1:48
vijayaramaraju29-Sep-01 1:48 
GeneralInternet Post Questions Pin
Winston,Dang28-Sep-01 23:45
Winston,Dang28-Sep-01 23:45 
I want to use "Post" to send some paras to a ASP page.When I use Unicode compile mode,the asp can't receive the paras.When I use MBCS compile mode,the asp can received.
Who can give me some advice?

The code is here:
BOOL PostRequest(CString sUrl, CString sContent, CString &sResult)
{
CString strHeaders =
_T("Content-Type: application/x-www-form-urlencoded");

// URL-encoded form variables -
// name = "John Doe", userid = "hithere", other = "P&Q"
//CString accept=
// _T("Accept: */*");
//LPTSTR a=accept.GetBuffer(accept.GetLength());

CString strServerName;
CString strObject;
INTERNET_PORT nPort;
DWORD dwServiceType;
CInternetSession session;
AfxParseURL(sUrl, dwServiceType, strServerName, strObject, nPort);
CHttpConnection * pServer = session.GetHttpConnection(strServerName, nPort);

//CHttpFile *pFile = pServer->OpenRequest(0,
// strObject,NULL,1,(LPCTSTR*)&accept,NULL,INTERNET_FLAG_EXISTING_CONNECT);
if (pServer==NULL)
return false;

CHttpFile *pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST,
strObject);
if(pFile==NULL)
return false;

try
{

BOOL result = pFile->SendRequest(strHeaders,
(LPVOID)(LPCTSTR)sContent, sContent.GetLength());
}
catch (CInternetException e)
{
//MessageBox(NULL,_T("Internet Exception"),_T("Error"),MB_OK);
return false;
}
catch(...)
{
return false;
}
DWORD dwRet;
pFile->QueryInfoStatusCode(dwRet);
}
GeneralRe: Internet Post Questions Pin
Anders Molin29-Sep-01 1:05
professionalAnders Molin29-Sep-01 1:05 
GeneralCDialog::OnInitDialog () Assertion Error Pin
28-Sep-01 23:13
suss28-Sep-01 23:13 
GeneralRe: CDialog::OnInitDialog () Assertion Error Pin
Michael P Butler29-Sep-01 2:08
Michael P Butler29-Sep-01 2:08 
Question‘CdialogBar’? Pin
Ahmad28-Sep-01 22:30
Ahmad28-Sep-01 22:30 
GeneralA simple Callback Howto, please Pin
yarp28-Sep-01 21:39
yarp28-Sep-01 21:39 
General.bmp to .jpg Pin
Maya C28-Sep-01 20:17
Maya C28-Sep-01 20:17 
GeneralRe: .bmp to .jpg Pin
Christian Graus29-Sep-01 21:02
protectorChristian Graus29-Sep-01 21:02 
GeneralAll or nothing Pin
overflow28-Sep-01 17:49
overflow28-Sep-01 17:49 
GeneralRe: All or nothing Pin
Michael Dunn28-Sep-01 20:40
sitebuilderMichael Dunn28-Sep-01 20:40 
GeneralRe: All or nothing Pin
29-Sep-01 2:27
suss29-Sep-01 2:27 
GeneralRe: All or nothing Pin
overflow3-Oct-01 18:49
overflow3-Oct-01 18:49 
GeneralQuestion about GetControlBar() Pin
overflow28-Sep-01 15:42
overflow28-Sep-01 15:42 
QuestionHow can I show/hide the plus symbol of a tree item? Pin
28-Sep-01 15:34
suss28-Sep-01 15:34 
AnswerRe: How can I show/hide the plus symbol of a tree item? Pin
Michael Dunn28-Sep-01 16:20
sitebuilderMichael Dunn28-Sep-01 16:20 
AnswerRe: How can I show/hide the plus symbol of a tree item? Pin
Paolo Messina29-Sep-01 2:42
professionalPaolo Messina29-Sep-01 2:42 
QuestionHow to send an e-mail using OnFileSendMail Pin
28-Sep-01 15:13
suss28-Sep-01 15:13 
AnswerRe: How to send an e-mail using OnFileSendMail Pin
Shog929-Sep-01 10:02
sitebuilderShog929-Sep-01 10:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.