Click here to Skip to main content
16,007,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Chris's Grid Control Doc/View Pin
Matt Newman24-Sep-01 14:25
Matt Newman24-Sep-01 14:25 
GeneralRe: Chris's Grid Control Doc/View Pin
Christian Graus24-Sep-01 15:05
protectorChristian Graus24-Sep-01 15:05 
GeneralRe: Chris's Grid Control Doc/View Pin
Matt Newman24-Sep-01 15:46
Matt Newman24-Sep-01 15:46 
GeneralRe: Chris's Grid Control Doc/View Pin
Chris Maunder24-Sep-01 15:39
cofounderChris Maunder24-Sep-01 15:39 
GeneralRe: Chris's Grid Control Doc/View Pin
Matt Newman24-Sep-01 15:47
Matt Newman24-Sep-01 15:47 
GeneralCustom AppWizard Pin
23-Sep-01 14:53
suss23-Sep-01 14:53 
GeneralRe: Custom AppWizard Pin
abarbs20-Oct-04 2:39
abarbs20-Oct-04 2:39 
GeneralPosting to a form Pin
Christian Skovdal Andersen23-Sep-01 12:23
Christian Skovdal Andersen23-Sep-01 12:23 
Hi,

I would like to post a . I think I have found the right way to do it, but it just will not work. It only works if I want to post an URL (like http://www.foo.com/res.asp&name=bart), but not if it is alot of text.

Below is some sample code, that I would like to use for sending an SMS message programatically.

try{
    CString strHeaders = _T("Content-Type: application/x-www-form-urlencoded");
    CString strFormData = _T("afsender=boetos&modtager=5555554578&besked=this+is+a+test");

    CInternetSession session;
    CHttpConnection* pConnection = session.GetHttpConnection(_T("212.112.128.11"));
    if (pConnection)
    {
        CHttpFile* pFile = pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST, _T("/res.asp"));
        ASSERT(pFile);
        BOOL result = pFile->SendRequest(strHeaders, (LPVOID)(LPCTSTR)strFormData, strFormData.GetLength());
        if (result)
        {
            CString strData;
            CString strBuff;
            while (pFile->ReadString(strBuff))
            {
                strData += strBuff;
                strBuff.Empty();
            }

            //AfxMessageBox(strData);
            FILE *f=fopen("res.html", "w");
            if (f)
            {
                fprintf(f, strData);
                fclose(f);
            }

            AfxMessageBox("Done!");


            pFile->Close();
            delete pFile;
        }
    }
    pConnection->Close();
    delete pConnection;

}
catch (CInternetException* pEx)
{
    // catch errors from WinINet
    pEx->ReportError();
    pEx->Delete();
    return;
}


Can anybody tell me what goes wrong?

Regards,

Christian Skovdal Andersen
GeneralGetting file status without using MFC !!! Pin
Hadi Rezaee23-Sep-01 10:55
Hadi Rezaee23-Sep-01 10:55 
GeneralRe: Getting file status without using MFC !!! Pin
Chris Losinger23-Sep-01 11:07
professionalChris Losinger23-Sep-01 11:07 
GeneralRe: Getting file status without using MFC !!! Pin
Hadi Rezaee23-Sep-01 19:23
Hadi Rezaee23-Sep-01 19:23 
GeneralRe: Getting file status without using MFC !!! Pin
Michael Dunn23-Sep-01 11:19
sitebuilderMichael Dunn23-Sep-01 11:19 
GeneralSetting a permanent size to a control Pin
23-Sep-01 9:30
suss23-Sep-01 9:30 
GeneralRe: Setting a permanent size to a control Pin
Joaquín M López Muñoz23-Sep-01 10:15
Joaquín M López Muñoz23-Sep-01 10:15 
GeneralRe: Setting a permanent size to a control Pin
23-Sep-01 11:08
suss23-Sep-01 11:08 
GeneralRe: Setting a permanent size to a control Pin
Michael Dunn23-Sep-01 11:22
sitebuilderMichael Dunn23-Sep-01 11:22 
GeneralRe: Setting a permanent size to a control Pin
23-Sep-01 11:35
suss23-Sep-01 11:35 
GeneralRe: Setting a permanent size to a control Pin
Joaquín M López Muñoz23-Sep-01 11:36
Joaquín M López Muñoz23-Sep-01 11:36 
GeneralRe: Setting a permanent size to a control Pin
23-Sep-01 12:41
suss23-Sep-01 12:41 
GeneralRe: Setting a permanent size to a control Pin
23-Sep-01 14:14
suss23-Sep-01 14:14 
QuestionWhen I print preview a document, I see it. But if I zoom in the content disappears?? Pin
DanYELL23-Sep-01 8:34
DanYELL23-Sep-01 8:34 
GeneralActiveX Pin
23-Sep-01 7:25
suss23-Sep-01 7:25 
GeneralFull Screen with MDI Pin
23-Sep-01 6:41
suss23-Sep-01 6:41 
GeneralOnNcPaint() Pin
23-Sep-01 5:22
suss23-Sep-01 5:22 
GeneralRe: OnNcPaint() Pin
23-Sep-01 5:47
suss23-Sep-01 5:47 

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.