Boulent Mustafa
2004-05-17 12:31:31 UTC
I am looking at creating a Windows CE Application in Embedded Visual
C++ that will connect to the internet and retrieve a text file from
the htaccess protected area of our website.
However I need some way of making the application integrate with the
htaccess mechanism.
The idea is that the username and password is entered and it then
becomes part of the URL.
Once this has been achieved the application will load a Flash Movie in
Pocket Internet Explorer, the text file is a data source for the flash
movie.
Any suggestions as to where I am going wrong would be most
appreciated. I have inserted a copy of the function below.
Kind Regards,
Boulent
void Go()
{
int usernamechars = GetDlgItemText(g_hwndDialog, IDC_N, username,
NULL);
int passwordchars = GetDlgItemText(g_hwndDialog, IDC_P, password,
NULL);
// if ((username <= "") || (password <= ""))
// MessageBox(g_hwndDialog, L"Please enter your username and/or
password", L"Input error", MB_ICONSTOP);
LPCTSTR EquinexInternet = _T("Equinex-Internet");
// LPCTSTR HttpPrefix = _T("http://");
// LPCTSTR Colon = _T(":");
// LPCTSTR UrlSuffix = _T("");
// LPCTSTR UrlToOpen =
LPCTSTR UrlToOpen = _T("http://username:***@url/to/open");
HINTERNET NetStatus = InternetOpen(EquinexInternet,
INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, NULL);
HINTERNET OpenUrlStatus = InternetOpenUrl(NetStatus, UrlToOpen, NULL,
NULL, INTERNET_FLAG_DONT_CACHE, NULL);
// BSTR btitleURL =
SysAllocString(TEXT("http://username:***@url/to/open"));
// SendMessage(g_hwndDialog, DTM_NAVIGATE, 0, (LPARAM)btitleURL);
// SysFreeString(btitleURL);
SHELLEXECUTEINFO offlinedata;
ZeroMemory(&offlinedata, sizeof(SHELLEXECUTEINFO));
offlinedata.cbSize = sizeof(SHELLEXECUTEINFO);
offlinedata.lpFile = _T("file:///my documents/webpage.htm");
offlinedata.nShow = SW_SHOW;
ShellExecuteEx(&offlinedata);
BOOL XHCacheEntry;
LPCTSTR XHUrlName =
_T("urltocache");
DWORD XHFileSize = 0;
LPCTSTR XHFileExtension = 0;
LPTSTR XHFileName = 0;;
DWORD XHdwReserved = 0;
// HWND hwButton = GetDlgItem(g_hwndDialog, IDC_BUTTON1);
int nCnt;
TCHAR szBufW[16];
wsprintf(szBufW, L"Button %d", nCnt);
// Button_SetText(hwButton, szBufW);
XHCacheEntry = CreateUrlCacheEntry(XHUrlName, XHFileSize,
XHFileExtension, XHFileName, XHdwReserved);
}
C++ that will connect to the internet and retrieve a text file from
the htaccess protected area of our website.
However I need some way of making the application integrate with the
htaccess mechanism.
The idea is that the username and password is entered and it then
becomes part of the URL.
Once this has been achieved the application will load a Flash Movie in
Pocket Internet Explorer, the text file is a data source for the flash
movie.
Any suggestions as to where I am going wrong would be most
appreciated. I have inserted a copy of the function below.
Kind Regards,
Boulent
void Go()
{
int usernamechars = GetDlgItemText(g_hwndDialog, IDC_N, username,
NULL);
int passwordchars = GetDlgItemText(g_hwndDialog, IDC_P, password,
NULL);
// if ((username <= "") || (password <= ""))
// MessageBox(g_hwndDialog, L"Please enter your username and/or
password", L"Input error", MB_ICONSTOP);
LPCTSTR EquinexInternet = _T("Equinex-Internet");
// LPCTSTR HttpPrefix = _T("http://");
// LPCTSTR Colon = _T(":");
// LPCTSTR UrlSuffix = _T("");
// LPCTSTR UrlToOpen =
LPCTSTR UrlToOpen = _T("http://username:***@url/to/open");
HINTERNET NetStatus = InternetOpen(EquinexInternet,
INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, NULL);
HINTERNET OpenUrlStatus = InternetOpenUrl(NetStatus, UrlToOpen, NULL,
NULL, INTERNET_FLAG_DONT_CACHE, NULL);
// BSTR btitleURL =
SysAllocString(TEXT("http://username:***@url/to/open"));
// SendMessage(g_hwndDialog, DTM_NAVIGATE, 0, (LPARAM)btitleURL);
// SysFreeString(btitleURL);
SHELLEXECUTEINFO offlinedata;
ZeroMemory(&offlinedata, sizeof(SHELLEXECUTEINFO));
offlinedata.cbSize = sizeof(SHELLEXECUTEINFO);
offlinedata.lpFile = _T("file:///my documents/webpage.htm");
offlinedata.nShow = SW_SHOW;
ShellExecuteEx(&offlinedata);
BOOL XHCacheEntry;
LPCTSTR XHUrlName =
_T("urltocache");
DWORD XHFileSize = 0;
LPCTSTR XHFileExtension = 0;
LPTSTR XHFileName = 0;;
DWORD XHdwReserved = 0;
// HWND hwButton = GetDlgItem(g_hwndDialog, IDC_BUTTON1);
int nCnt;
TCHAR szBufW[16];
wsprintf(szBufW, L"Button %d", nCnt);
// Button_SetText(hwButton, szBufW);
XHCacheEntry = CreateUrlCacheEntry(XHUrlName, XHFileSize,
XHFileExtension, XHFileName, XHdwReserved);
}