Error creating window handle.

  • Hello.. I'm hoping someone can help me out:

    I have a form that has the TextDynamic component on it. When I open the form for the first time in my application, it works properly. when I open the form for the second time, I get the following error:

    System.ComponentModel.Win32Exception was unhandled
    Message="Error creating window handle."
    Source="System.Windows.Forms"
    ErrorCode=-2147467259
    NativeErrorCode=2

    I am using MS Visual Studio 2005 SP1 on Window Vista Home and my program is in C#. I have tried creating another test application and I experience the same behavior so it appears to be a problem with the component/environment and not my particular app. :-(

    Anyone have any ideas?

    Regards,
    Andrew

    • Offizieller Beitrag

    Hi,

    the reason is that the DLL is unloaded when the form is closed (and destroyed)

    It is important that the DLL which implementes the window class stays in memory.

    You can do this by "preloading" the DLL using the class method SetDLLName

    WPDynamic.WPDLLInt.SetDLLName(TextDynamicDLL);

    Julian