Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C run-time file copy routine Pin
ThatsAlok27-Jul-06 0:09
ThatsAlok27-Jul-06 0:09 
Questionwin32 dll and MFC dll Pin
maharaja pandian26-Jul-06 22:45
maharaja pandian26-Jul-06 22:45 
QuestionAutomatically run application after installation Pin
Nicola Bottinelli26-Jul-06 22:39
Nicola Bottinelli26-Jul-06 22:39 
AnswerRe: Automatically run application after installation Pin
Aneesh Valeri26-Jul-06 23:31
Aneesh Valeri26-Jul-06 23:31 
GeneralRe: Automatically run application after installation Pin
Nicola Bottinelli26-Jul-06 23:39
Nicola Bottinelli26-Jul-06 23:39 
GeneralRe: Automatically run application after installation Pin
David Crow27-Jul-06 3:11
David Crow27-Jul-06 3:11 
AnswerRe: Automatically run application after installation Pin
Naveen27-Jul-06 0:03
Naveen27-Jul-06 0:03 
QuestionHTTPS connection with C++/MFC [modified] Pin
misz_czu26-Jul-06 22:34
misz_czu26-Jul-06 22:34 
I'm trying to connect with a HTTPS site and download its content. Unfortunately I stuck and I have got a problem that I cannot deal with. I still get an Invalid Certificate Authority Error although I used the code presented in: http://support.microsoft.com/default.aspx?scid=KB;en-us;q182888.
I really hope that someone will help me.

The full code that I'm using:
<br />
CInternetSession session;<br />
CHttpConnection* pServer = NULL;<br />
CHttpFile* pFile = NULL;<br />
<br />
session.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 1,000 * 20);<br />
session.SetOption(INTERNET_OPTION_CONNECT_BACKOFF, 1000);<br />
session.SetOption(INTERNET_OPTION_CONNECT_RETRIES, 1);<br />
<br />
CHttpConnection* pConnection = session.GetHttpConnection("www.site.com",INTERNET_FLAG_SECURE|SECURITY_FLAG_IGNORE_UNKNOWN_CA|INTERNET_FLAG_IGNORE_C<br />
ERT_DATE_INVALID|INTERNET_FLAG_IGNORE_CERT_CN_INVALID,443,"login","password");<br />
pFile = pConnection->OpenRequest(CHttpConnection::HTTP_VERB_GET,"/",<br />
NULL, 1, NULL, NULL,INTERNET_FLAG_EXISTING_CONNECT|<br />
INTERNET_FLAG_RELOAD|<br />
INTERNET_FLAG_NO_CACHE_WRITE|<br />
INTERNET_FLAG_SECURE|<br />
INTERNET_FLAG_IGNORE_CERT_DATE_INVALID|<br />
INTERNET_FLAG_IGNORE_CERT_CN_INVALID|SECURITY_FLAG_IGNORE_UNKNOWN_CA|SECURITY_IN<br />
TERNET_MASK|SECURITY_SET_MASK);<br />
DWORD dwError;<br />
again:<br />
   if (!HttpSendRequest(pFile,NULL,NULL,NULL,NULL))<br />
   dwError = GetLastError ();<br />
<br />
   if (dwError == ERROR_INTERNET_INVALID_CA)<br />
    {<br />
     DWORD dwFlags;<br />
     DWORD dwBuffLen = sizeof(dwFlags);<br />
<br />
     InternetQueryOption (pFile, INTERNET_OPTION_SECURITY_FLAGS,<br />
           (LPVOID)&dwFlags, &dwBuffLen);<br />
<br />
     dwFlags |= SECURITY_FLAG_IGNORE_UNKNOWN_CA;<br />
     InternetSetOption (pFile, INTERNET_OPTION_SECURITY_FLAGS,<br />
                           &dwFlags, sizeof (dwFlags) );<br />
     goto again;<br />
    }<br />
<br />
CString out;<br />
TCHAR sz[1024];<br />
while (pFile->ReadString(sz, 1023))<br />
{<br />
 out+=sz;<br />
}<br />
pFile->Close();<br />
CTestDlg::m_plik.SetWindowText(out);<br />



-- modified at 4:34 Thursday 27th July, 2006
QuestionDisabling a perticular item in a listbox Pin
Vinod Moorkkan26-Jul-06 22:31
Vinod Moorkkan26-Jul-06 22:31 
AnswerRe: Disabling a perticular item in a listbox Pin
Naveen26-Jul-06 23:04
Naveen26-Jul-06 23:04 
AnswerRe: Disabling a perticular item in a listbox Pin
Hamid_RT27-Jul-06 1:57
Hamid_RT27-Jul-06 1:57 
QuestionMath equation solving Pin
Hadi Dayvary26-Jul-06 22:15
professionalHadi Dayvary26-Jul-06 22:15 
AnswerRe: Math equation solving Pin
Cedric Moonen26-Jul-06 22:27
Cedric Moonen26-Jul-06 22:27 
GeneralRe: Math equation solving Pin
Hadi Dayvary26-Jul-06 22:47
professionalHadi Dayvary26-Jul-06 22:47 
GeneralRe: Math equation solving Pin
_AnsHUMAN_ 26-Jul-06 23:02
_AnsHUMAN_ 26-Jul-06 23:02 
Questionstored procedures [modified] Pin
tanarnelinistit26-Jul-06 21:53
tanarnelinistit26-Jul-06 21:53 
AnswerRe: stored procedures Pin
Naveen26-Jul-06 21:57
Naveen26-Jul-06 21:57 
GeneralRe: stored procedures Pin
tanarnelinistit26-Jul-06 22:02
tanarnelinistit26-Jul-06 22:02 
AnswerRe: stored procedures [modified] Pin
Ajesh.Sreevalsa26-Jul-06 23:55
Ajesh.Sreevalsa26-Jul-06 23:55 
QuestionDirectX9 problem Pin
blue_rabbit26-Jul-06 21:19
blue_rabbit26-Jul-06 21:19 
AnswerRe: DirectX9 problem Pin
Sarath C26-Jul-06 21:52
Sarath C26-Jul-06 21:52 
GeneralRe: DirectX9 problem Pin
blue_rabbit26-Jul-06 22:11
blue_rabbit26-Jul-06 22:11 
GeneralRe: DirectX9 problem Pin
Sarath C26-Jul-06 22:16
Sarath C26-Jul-06 22:16 
QuestionCLayoutHelper Color Problem Pin
mikobi26-Jul-06 21:10
mikobi26-Jul-06 21:10 
AnswerRe: CLayoutHelper Color Problem Pin
Naveen26-Jul-06 21:35
Naveen26-Jul-06 21:35 

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.