Click here to Skip to main content
15,913,941 members
Home / Discussions / Mobile
   

Mobile

 
GeneralRe: battery level notification Pin
ibiteu24-Nov-03 6:35
ibiteu24-Nov-03 6:35 
GeneralRe: battery level notification Pin
João Paulo Figueira4-Nov-03 6:39
professionalJoão Paulo Figueira4-Nov-03 6:39 
GeneralRe: battery level notification Pin
ibiteu24-Nov-03 6:43
ibiteu24-Nov-03 6:43 
GeneralRe: battery level notification Pin
Atlantys4-Nov-03 10:51
Atlantys4-Nov-03 10:51 
GeneralProblem with #import in WinCE Pin
nigs_krec4-Nov-03 1:52
nigs_krec4-Nov-03 1:52 
GeneralRe: Problem with #import in WinCE Pin
João Paulo Figueira4-Nov-03 2:25
professionalJoão Paulo Figueira4-Nov-03 2:25 
QuestionHow to work with https site in Pocket PC 2003 using WinInet and CInternetSession ? Pin
AKSIVAKUMAR3-Nov-03 5:35
AKSIVAKUMAR3-Nov-03 5:35 
QuestionWill the OpenURL function supports SSL with HTTPS URL? Pin
AKSIVAKUMAR3-Nov-03 5:33
AKSIVAKUMAR3-Nov-03 5:33 
Hi All,


I would like to access https:// site from pocket pc 2003 using wininet api's and also I need to login to https:// site programmatically. I implemented the following code using Wininet,CInternetSession and is working fine in pocket pc 2002. The same code is not working with pocket pc 2003.

Will the OpenURL function supports SSL with HTTPS URL?
Is there any functions for working with SSL witih HTTPS URL site? Please exaplin me in detail and let me know if you have any sample code for it.

//Code
CInternetSession *m_Session;
m_Session = new CInternetSession(NULL,1,INTERNET_OPEN_TYPE_PRECONFIG, NULL,NULL, 0);

CInternetFile* m_pFile = NULL;
CHttpFile* m_hFile = NULL;


//Doing the HTTP post URL
TRY
{
//try to connect to the URL
m_hFile = (CHttpFile*) m_Session->OpenURL(strRedirectURL, 1,
INTERNET_FLAG_TRANSFER_ASCII);
}

CATCH (CInternetException, m_pException)
{
//If it is any error in the http response
m_hFile = NULL;

TCHAR szCause[255];
CString strFormatted;

m_pException->GetErrorMessage(szCause, 255);

// In real situations, it is appropriate to read this from
// a string resource so it would be easy to localize.
strFormatted = _T("Error");
strFormatted += szCause;
AfxMessageBox(strFormatted);
m_pException->Delete();
return FALSE;
}
END_CATCH

// Need to store the HTML file into a text file for further process
if (m_hFile)
{
//If the HTTP request is sucessful then do the following
CString readbuffer;

// Continue fetching code until there is no more
while (m_hFile->ReadString(readbuffer) != NULL)
{

DWORD NumOfByteWritten;
unsigned char *pBuf;
char str[] = "\r\n";
int ch = '*';
CString szURL;
WCHAR wcURL[MAX_SIZE]; //max buffer size or need to implement it dynamically

mbstowcs(wcURL,(const char *)readbuffer.GetBuffer(readbuffer.GetLength()),MAX_SIZE);
HANDLE hFile = CreateFile(strFileName,GENERIC_WRITE,0,0,CREATE_ALWAYS,0,0);



if(hFile == INVALID_HANDLE_VALUE)
{
//AfxMessageBox(_T("Problem in Writing URL"));
return FALSE;
}

int iLen = wcslen(wcURL);
CString strLen;
strLen.Format(_T("%d"),iLen);

int mByteLen = WideCharToMultiByte(CP_ACP,0,wcURL,iLen, 0,0,0,0);
pBuf = (unsigned char*)malloc(mByteLen);
ZeroMemory(pBuf,sizeof(pBuf));
WideCharToMultiByte(CP_ACP,0,wcURL,-1,(char *)pBuf,mByteLen,0,0);
WriteFile(hFile, pBuf, mByteLen , &NumOfByteWritten, 0);
readbuffer.Empty();
delete pBuf;
CloseHandle(hFile);

} //end of while

m_hFile->Close();
delete m_hFile;
}
else
{
return FALSE;
}

return TRUE;


Thanks,
AKS
GeneralGSM 6.10 codec Pin
.alex2-Nov-03 6:03
.alex2-Nov-03 6:03 
Generalproblem with activex control events Pin
Amit Dey1-Nov-03 8:02
Amit Dey1-Nov-03 8:02 
GeneralWierd Dialog Box Error Pin
VanHlebar31-Oct-03 8:28
VanHlebar31-Oct-03 8:28 
GeneralRe: Wierd Dialog Box Error Pin
João Paulo Figueira31-Oct-03 11:10
professionalJoão Paulo Figueira31-Oct-03 11:10 
GeneralRe: Wierd Dialog Box Error Pin
VanHlebar31-Oct-03 11:24
VanHlebar31-Oct-03 11:24 
GeneralGetLastError returns invalid number Pin
Aby Philip30-Oct-03 3:11
Aby Philip30-Oct-03 3:11 
GeneralRe: GetLastError returns invalid number Pin
Ian Darling30-Oct-03 3:31
Ian Darling30-Oct-03 3:31 
GeneralRe: GetLastError returns invalid number Pin
Aby Philip30-Oct-03 17:35
Aby Philip30-Oct-03 17:35 
GeneralPC2002 and PC2003 bluetooth problem Pin
matthewtsai30-Oct-03 0:10
matthewtsai30-Oct-03 0:10 
GeneralBluetooth Protocol Pin
Cedric Moonen29-Oct-03 22:21
Cedric Moonen29-Oct-03 22:21 
GeneralHooking in WinCE Pin
Jinoj29-Oct-03 21:40
Jinoj29-Oct-03 21:40 
GeneralMultiple CScrollViews in the same app Pin
VanHlebar29-Oct-03 14:23
VanHlebar29-Oct-03 14:23 
GeneralRe: Multiple CScrollViews in the same app Pin
João Paulo Figueira29-Oct-03 22:50
professionalJoão Paulo Figueira29-Oct-03 22:50 
GeneralCOM Objects and Pocket PC 2003 Pin
Jon Pawley28-Oct-03 11:24
Jon Pawley28-Oct-03 11:24 
GeneralRe: COM Objects and Pocket PC 2003 Pin
gevalia4-Dec-03 6:17
gevalia4-Dec-03 6:17 
QuestionHow can i specify HTMLctrl to translate using UTF-8? Pin
Norber_OK28-Oct-03 6:01
Norber_OK28-Oct-03 6:01 
GeneralSwitching views in SDI application Pin
Cedric Moonen28-Oct-03 3:40
Cedric Moonen28-Oct-03 3:40 

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.