Click here to Skip to main content
15,905,776 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHaving problems registering/unregistering .Net assembly with RegAsm on client Pin
Jon_Boy2-Dec-08 8:22
Jon_Boy2-Dec-08 8:22 
AnswerRe: Having problems registering/unregistering .Net assembly with RegAsm on client Pin
Vimalsoft(Pty) Ltd2-Dec-08 20:13
professionalVimalsoft(Pty) Ltd2-Dec-08 20:13 
GeneralRe: Having problems registering/unregistering .Net assembly with RegAsm on client Pin
Jon_Boy3-Dec-08 2:08
Jon_Boy3-Dec-08 2:08 
QuestionApplication GUI and events working slowly Pin
Anubhava Dimri2-Dec-08 1:48
Anubhava Dimri2-Dec-08 1:48 
AnswerRe: Application GUI and events working slowly Pin
Dave Kreskowiak2-Dec-08 2:15
mveDave Kreskowiak2-Dec-08 2:15 
QuestionOracle Using Vb.net Pin
sarfarazaliqureshi1-Dec-08 23:46
sarfarazaliqureshi1-Dec-08 23:46 
AnswerRe: Oracle Using Vb.net Pin
Wendelius2-Dec-08 0:02
mentorWendelius2-Dec-08 0:02 
QuestionSimple plugin architecture implementation Pin
lmendes19791-Dec-08 23:16
lmendes19791-Dec-08 23:16 
Hi all,

I'm recently new to .NET, but have background in VB6 and also web technologies for some years already.
Currently I'm developing an application in VB.NET from which I would like to implement a plug-in architecture.
This would allow to add extra functionality to the application without the need to compile it over and over, and also the chance for 3rd parties to develop their own plug ins.

The idea:
In a very simplistic idea, what I have in mind is something like,the main application (let's say main.exe) and a folder with the plug-ins (in this case dlls, that are basically compiled classes).

main.exe (Main modules, classes, etc)
plugins\myplugin_hello.dll
plugins\myplugin_import.dll
(..etc)

Did some 'web' research and apparently this can be achieved with the Reflection method.
After checking some examples, the way I found to be the most simple to implement it was the following.
No need to add here, for now, the code to parse the plugin folders, just will use one as example.

The code:
(main.exe)

'Read dll
assembly = System.Reflection.Assembly.LoadFrom("myplugin_hello.dll")
For Each fileType As Type In assembly.GetTypes
   If fileType.Name = "xPlugin" Then
      'Create new instance of class
      Dim plugin = Activator.CreateInstance(fileType)
   End If
Next


(myplugin_hello.dll)

Public Class xPlugin
    Public Sub New()
        MsgBox("I am a plug-in !")
    End Sub
End Class


Apparently this is what I want, after compiling the xPlugin class (myplugin_hello.dll) and running the main.exe code, a message box with "I am a plug-in!" will be displayed.

The problem:

Well, now the problem is that I need to have some 'interaction' with both pieces of code, the main.exe and the myplugin_hello.dll, without that it is almost useless to have a plug-in : /
How could I, for example, access to main.exe classes and modules from xPlugin class (myplugin_hello.dll) ?


Best regards,
Luís
AnswerRe: Simple plugin architecture implementation Pin
Dave Kreskowiak2-Dec-08 2:18
mveDave Kreskowiak2-Dec-08 2:18 
QuestionIterate a subset of Datatable Pin
Fahim A1-Dec-08 20:08
Fahim A1-Dec-08 20:08 
AnswerRe: Iterate a subset of Datatable Pin
Christian Graus1-Dec-08 20:42
protectorChristian Graus1-Dec-08 20:42 
GeneralRe: Iterate a subset of Datatable Pin
Fahim A2-Dec-08 12:26
Fahim A2-Dec-08 12:26 
GeneralRe: Iterate a subset of Datatable Pin
Luc Pattyn2-Dec-08 13:01
sitebuilderLuc Pattyn2-Dec-08 13:01 
AnswerRe: Iterate a subset of Datatable Pin
moodwrod1-Dec-08 20:49
moodwrod1-Dec-08 20:49 
GeneralRe: Iterate a subset of Datatable Pin
Jon_Boy2-Dec-08 2:40
Jon_Boy2-Dec-08 2:40 
QuestionHow to Change Drive later of disk?? Pin
Piyush Vardhan Singh1-Dec-08 18:49
Piyush Vardhan Singh1-Dec-08 18:49 
AnswerRe: How to Change Drive later of disk?? Pin
Christian Graus1-Dec-08 20:43
protectorChristian Graus1-Dec-08 20:43 
GeneralRe: How to Change Drive later of disk?? Pin
Ashfield1-Dec-08 21:25
Ashfield1-Dec-08 21:25 
GeneralRe: How to Change Drive later of disk?? Pin
Christian Graus1-Dec-08 22:35
protectorChristian Graus1-Dec-08 22:35 
AnswerRe: How to Change Drive later of disk?? Pin
Dave Kreskowiak2-Dec-08 2:12
mveDave Kreskowiak2-Dec-08 2:12 
QuestionFF - "Save As Text" functionality Pin
ChandraRam1-Dec-08 6:03
ChandraRam1-Dec-08 6:03 
AnswerRe: FF - "Save As Text" functionality Pin
Thomas Stockwell1-Dec-08 6:24
professionalThomas Stockwell1-Dec-08 6:24 
GeneralRe: FF - "Save As Text" functionality Pin
ChandraRam1-Dec-08 6:38
ChandraRam1-Dec-08 6:38 
GeneralRe: FF - "Save As Text" functionality Pin
Thomas Stockwell1-Dec-08 7:29
professionalThomas Stockwell1-Dec-08 7:29 
GeneralRe: FF - "Save As Text" functionality Pin
ChandraRam1-Dec-08 16:22
ChandraRam1-Dec-08 16:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.