Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. ActiveX control developement--help

ActiveX control developement--help

Scheduled Pinned Locked Moved COM
wpfcomsysadminhelp
2 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jithus
    wrote on last edited by
    #1

    i am developing an activeX control which displays a print preview.The print preview style depends on user input.The styles are controlled by print preview template files which reside on the web server. i am using the following code: CComPtr spContainer; CComPtr spSP; CComPtr spWB; CComPtr spDisp; CComPtr spDoc; CComPtr 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; this compiles fine but when i execute it i get a blank print teplate file.But when the file url is used everthing goes fine. Waiting for your valuable help regards jithus

    Y 1 Reply Last reply
    0
    • J jithus

      i am developing an activeX control which displays a print preview.The print preview style depends on user input.The styles are controlled by print preview template files which reside on the web server. i am using the following code: CComPtr spContainer; CComPtr spSP; CComPtr spWB; CComPtr spDisp; CComPtr spDoc; CComPtr 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; this compiles fine but when i execute it i get a blank print teplate file.But when the file url is used everthing goes fine. Waiting for your valuable help regards jithus

      Y Offline
      Y Offline
      yhjnet
      wrote on last edited by
      #2

      m_spClientSite cau u tell me how to define this"m_spClientSite"? 3ks,best regards!:confused:

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups