views:

321

answers:

1

I've been following a codeproject article on using the interop forms toolkit (basically a way for developers to slowly upgrade their VB6 projects to .net by allowing .net components run in VB6)

http://www.codeproject.com/KB/vb-interop/VB6InteropToolkit2.aspx

While the .NET form is working fine in all other testing projects and environments, I've found that the Form_load event is actually firing twice once it's in executing in the VB6 runtime.

Not only annoying, its forcing my initialization code to execute twice (causing all kind of problems on the second run).

Is there any explanation as to why this is happening (I'd like to understand the reason)?

Is there anything better way to work-around this apart from

 If (runBefore = True) Then
A: 

It's possible for this occur if you implicitly begin loading a form by accessing a public variable in the form from another module, then explicitly .show the form before the loading is complete.

xpda
Possibly. The interop wrappers (generated by the toolkits template) could be making the calls.
MoSlo