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. C / C++ / MFC
  4. Using MS Office Spreadsheet ActiveX Control

Using MS Office Spreadsheet ActiveX Control

Scheduled Pinned Locked Moved C / C++ / MFC
helpcom
1 Posts 1 Posters 1 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
    JonahD
    wrote on last edited by
    #1

    Hello, First off, let me say that I'm fairly new to ActiveX controls, so I'm probably missing something obvious, but here's the situation. I'm trying to use the Microsoft Office Spreadsheet 11.0 control in a dialog application. I've gone through all of the steps to get the class added to my project. I found the control in the Registered ActiveX Controls folder and selected it, I left the default classes selected and it appeared to create all of the wrapper classes without any major hiccups. The problem comes when I try to compile the program. I get many errors (around 35) which read: error C2440: 'type cast' : cannot convert from 'struct IDispatch *' to 'class CSpreadsheet' No constructor could take the source type, or constructor overload resolution was ambiguous The errors occur in various classes, but invariably the function causing the error has this structure: CSpreadsheet CXmlMaps::GetApplication() { LPDISPATCH pDispatch; InvokeHelper(0x60020004, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&pDispatch, NULL); return CSpreadsheet(pDispatch); } The problem seems to be calling the CSpreadsheet (one of the wrapper classes created by the ActiveX wizard) constructor, but CSpreadsheet doesn't appear to have any constructors defined. It's derived from CWnd, so I don't think there are any suitable constructors there either. I've been able to successfully use some of the simpler ActiveX controls (such as the Calendar control), but it seems to hang up on this one for some reason. Any insight would be helpful. I hope I've explained it well enough. Thanks! JD

    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