FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Odd exception thrown from WIn32Window::handleMessage

 
Post new topic   Reply to topic     Forum Index -> L8night
View previous topic :: View next topic  
Author Message
l8night



Joined: 03 May 2004
Posts: 32
Location: UK

PostPosted: Thu Oct 13, 2005 2:18 pm    Post subject: Odd exception thrown from WIn32Window::handleMessage Reply with quote

I'm having some grief with Win32WIndow under the latest DMD
I've had to bodge it thus;
Code:
   bit handleMessage( out LRESULT rv, UINT msg, WPARAM wparam, LPARAM lparam )
   {
      MessageSlot ms;
      if (msgHandlers is null ) { return false; }
      try {
         ms = msgHandlers[msg];
      } catch ( Object o ) {
         debug { printf( "exeception in handleMessage FIX ME!!\n" ); }
      }
      if( ms )
      {
         return ms.processMessage( rv, wparam, lparam );
      }
      return false;
   }


I've just about got debugging working with MSDEV (VC6) by adding /co link flags and -g compile flags.

is anyone else seeing these problems or problems with Object[int] assoc arrays ?
Back to top
View user's profile Send private message
l8night



Joined: 03 May 2004
Posts: 32
Location: UK

PostPosted: Thu Oct 13, 2005 5:16 pm    Post subject: Reply with quote

not that it actually says this in the docs but it appears that assoc arrays have changed (I kind of agree with the change!)
op[] throws an exception (as it returns a copy) and 'in' returns a pointer to (so can return null)
thus the code is now
Code:

MessageSlot * ms = (msg in msgHandlers);
if( ms && (*ms) )
{
    return (*ms).processMessage( rv, wparam, lparam );
}
return false;

and it works Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> L8night All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group