Any DOM experts?

Miscellaneous Forums/General Discussion/Any DOM experts?

This is killing me, any ideas why this crashes at the get_Script() command? The command does not even return a value - it just dies!

	HRESULT			hr;
	IDispatch*		pDocDisp = NULL;
	IHTMLDocument2* pHTMLDoc = NULL;

	hr = c.cpWebBrowser->get_Document(&pDocDisp);

	if (SUCCEEDED(hr)) 
	{
		hr = pDocDisp->QueryInterface(IID_IHTMLDocument2, (void**)&pHTMLDoc);
		if (SUCCEEDED(hr)) 
		{
			IDispatch* pScript;

			hr = pHTMLDoc->get_Script(&pScript); // This Crashes the Browser everytime!!!

			ATLASSERT(SUCCEEDED(hr));

			OLECHAR FAR* sMethod = L"igl_DownloadComplete";

		//	CComBSTR bstrMember("igl_DownloadComplete");

			DISPID dispid = NULL;

			hr = pScript->GetIDsOfNames(IID_NULL, &sMethod, 1, LOCALE_SYSTEM_DEFAULT,&dispid);
		
			if (SUCCEEDED(hr)) 
			{	  // invoke assuming no method parameters
				DISPPARAMS dpNoArgs = {NULL, NULL, 0, 0};
				hr = pScript->Invoke(dispid, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD,&dpNoArgs, NULL, NULL, NULL);
			}
			
			pScript->Release();
			pHTMLDoc->Release();
			return;
		}
	}