We help IT Professionals succeed at work.

How to submit html form within mfc code

jhattingh asked
Basically, I found a web page that sends text messages to mobile phones. I'd like to write a dialog app that exposes the same options but uses and submits the form from my MFC app.... how?

Watch Question

You can use the CHttpConnection and CHttpFile to connect to the server and submit to the URL with the appropriate header data filled in.

Use CHttpConnection (http://msdn.microsoft.com/library/en-us/vcmfc98/html/_mfc_chttpconnection_class_members.asp?frame=true) to connect to the appropriate server and open a request.

Then use CHttpFile (http://msdn.microsoft.com/library/en-us/vcmfc98/html/_mfc_chttpfile_class_members.asp?frame=true) to setup the header information for the form data with the AddRequestHeaders method and submit the request by calling SendRequestEx.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.