locked
HotKeys vb6, vb.net and interop

    Question

  •  

    I'm using Visual Studio 2005, Interop 2.0 and vb6.

     

    I have created hotkeys on a vb.net form which work correctly when I do not open up the form from vb.6.

    When I open up the vb.net form from vb6 Modal the hot keys work.

     

    However, when I open up a vb.net modal form, I can't raise events back to the vb6 form.

    How can I open up a non-modal vb.net form from vb6 and still have hotkeys?

     

    Thanks,

    Pete

    Friday, January 04, 2008 11:27 PM

Answers

  • Hi Pete,

     

    This is probably due to a collision between the two message loops...best thing to do is detect the Hotkey on the VB.NET side and raise an event back to VB6.  If you have the Interop Toolkit docs installed then these links should show you how to get events working:

    ms-help://MS.InteropFormToolkit2.0/InteropFormToolkit20/How%20To%20Handle%20an%20InteropForm%20Event.html

    ms-help://MS.InteropFormToolkit2.0/InteropFormToolkit20/How%20To%20Create%20a%20Form%20Event.html

     

    Hope that helps,

     

    Jonathan

     

    Tuesday, January 08, 2008 2:30 AM