Invock a dll that has sub Main(), instead of a form as entry point 
Author Message
 Invock a dll that has sub Main(), instead of a form as entry point

I want to remotely (from a web server) run a dll (Windows
Form application ) built with VB.Net. I can find and load
the assambly successfully. The only problem is that I
don't know how to start my program - because my program
not started with a form, but a sub Main() from a code
module. If it was started with a form, then the following
code will work:

strLocation = "http://MyServer/MyApp/MyPrg.dll"
Dim oStartAssembly As [Assembly] = [Assembly].LoadFrom
(strLocation)
Dim oType As Type = oStartAssembly.GetType("MyProj.Form1")
Dim oStartForm As Object = Activator.CreateInstance(oType)
Dim Form2 As Form = CType(oStartFrom, Form)
Form2.Show()

But I can't do this same thing with a program started with
sub Main(). The Activator.CreateInstance will faile
because the code mudule doesn't have a constructor.

Could someone point me to the right direction it would be
highly appreciated.

Lifeng



Sat, 03 Sep 2005 07:13:38 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. create main form and Sub Form

2. VB5 DLL function / Can't find DLL entry point

3. dll creation problem: can't find dll entry point

4. create Main Form Sub form in VB6

5. VB5 DLL Error - Can't Find Entry Point in ...dll

6. dll creation problem: can't find dll entry point

7. VB5 DLL Error - Can't Find Entry Point in ...dll

8. Can't find DLL entry point OpenEventLog in advapi32.dll

9. Can't find DLL entry point NetGetDCName in netapi32.dll

10. Can't find DLL entry point NetRemoteTOD in NETAPI32.DLL

11. Sub Main() in ActiveX DLL?

12. How to change caption on a sub from text on main form

 

 
Powered by phpBB® Forum Software