Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to modify brochuremachine.dll from microsoft

Status
Not open for further replies.

magagnon

Programmer
Jun 21, 2002
1
CA
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 = &quot;res://BrochureMachine.dll/PT.htm&quot;;

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;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top