Re: Office Automation using MFC

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Is this a Windows CE question?

-
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member


<virajajgaonkar@xxxxxxxxx> wrote in message
news:1117720509.405966.305680@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hello All,
>
> My aim is to have a MFC application which takes two word file names as
> input. Then it opens these two word files in ms word application
> windows for comparing side by side with eachother. This is also known
> as Office Automation. I am trying to use the dynamic approach.
> The Dynamic approach:
> 1) Get class id of the required class.
> 2) Using "CoCreateInstance" create an instance of this class. This
> also returns a pointer to the Unknown Interface.
> 3) Using the "QuerryInterface" and pointer to Unknown Interface get
> a pointer to the Dispatch Interface.
> 4) If any further interface is needed use "QuerryInterface" and the
> pointer to Dispatch Interface get a pointer to the Required Interface.
> 5) Use the final Interface Pointer and "GetIDsOfNames", to get
> DispatchId of the required function.
> 6) Use the DispatchId and final Interface Pointer to "Invoke" this
> function.
>
> The method I need to use is "CompareSideBySideWith". This method
> can be accessed only by an object of "Windows" class or
> "Word.Document" class. The class id of the class "Windows" is
> not available hence I have to use the class "Word.Document". Using
> the class "Word.Document", I am able to get till step 4, i.e. I am
> able to get a pointer to it's Dispatch Interface. In step 5 it does
> not return any Dispatch id for "CompareSideBySideWith" method. In
> the msdn documentation it is mentioned that "CompareSideBySideWith"
> is a method of that class. No documentation can be found to check if
> there are any intermediate interface between the "Dispatch" and the
> required method.
>
> Can anyone please tell me where I am going wrong?
>
> Thanks,
> Viraj
> Mobiliti Inc.
> a.viraj@xxxxxxxxxxxx
> http://www.mobiliti.com
>


.



Relevant Pages

  • Office Automation using MFC
    ... My aim is to have a MFC application which takes two word file names as ... Using the "QuerryInterface" and pointer to Unknown Interface get ... able to get a pointer to it's Dispatch Interface. ...
    (microsoft.public.windowsce.app.development)
  • Programmatic Merging of two Excel Workbooks
    ... returns a pointer to the Unknown Interface. ... Use the pointer to the Dispatch Interface and Get Pointer to Workbooks ... Using the pointers to the Workbooks get the pointer to the "Windows" ...
    (microsoft.public.office.developer.automation)
  • Programatically Merging of two Excel Workbooks
    ... returns a pointer to the Unknown Interface. ... Use the pointer to the Dispatch Interface and Get Pointer to Workbooks ... Using the pointers to the Workbooks get the pointer to the "Windows" ...
    (microsoft.public.vc.mfc)
  • Programatically Merging of two Excel Workbooks
    ... returns a pointer to the Unknown Interface. ... Use the pointer to the Dispatch Interface and Get Pointer to Workbooks ... Using the pointers to the Workbooks get the pointer to the "Windows" ...
    (microsoft.public.vc.mfc.docview)
  • Merging of two Excel Workbooks
    ... returns a pointer to the Unknown Interface. ... Use the pointer to the Dispatch Interface and Get Pointer to Workbooks ... Using the pointers to the Workbooks get the pointer to the "Windows" ...
    (microsoft.public.win32.programmer.ole)