Click here to Skip to main content
15,902,198 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: bmp image on dialog box Pin
Code-o-mat10-Dec-08 4:14
Code-o-mat10-Dec-08 4:14 
AnswerRe: bmp image on dialog box Pin
VC++Maniac10-Dec-08 17:30
VC++Maniac10-Dec-08 17:30 
GeneralRe: bmp image on dialog box Pin
VC++Maniac10-Dec-08 19:28
VC++Maniac10-Dec-08 19:28 
Questionhow to divide panes of status bar of dialog box into equal parts? Pin
puppya9-Dec-08 17:01
puppya9-Dec-08 17:01 
AnswerRe: how to divide panes of status bar of dialog box into equal parts? Pin
_AnsHUMAN_ 9-Dec-08 17:25
_AnsHUMAN_ 9-Dec-08 17:25 
QuestionWhat does this error mean? Pin
monsieur_jj9-Dec-08 15:36
monsieur_jj9-Dec-08 15:36 
AnswerRe: What does this error mean? Pin
_AnsHUMAN_ 9-Dec-08 16:47
_AnsHUMAN_ 9-Dec-08 16:47 
QuestionCInternetSession.OpenURL on Windows Mobile fails Pin
Jessn9-Dec-08 10:28
Jessn9-Dec-08 10:28 
Hi there

I am trying to establish an Internet session (HTTP GET) with a MFC
application on a Windows Mobile 6 platform. First I tried with
OpenRequest() and SendRequest(), but when the code reached SendRequest
() the application crashed in the evil way. Secondily I tried to use
OpenURL() but it keeps saying that it cannot find the server. I have
even connected the device to my WLAN to ensure I had a stable Internet
connection.

CString GoogleMap::getMapUrl(int width, int height, double lng, double
lat, int zoom, CString format)
{
char * szUrl = (char*)malloc(256);
char * szFormat = "http://maps.google.com/staticmap?center=%f,%f&format=%s&zoom=%d&size=%dx%d&key=%s";

sprintf(szUrl, szFormat, lat, lng, format, zoom, width, height,m_szAPIKey);
CString s = CString(szUrl);
return  s;
}

BYTE* GoogleMap::loadHttpFile(CString url, long &length)
{
BYTE* buffer = NULL;
CInternetSession session;
CHttpConnection * hc = NULL;

hc = session.GetHttpConnection(_T("maps.google.com"), 0, 80, NULL,NULL);
if (!hc) return NULL;
//CHttpFile* pFile = hc->OpenRequest(CHttpConnection::HTTP_VERB_GET,_T("index.html"));
//pFile->SendRequest();
CHttpFile* pFile = (CHttpFile*)session.OpenURL(url);  // FAILS!!!

length = (long)pFile->GetLength();
if (!length) return NULL;
buffer = (BYTE*)malloc(length + 1);
memset(buffer, 0, length +1);
for ( DWORD dwRead1;dwRead1=pFile->Read(buffer,length); );
return buffer;
}


Could someone please tell me what I do wrong?

Thanks in advance,
Jess

--
Jess Nielsen, b.sc.
Security Analyst

http://jessn.blogspot.com/
QuestionHow do I completely take over drawing for a listbox Pin
KellyR9-Dec-08 9:46
KellyR9-Dec-08 9:46 
AnswerRe: How do I completely take over drawing for a listbox Pin
enhzflep9-Dec-08 12:03
enhzflep9-Dec-08 12:03 
GeneralRe: How do I completely take over drawing for a listbox Pin
KellyR10-Dec-08 4:00
KellyR10-Dec-08 4:00 
QuestionFinding out the source from which a base class function is called. Pin
rajandpayal9-Dec-08 9:24
rajandpayal9-Dec-08 9:24 
AnswerRe: Finding out the source from which a base class function is called. Pin
rajandpayal9-Dec-08 9:27
rajandpayal9-Dec-08 9:27 
GeneralRe: Finding out the source from which a base class function is called. Pin
Chris Losinger9-Dec-08 13:21
professionalChris Losinger9-Dec-08 13:21 
GeneralRe: Finding out the source from which a base class function is called. Pin
rajandpayal10-Dec-08 5:01
rajandpayal10-Dec-08 5:01 
GeneralRe: Finding out the source from which a base class function is called. Pin
Chris Losinger10-Dec-08 5:05
professionalChris Losinger10-Dec-08 5:05 
QuestionStrange Problem regarding PING ?? Pin
AhmedOsamaMoh9-Dec-08 8:39
AhmedOsamaMoh9-Dec-08 8:39 
AnswerRe: Strange Problem regarding PING ?? Pin
gori_sikten9-Dec-08 17:10
gori_sikten9-Dec-08 17:10 
GeneralRe: Strange Problem regarding PING ?? Pin
AhmedOsamaMoh10-Dec-08 0:44
AhmedOsamaMoh10-Dec-08 0:44 
AnswerRe: Strange Problem regarding PING ?? Pin
Cosmic Egg12-Dec-08 11:00
Cosmic Egg12-Dec-08 11:00 
QuestionCurrenttime to Variant Pin
pratap19809-Dec-08 7:50
pratap19809-Dec-08 7:50 
AnswerRe: Currenttime to Variant Pin
Mark Salsbery9-Dec-08 8:46
Mark Salsbery9-Dec-08 8:46 
AnswerRe: Currenttime to Variant Pin
Michael Dunn9-Dec-08 13:29
sitebuilderMichael Dunn9-Dec-08 13:29 
Generalsize of file Pin
indiraagandhi9-Dec-08 7:49
indiraagandhi9-Dec-08 7:49 
GeneralRe: size of file Pin
Cedric Moonen9-Dec-08 7:53
Cedric Moonen9-Dec-08 7:53 

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.