예제 #1
0
STDMETHODIMP CEScriptDocument::LoadDocumentByteArray(/*[in]*/ SAFEARRAY* dataArray, /*[out,retval]*/ VARIANT_BOOL* success)
{
#if 0
	m_webDocument->LoadDocumentByteArray(dataArray, success);
	if (*success)
	{
		Prepare();

		m_lockSource++;

		VARIANT_BOOL bsuccess;
		m_xmlcnt->parse(&bsuccess);

		m_lockSource--;

		Fire_doneParsingDOM();

		if (bsuccess)
		{
		}
	}

	if (*success)
	{
		if (m_pTree && !m_pTree->m_childList.IsEmpty())
		{
			SetTargetElement((CElement*)m_pTree->m_childList.GetHead(), 0);
		}
	}
#endif

	return S_OK;
}
예제 #2
0
// IPersistMoniker
STDMETHODIMP CESceneDocument::Load(
      /* [in] */ BOOL fFullyAvailable,
      /* [in] */ IMoniker *pimkName,
      /* [in] */ LPBC pibc,
      /* [in] */ DWORD grfMode)
{
	HRESULT hr;

	hr = m_scene.CoCreateInstance(CLSID_LX3DScene);

	if (SUCCEEDED(hr))
	{
		/*
		CComQIPtr<IOleObject> spOleObject = m_document;
		if (spOleObject)
		{
			spOleObject->SetClientSite(this);
*/
			CComQIPtr<IPersistMoniker> persistMoniker = m_scene;
			if (persistMoniker)
			{
		//		m_document->put_errorHandler(this);

				hr = persistMoniker->Load(fFullyAvailable, pimkName, pibc, grfMode);
				if (SUCCEEDED(hr))
				{
					LPOLESTR displayName;
					pimkName->GetDisplayName(pibc, NULL, &displayName);
					m_pathName = displayName;
					m_fileTitle = PathFindFileName(m_pathName);
					CoTaskMemFree(displayName);

#if 0
					m_lockSource++;

					Prepare();

					InitTree();

#if 0	// TODO, have this somewhere, but m_app isn't set here yet
					AddRenderBehavior();
#endif

					SetupEventListener();

					Fire_doneParsingDOM();

					m_lockSource--;
#endif

					return S_OK;
				}
			}
		//}
	}

	return E_FAIL;
}
예제 #3
0
void CEScriptDocument::TextChanged()
{
	ClearErrors();

	CComQIPtr<IActiveScriptParse> scriptParse = m_activeScript;
	if (scriptParse)
	{
		HRESULT hr;

		hr = m_activeScript->SetScriptState(SCRIPTSTATE_INITIALIZED);
		if (SUCCEEDED(hr))
		{
			BSTR text;
			m_textData->get_data(&text);

			EXCEPINFO	excepinfo;

			hr = scriptParse->ParseScriptText(
				text,
				NULL,
				NULL,
				NULL,
				0,
				0,
				0,	// Flags
				NULL,
				&excepinfo);

			//m_activeScript->Close();
		}
		else
			ATLASSERT(0);
	}

	Fire_doneParsingDOM();
}