none
Expose VSTO Application AddIn to C++ MFC RRS feed

  • Question

  • I have developed a VSTO Application addin in Word 2010. I want to expose it's functionality to a range of different modules. I followed the article://blogs.msdn.com/b/andreww/archive/2008/08/11/why-your-comaddin-object-should-derive-from-standardolemarshalobject.aspx

    To verify the implementation I have been able to successful access the addin from another legacy C++/ATL native addin via the ComAddIn collection object.

    The next task is to access the vsto addin from a C++/MFC application. I looked everywhere but I couldn't find relevant documentation on how to do this. Most documents starts by assuming you can acess the COMAddin collection object. How do I do that in C++/MFC?

    Thanks.

    Thursday, January 24, 2013 12:27 AM

Answers

  • no, you will have to search a little yourself, but you are very close with sample code i gave you link to - COMAddins is defined directly on Word Application object that you will get from GetActiveObject so get it and later just use -> to get that collection. QI you will need to cast from Object to COM interface exposed by add-in itself.
    Friday, January 25, 2013 7:41 PM

All replies

  • attach to running instance of office app and QI your way to COMAdding collection, sample here:

    http://support.microsoft.com/kb/238975

    Thursday, January 24, 2013 7:19 AM
  • Thanks. Could you provide a more complete example on how to QueryInterface into Word?

    Friday, January 25, 2013 12:46 PM
  • no, you will have to search a little yourself, but you are very close with sample code i gave you link to - COMAddins is defined directly on Word Application object that you will get from GetActiveObject so get it and later just use -> to get that collection. QI you will need to cast from Object to COM interface exposed by add-in itself.
    Friday, January 25, 2013 7:41 PM