Can I use VSTA in application(w32), writen on Delphi????

Latest post 12-29-2008 10:48 AM by Gary. 11 replies.
  • 09-15-2008 4:27 AM

    Can I use VSTA in application(w32), writen on Delphi????

    Hi!

    I got a question:

    Can i use vsa in application(w32), writen on Delphi?

    have you some samples for this? may be COM objects?

    Thanks. Gorelikov Alexandr.

  • 09-15-2008 10:10 AM In reply to

    • Melody
    • Top 10 Contributor
    • Joined on 04-26-2007
    • Syracuse, NY
    • Posts 363

    Re: Can I use VSTA in application(w32), writen on Delphi????

    Gorlikov,

    You can use VSTA in a Delphi application.  The Delphi application would either expose a COM API or a .NET API.  Integrating VSTA is not intrusive in your application, the integration remains largely separate.  We do not have a COM sample for VSTA v 2 at this time, but I will get one up later this week and post a link to it here.  In the mean time, you may want to go through the SDK walkthroughs and check out the ShapeAppBasicMFC sample.

    Thanks,

    -Melody

    Filed under: ,
  • 09-19-2008 2:33 PM In reply to

    • Melody
    • Top 10 Contributor
    • Joined on 04-26-2007
    • Syracuse, NY
    • Posts 363

    Re: Can I use VSTA in application(w32), writen on Delphi????

    Gorlikov,

    After further review of the ShapeAppMFC sample I believe this should be a good example for you.  Please take a look at this sample, and how the host calls into the external VstaIntegration library.  This library should also be a good starting point for you.  To apply this sample to your application, follow the steps outlined in the SDK walkthroughs- most of them will be the same.  Here is a link to the on-line documentation, please use this instead of the documentation included with the SDK because it has some important updates in it.

    For the walkthroughs,

    1)  Creating a Proxy Assembly- no changes

    2)  Creating Project Templates- no changes.  To use the discovery method of the ShapeApp samples you will need to manually modify the project templates adding a post build event which moves the add-in assemblies to a known location.  Here is a link to a video which will walk you through this.

    3)  Modifying ShapeApp to discover and load add-ins- try to emulate the ShapeAppMFC sample using the VstaIntegraion library,

    • Update the HostItemProvider using your entry point type (specified in the proxy) instead of ShapeApp.Proxy.Application.
    • Replace the HostTypeMapProvider file with the HostTypeMapProvider file created by ProxyGen.
    • Update the VstaApplicationIntegration file with your entry point type instead of using ShapeApp.Proxy.Application, update the location to search for add-ins in, and update the class name with the host item name specified on the 3rd screen of ProjectGen.

    4)  Incorporating the IDE- try to emulate the ShapeAppMFC sample.

     

    If you have any questions or run into a problem with the walkthroughs or samples, please let me know.

    Thanks,

    -Melody

  • 09-23-2008 12:57 PM In reply to

    Re: Can I use VSTA in application(w32), writen on Delphi????

    Thanks. I'll try to do it...

    :)

  • 09-25-2008 8:39 AM In reply to

    Re: Can I use VSTA in application(w32), writen on Delphi????

    Hi!

    I've a first problem :)

    fist of all(am i right?) I've to do :

    "C:\Program Files\Visual Studio Tools for Applications 2.0 SDK\2008\Visual Studio Tools For Applications\Tools\ProxyGen\ProxyGen.exe"  /l:C:\VSTA\Project1.exe   /o:c:\out.xml

    where "Project1.exe" - simple project(just an ampty form)

    I have error:

    C:\VSTA>s\Tools\ProxyGen\ProxyGen.exe"  /l:C:\VSTA\Project1.exe   /o:c:\out.xml
    ProxyGen.exe : ProxyGen.exe [Version 9.0.30813.0]
    c Microsoft Corporation. All rights reserved.

    An unrecoverable error was encountered during processing.
    Exception from HRESULT: 0x80040202
    This may have been caused by earlier errors.

    ProxyGen.exe Information: 0 : Finished

    that is wrong?

  • 09-25-2008 5:19 PM In reply to

    • Melody
    • Top 10 Contributor
    • Joined on 04-26-2007
    • Syracuse, NY
    • Posts 363

    Re: Can I use VSTA in application(w32), writen on Delphi????

    Gorelikov,

    I do not see any problem with the ProxyGen command you are using, it worked for me when I substituted an empty VB form project for Project1.exe. Please send the empty project that is giving you trouble to vstasupport@summsoft.com and I will take a look.

     

    Thanks,

    -Melody

     

  • 12-24-2008 3:07 PM In reply to

    • stigpub
    • Top 25 Contributor
    • Joined on 11-28-2008
    • Montreal
    • Posts 24

    Re: Can I use VSTA in application(w32), writen on Delphi????

    I have gone through the different VSTA examples supplied with resonable results.  I am able to add and create the different templates and addins.


    For my next step I was going to modify a simple application to expose the code and then generate the VSTA environment.

    Now just as a starting point I run proxygen on the CPlusExample supplied by Microsoft. 

    MICROSOFT FOUNDATION CLASS LIBRARY : CPlusExample Project

    I have yet to expose any of the class structure.

    I get the following... 

    W:\ProxyGen>proxyGen /l:E:CPlusExample.exe /o:AA.xml
    ProxyGen.exe : ProxyGen.exe [Version 9.0.30813.0]
    c Microsoft Corporation. All rights reserved.

    An unrecoverable error was encountered during processing.
    Exception from HRESULT: 0x80040202
    This may have been caused by earlier errors.

    ProxyGen.exe Information: 0 : Finished


    =============================

    Of course I get the same error if I expose the class sturcture.  Proxygen works on the simple form applications supplied by Microsoft but not this more complex example.  


    Here is my Environment. 
    =======================

    Windows XP Professional Version 2002 Service Pack 3

    Microsoft Visual Studio 2008
    Version 9.0.30729.1 SP
    Microsoft .NET Framework
    Version 3.5 SP1

    Installed Edition: Enterprise

    Microsoft Visual Basic 2008  
    Microsoft Visual C# 2008  

    Microsoft Visual C++ 2008

    Microsoft Visual Studio 2008 Team Explorer
    Version 9.0.30729.1

    Microsoft Visual Studio 2008 Tools for Office 

    Microsoft Visual Studio Team System 2008 Development Edition

    Microsoft Visual Studio Tools for Applications 2.0 

    Microsoft Visual Web Developer 2008

     

  • 12-24-2008 3:23 PM In reply to

    • Gary
    • Top 10 Contributor
    • Joined on 07-13-2006
    • Posts 425

    Re: Can I use VSTA in application(w32), writen on Delphi????

    Proxygen expects either a managed assembly with public classes and elements or a COM typelibrary as input.  Can you supply us with the typelibrary (.tlb) file or the IDL file that you are using to generate the typelibrary.  Then we can look futrther into this for you.

  • 12-24-2008 4:16 PM In reply to

    • stigpub
    • Top 25 Contributor
    • Joined on 11-28-2008
    • Montreal
    • Posts 24

    Re: Can I use VSTA in application(w32), writen on Delphi????

    That helps, thank you ...  

    I did send the idl file to the web master but you no longer have to look at it.   The key words in your response where "or a COM typelibrary as input. "

    Thanks and Merry Christmas. 

    Paul

  • 12-29-2008 8:38 AM In reply to

    • Gary
    • Top 10 Contributor
    • Joined on 07-13-2006
    • Posts 425

    Re: Can I use VSTA in application(w32), writen on Delphi????

    If you wish, rather than generating a C# proxy of the typelibrary for VSTA, you can use a tiny proxy to pass the root IDispatch* of your COM typelibrary and cast it as a managed object for the add-in author to use.  With this approach, all the managed object types of your COM types are defined in an interop assembly or a primary interop assembly (PIA), generated by tlbimp.exe rather than a proxied OM generated by proxygen.exe. 

    Let us know...

  • 12-29-2008 8:52 AM In reply to

    • stigpub
    • Top 25 Contributor
    • Joined on 11-28-2008
    • Montreal
    • Posts 24

    Re: Can I use VSTA in application(w32), writen on Delphi????

    Hope your Christmas went well ...

    Thank you ..  I will try your suggestions. 

    Paul

  • 12-29-2008 10:48 AM In reply to

    • Gary
    • Top 10 Contributor
    • Joined on 07-13-2006
    • Posts 425

    Re: Can I use VSTA in application(w32), writen on Delphi????

    Had a very nice Christmas, thank you.

    Check your private e-mail for a code example of this technique.

    Happy New Year :-)

Page 1 of 1 (12 items) | RSS
Copyright Summit Software Company, 2008. All rights reserved.