From: dee.earley@icode.co.uk   
      
   On 03/12/2009 14:52, Michael P wrote:   
   > "Dee Earley" wrote in message   
   > news:4b17c3b1$0$352$7b0f0fd3@reader.news.newnet.co.uk...   
   >> On 02/12/2009 18:24, Michael P wrote:   
   >>> "Dee Earley" wrote in message   
   >>> news:4b16a02c$0$349$7b0f0fd3@reader.news.newnet.co.uk...   
   >>>> On 02/12/2009 16:45, Michael P wrote:   
   >>>>> Hi All   
   >>>>>   
   >>>>> I am developing a VB6 application to handle midi events.   
   >>>>> It's is to be controlled by a musical keyboard.   
   >>>>> The main form, Form1, is always shown.   
   >>>>>   
   >>>>> I have a routine in a module to handle midi events and it works   
   >>>>> perfectly.   
   >>>>> The problem appears when I want this routine to show another form   
   >>>>> (modally),   
   >>>>> Form2.   
   >>>>> (This happens when I press a certain (musical) key).   
   >>>>> I get the message "Invalid procedure call or argument".   
   >>>>> If Form2 is loaded in the Form1 Load-event it is actually possible to   
   >>>>> show   
   >>>>> Form2   
   >>>>> from the module, but when I close it the application crashes.   
   >>>>   
   >>>> We'll need to see some code, both showing the form and in the forms   
   >>>> load/initialize events to be able to help more.   
   >>>   
   >>> Here is my code:   
   >>> (Note that if I don't have "Load Form2" in the Form1 load event I get   
   >>> "Invalid procedure call or argument".)   
   >>   
   >> and what code do you have in Form2?   
   >   
   > No code yet. This is a test so I just want it to show the form.   
   > And it does, but when I close it the app. crashes.   
   >   
   > As I said it may be because MidiIN_Proc is called by an external event.   
   > So if it's just not possible, I would very much appreciate an idea   
   > for a workaround.   
      
   Have you tried without the subclassing?   
   I assume that midiin_proc is a message handler and that you clean it up   
   properly when you've finished?   
      
   --   
   Dee Earley (dee.earley@icode.co.uk)   
   i-Catcher Development Team   
      
   iCode Systems   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|