HowTo: Host a CAB application in Outlook, Word, Excel, or a common Winforms application
February 26th, 2006
Reusing is
a common requirement in any team or framework. However, we usually reuse at
business logic or general infrastructure level. The User Interface reuse is
more difficult to achieve. CAB architecture is loosely coupled enough to make
that possible.
The
following screenshots illustrates the bank teller quickstart application hosted
in Outlook, Word and a regular Winforms application.
Just two
lines of code [:)]
Instructions:
- Download the solution
- Extract
the solution and build it. If you experience problems, check that
the references to the CAB assemblies are correct.
Create
the shell and the CAB application
- Create a
new project to host the shell and the CAB application.The shell in a regular CAB application would be a Form. However if we
want to host the application in a different executable (Outlook, Word, IE,
etc), we already have the container. So the Shell will be a UserControl. - Add
references to CAB assemblies. - Create a
regular UserControl and place the workspaces, menus, toolstrip, statusbar,
and everything related to the shell. - If you
need to override the CAB events like AfterShellCreated or
AddBuilderStrategies, create a new class that derives from CompositeUIExtensions.Hosting.UserControlShellApplicationwhere TUserControlShell is the type of the UserControl created on the previous step
and TWorkItem is the root work item that
must derives from UserControlWorkItem.
Consume
a CAB module/app from Outlook/Word/External application
- Open your
project and add references to CompositeUIExtensions.Hosting and the CAB assemblies. Also
copy the project related assemblies (module assemblies for example) to the
application output directory. - Creates
an instance of CompositeUIExtensions.Hosting.UserControlHost and add it to the
correspondent Controls collection. The following code illustrates how;
UserControlHost plugin = new UserControlHost();…Controls.Add( plugin );
- Create
the ProfileCatalog.xml, configure it with the desired module/s and set theBuild Action to CopyAlways.
Download
the solution that shows how to host the BankTeller app inside Outlook, Word and
Winforms.
February 27th, 2006 at 2:14 am
I was unable to “Download the solution” that shows how to host the BankTeller app inside Outlook, Word, and Winforms.
Thanks for paving the way.
February 27th, 2006 at 2:49 am
Hi John,
I’ve just tried the download and it worked. You got any http error?
Matias
May 11th, 2006 at 8:03 pm
The Cab Solution link doesn’t respond.
If I chose Save Target As, I get “My current security settings don’t allow it”
But the Hosting Cab at the top of the page does work. If chose “Save As” on that, it works also.
If I use Properties on the hyperlinks, both links show Hosting Cab.zip on the content\binary. The properties appear to link to the same file.
Perhaps this is a cross-domain issue.
May 26th, 2006 at 1:06 am
Hi Matias,
The Cab solution download link does not work.
it points to the following url:
http:///www.southworks.net/matiaswoloski/content/binary/Hosting%20CAB.zip
as you see, there are three “///” that follow “http:”
if I remove one “/”, it points to the same url of CompositeUIExtensions.Hosting download link.
so could you please let me know the url to download the solution.
Thanks,
g
May 28th, 2006 at 2:35 am
Everyone,
I’ve corrected the url. Both links were pointing to the same url on purpose. You can download the whole solution and if you want to use it in your app follow the instructions.
Thanks
Matias