Yes but obviously, you can't use ASP within an ISAPI DLL if that was not
what you were trying to do, then GetObjectContext will work of course.
hr = CoGetObjectContext(IID_IObjectContext, (void **) &m_piObjContext);
if (SUCCEEDED(hr))
{
// Get the ASP intrinsic Interfaces
CComQIPtr<IContextProperties> pProps(m_piObjContext);
if(pProps != NULL)
{
// Get Request Object Pointer
AllocCString(&bstrProp, L"Request");
hr = pProps->GetProperty(bstrProp, &vitem);
if (hr == S_OK)
{
vitem.pdispVal->QueryInterface(&m_piRequest);
::VariantClear(&vitem);
}
AllocCString(&bstrProp, L"Response");
hr = pProps->GetProperty(bstrProp, &vitem);
if (hr == S_OK)
{
vitem.pdispVal->QueryInterface(&m_piResponse);
::VariantClear(&vitem);
}
}
etc
--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm [quoted text, click to view] "Richard Hollis" <richard_hollis@hotmail.com> wrote in message
news:%233DV9hdxEHA.2876@TK2MSFTNGP12.phx.gbl...
> Found the answer to this in:
>
>
http://groups.google.com/groups?hl=en&lr=&threadm=525201c2bcca%24e7b85c30%24d2f82ecf%40TK2MSFTNGXA09&rnum=4&prev=/groups%3Fq%3Diresponse%2Bobjectcontext%26hl%3Den%26lr%3D%26selm%3D525201c2bcca%2524e7b85c30%2524d2f82ecf%2540TK2MSFTNGXA09%26rnum%3D4
>
>
> "Richard Hollis" <richard_hollis@hotmail.com> wrote in message
> news:eO4KLiCxEHA.1396@tk2msftngp13.phx.gbl...
>> Microsoft docs say that IScriptingContext is obsolete, "you should not
>> use
>> it except in legacy ASP applications. The interface exposes methods that
>> your component can use to retrieve the ASP built-in objects."
>>
>>
>>
>> I have a control, which can render some large pages, and these are
> currently
>> returned to the calling ASP page in the form of a BSTR, which is then in
>> turn passed, to Response.Write.
>>
>>
>>
>> Should I continue to use this approach or should I really by trying to
> write
>> directly to the stream itself? And, if I should be trying to write to
>> the
>> stream then how should I obtain the Response stream object inside the COM
>> object?
>>
>>
>>
>> Richard
>>
>>
>
>