views:

102

answers:

2

using :

 Dim a As [Assembly] = [Assembly].LoadFile("C:\test.exe")


 Dim testTP As Type
 testTP = a.GetType("SplashScreen", True, True)

 obj1 = Activator.CreateInstance(testTP)

 obj1.show()

my prog made reflection to test.exe > SplashScreen loaded , also obj1 filled

when SplashScreen disposed -> MainForm loaded > the obj1 isnothing!

when try to access obj1 VS say :

AccessibilityObject = {"Cannot access a disposed object. Object name: 'SplashScreen'."}

I want always obj1 filled from the active form!! how????

A: 

Sorry, I Think its not easy to realize. At least not so easy.

A. Baki
Welcome to StackOverflow and you first downvote. ;-) The answer box is generally used to provide guidance. Obtuse or ambiguousities do not add value to the conversation. If you would care to explain why you 'think' it is not easy, perhaps my opinion would be different.
Sky Sanders
trash it! yeah...
takis
A: 

The way your code is written, what you want to do is not possible. You instantiate an instance of the SplashScreen; when the timer ticks, it launches the main form and then disposes itself. ("Me.Close()") Your instance of this object is now invalid. Furthermore, you could not update your object to the instance of the main form, since they are different types.

If you want to force the splash screen to always display when the form is opened, you should handle this in the main form Load event. Then, get your handle to the main form (which you want) and let it handle the splash screen.

GalacticCowboy