Aintzane
2004-12-15 11:52:06 UTC
Hi, we're developing an ISAPI Filter and we're having problems. We
have been given an ATL COM object which is running in a server. Our
ISAPI Filter is going to run in the same server.
In the filter we call a function of the object which returns a pointer
which will be an XML document. This is the part of our code that
doesn't work properly:
APISESIONLib::Inapisesion * pApiSesion;
HRESULT hr = NULL;
MSXML::IXMLDOMDocument * pDoc = NULL;
struct IDispatch* sid = NULL;
BSTR szIP = XXXX; (an IP address)
BSTR bstr;
CoInitialize (NULL);
hr = CoCreateInstance (APISESIONLib::CLSID_apisesion, NULL,
CLSCTX_SERVER, APISESIONLib::IID_Inapisesion, (void **)&pApiSesion);
hr = pApiSesion->raw_APISesionResolverDominio (szIP, &sid);
CoUninitialize();
pDoc = (MSXML::IXMLDOMDocument *)sid;
pDoc->get_xml (&bstr);
What happens is the following. The function CoCreateInstance works
well, it returns hr = S_OK. The function
"raw_APISesionResolverDominio" of the APISesion object works well too,
we have tested that before returning from the object, the "sid"
parameter contains a correct XML document. The returned parameter
"sid" is not null, but after "get_xml" function "bstr" is empty
We don't know what is happening. Is there something missed or wrong in
this code? Thanks in advance.
Aintzane
have been given an ATL COM object which is running in a server. Our
ISAPI Filter is going to run in the same server.
In the filter we call a function of the object which returns a pointer
which will be an XML document. This is the part of our code that
doesn't work properly:
APISESIONLib::Inapisesion * pApiSesion;
HRESULT hr = NULL;
MSXML::IXMLDOMDocument * pDoc = NULL;
struct IDispatch* sid = NULL;
BSTR szIP = XXXX; (an IP address)
BSTR bstr;
CoInitialize (NULL);
hr = CoCreateInstance (APISESIONLib::CLSID_apisesion, NULL,
CLSCTX_SERVER, APISESIONLib::IID_Inapisesion, (void **)&pApiSesion);
hr = pApiSesion->raw_APISesionResolverDominio (szIP, &sid);
CoUninitialize();
pDoc = (MSXML::IXMLDOMDocument *)sid;
pDoc->get_xml (&bstr);
What happens is the following. The function CoCreateInstance works
well, it returns hr = S_OK. The function
"raw_APISesionResolverDominio" of the APISesion object works well too,
we have tested that before returning from the object, the "sid"
parameter contains a correct XML document. The returned parameter
"sid" is not null, but after "get_xml" function "bstr" is empty
We don't know what is happening. Is there something missed or wrong in
this code? Thanks in advance.
Aintzane