How do I pass a Form.TabControl to an external Dll ?

  • Thread starter Thread starter Alan_Barclay_Uk
  • Start date Start date
A

Alan_Barclay_Uk

Guest
Hi Guys I've been searching for ages and can't find the solution to my problem anywhere...

I have a working VB application with a simple Form containing a menu strip, a Tab Control and a groupBox with a textBox inside. The groupBox and textBox are just used to display status information.

Everything worked as required (That was until I tried to separate my class modules from the main application into individual dll's ) to allow cross application use of the same functions

When my project starts, It lists all the dll's it finds in its library folder in the menu strip. I'm faking this at the moment but intend extracting a function title collection from each of the dll's, pre-selection (any suggestions on achieving this would be a Bonus!) for now the Dll's only contain one public class but may contain multiple public classes in the future!

As It is, Clicking on the menu strip, dynamically loads the selected dll using the following code...

Dim oAssembly As System.Reflection.Assembly = Assembly.LoadFile(szFileName)
Dim oType As System.Type = oAssembly.GetType(oAssembly.GetExportedTypes(0).FullName)
Dim oObject As System.Object = Activator.CreateInstance(oType)

This all works and I can display dialog's/Message Box's directly from the dll.

The problem is, I can't find/figure out how to give the dll access to populate a tabControl with specific controls. i.e one of my dll's displays a folder requester and uses the selected folder to populate a treeView with all the subFolders and files there-in

In my original project displaying the treeView was easy, Using a dynamic dll has got me stumped...

I'm using public sub new() in the dll to create the desired layout for each of the dll's, and all other functionality is Private to the dll.

Any help/Ideas would be most appreciated.

Alan

Continue reading...
 
Back
Top