CAB in ActiveX-Control?

Topics: CAB & Smart Client Software Factory
Aug 13, 2007 at 9:11 AM
Hi,
is it possible to run a CAB-Application in an ActiveX-Control? That is, we have an ActiveX-Control written in C++/CLI which hosts a Form (class MainForm).
I tried deriving a class from WindowsFormsApplication<WorkItem, MainForm> and override the Start()-function to do nothing except adding the form to
the ActiveX-Control as a child control that fills the whole area.

The problem I now discover is this:
after the Start()-function returns the workitem gets disposed and thus nothing would work correctly :-(

Has anyone faced this problem before and worked out a solution?

mfg Steven
Jul 23, 2008 at 9:38 AM
Hi Steven,

i am facing exactly the same problem.
We also want so build an Active-X Control of a CAB/SCSF Application.
It seems that in order to publish an activex Control, the cab application has to be transformed to a Usercontrol.

So I created an instance of a Subclass of WindowsFormsApplication in a Usercontrol.  But after the start() function  the workitem is  disposed just like you described.
My idea was simply to change the source code of the Microsoft.Practices.CompositeUI and add a method similar to the "run()" method, that does not dispose the workitem.
But now i have the problem that i can't integrate the source code from CAB (Version from 2005) to my  SCSF MAY 2007  solution. There seems to be a version conflict, when i tried to exchange the references of the four SCSF Assemblies with the CAB Source-Assemblies.
I think, i need the source code of the CAB Assemblies published with the  SCSF MAY 2007  ! But i have no idea how to get it.
Maybe anyone else has an idea ?

Any help appreciated !

Greetings

Thomas




Jul 26, 2008 at 7:40 PM
The trick is to create your own base workitem and delay the dispose

http://blogs.southworks.net/mwoloski/2006/02/26/hostingcab/
http://blogs.southworks.net/mwoloski/2006/02/26/hosting-cab-in-a-usercontrol-in-depth/

Matias
http://blogs.southworks.net/mwoloski
Jul 29, 2008 at 5:59 PM
Hi,

Thanks. I just found that the source code of CAB comes with the Source-Code Installer provided by SCSF.
So, i slightly modified  the run()- method of  Microsoft.Practices.CompositeUI. I did not look at your version in detail, seems it is a litte bit better because you do not need Source-Code Changes.
However, now  i've got a CAB Application running in a user Control. Has anyone experience converting such a CAB Usercontrol to an activeX ? I successfully mastered to make an active-X and display it in an Browser but unfortunately several problems arise. The application is not displaying properly because, the modules defined in the ProfileCatalog.xml are not loaded. 
I found the lines of code in the CAB Sources, where the path of the ProfileCatalog and the path of the loaded modules are defined, but even after adding the correct path (as a try hard-coded into the CAB sources) i do no succeed and end with an Exception running "loadedModules.add(...)" in the method "LoadAssemblies" of the DependentModuleloaderService.
Anyone any ideas how to successfully convert a CAB application to an activeX ?

Greetings,

Thomas