The brochuremachine.dll from microsoft is a sample project that i want to use with print templates. You can have more info about the dll at this address:
If you look at the code, the print template is loaded from the dll. It means that everytime i want to modify the template, i have to recompile the dll and this is not very practical..
I would like to modify this code so that everytime i call the LaunchPT() method, i could simply pass the URL of the template.. like this: LaunchPT(URL)
This way, i could use as many templates as I want without the need to recompile.
I'm not very good in c++ so any help would be appreciated
. thanks
/*
* Copyright (c) 2000 Microsoft Corporation. All rights reserved.
*/
// PTLauncher.cpp : Implementation of CPTLauncher
#include "stdafx.h"
#include "BrochureMachine.h"
#include "PTLauncher.h"
#include "ExDisp.h"
#include "shlguid.h"
#include "mshtml.h"
#include "mshtmcid.h"
#include "mshtmhst.h"
#include "mshtmdid.h"
/////////////////////////////////////////////////////////////////////////////
// CPTLauncher
STDMETHODIMP CPTLauncher::LaunchPT()
{
CComPtr<IOleContainer> spContainer;
CComPtr<IServiceProvider> spSP;
CComPtr<IWebBrowser2> spWB;
CComPtr<IDispatch> spDisp;
CComPtr<IHTMLDocument2> spDoc;
CComPtr<IOleCommandTarget> spCT;
CComVariant vPTPath = "res://BrochureMachine.dll/PT.htm";
m_spClientSite->GetContainer(&spContainer);
spContainer->QueryInterface(IID_IServiceProvider, (void**)&spSP);
spSP->QueryService(SID_SWebBrowserApp, IID_IWebBrowser, (void**)&spWB);
spWB->get_Document(&spDisp);
spDisp->QueryInterface(IID_IHTMLDocument2, (void**)&spDoc);
spDoc->QueryInterface(IID_IOleCommandTarget, (void**)&spCT);
spCT->Exec(&CGID_MSHTML, IDM_PRINTPREVIEW, NULL, &vPTPath, NULL);
return S_OK;
}
If you look at the code, the print template is loaded from the dll. It means that everytime i want to modify the template, i have to recompile the dll and this is not very practical..
I would like to modify this code so that everytime i call the LaunchPT() method, i could simply pass the URL of the template.. like this: LaunchPT(URL)
This way, i could use as many templates as I want without the need to recompile.
I'm not very good in c++ so any help would be appreciated
. thanks
/*
* Copyright (c) 2000 Microsoft Corporation. All rights reserved.
*/
// PTLauncher.cpp : Implementation of CPTLauncher
#include "stdafx.h"
#include "BrochureMachine.h"
#include "PTLauncher.h"
#include "ExDisp.h"
#include "shlguid.h"
#include "mshtml.h"
#include "mshtmcid.h"
#include "mshtmhst.h"
#include "mshtmdid.h"
/////////////////////////////////////////////////////////////////////////////
// CPTLauncher
STDMETHODIMP CPTLauncher::LaunchPT()
{
CComPtr<IOleContainer> spContainer;
CComPtr<IServiceProvider> spSP;
CComPtr<IWebBrowser2> spWB;
CComPtr<IDispatch> spDisp;
CComPtr<IHTMLDocument2> spDoc;
CComPtr<IOleCommandTarget> spCT;
CComVariant vPTPath = "res://BrochureMachine.dll/PT.htm";
m_spClientSite->GetContainer(&spContainer);
spContainer->QueryInterface(IID_IServiceProvider, (void**)&spSP);
spSP->QueryService(SID_SWebBrowserApp, IID_IWebBrowser, (void**)&spWB);
spWB->get_Document(&spDisp);
spDisp->QueryInterface(IID_IHTMLDocument2, (void**)&spDoc);
spDoc->QueryInterface(IID_IOleCommandTarget, (void**)&spCT);
spCT->Exec(&CGID_MSHTML, IDM_PRINTPREVIEW, NULL, &vPTPath, NULL);
return S_OK;
}