Dll loads at initialize()

no-e

New member
Joined
Jun 22, 2009
Messages
1
Programming Experience
3-5
A project in VB6 had a reference to a DLL. When the project started it made a decision to load this DLL or not load it (based on reading a configuration setting from a file) If it needed to load it it would launch the DLL which opened a separate window.

After upgrading to .NET, I am not sure how this reference equivalent is done, but when I start my project it always loads this DLL, whether or not I want it to. It appears to load it in the InitializeComponent, but I do not understand why, or how I can prevent it from loading the DLL when I start the project. It is after the initializeConponent that the program looks for the config setting to determine it it should load this. Any idea how I need to handle this?

Public Sub New()
MyBase.New()
If m_vb6FormDefInstance Is Nothing Then
m_vb6FormDefInstance = Me
End If
'This call is required by the Windows Form Designer.
InitializeComponent() ' loads my dll here for some reason
End Sub


there was a call to this from a button on the main form, so I changed it to that if teh button fired for any reason it would check an IsInitializing status and exit but that did not help. I also removed that call to the DLL there and replaced it with a call to a different subroutine, that did not help either.

Any help or point in a good direction is appreciated...

No-e
 
Back
Top