English 中文(简体)
信息的制图宏观定义
原标题:Macro definition for message mapping
  • 时间:2009-12-15 09:33:56
  •  标签:
  • c++
  • macros

此前,I ,asked a question,并获得公平答复。 但我所困在宏观定义以下。

以下定义产生了信息地图功能,就像在中西太平洋渔委会信息地图上那样。 但以下法典没有编纂。

除MSG_HANDLERthis->meth(msg); dont知悉原因外,从this->开始的全文说明都存在问题。

因此,如何纠正这一问题?

我2008年使用VS。

#define MSG_UNPACK(var, id, msg) x##id *var = (x##id *)(msg);

#define BEGIN_MSG_MAP                          
   protected:                                  
   virtual void dispatchToMsgMap(xMessage *msg)
   {                                           
     if (msg->msg.message == WM_NULL)          
     {                                         
       return;                                 
     }

#define MSG_HANDLER(meth, wm_msg)              
     else if (msg->msg.message == wm_msg)      
     {                                         
       this->meth(msg);                        
       return;                                 
     }

#define END_MSG_MAP(base)                      
     else if (msg->msg.message == WM_COMMAND)  
     {                                                                
       this->dispatchToCmdMap(msg);                                   
       return;                                                        
     }                                                                
     else if (msg->msg.message == WM_NOTIFY)                          
     {                                                                
       this->dispatchToNotifyMap(msg);                                
       return;                                                        
     }                                                                
                                                                      
     base::dispatchToMsgMap(msg);                                     
   };

#define BEGIN_CMD_MAP                          
   virtual void dispatchToCmdMap(xMessage *msg)
   {                                                                         
     MSG_UNPACK(Cmd, WM_COMMAND, msg);                                       
                                                                             
     if (Cmd->ItemID == 0)                                                   
     {                                                                       
        /* not allowed */                                                    
     }                                                                        

#define CMD_HANDLER(meth, cmd_id)              
     else if (Cmd->ItemID == cmd_id)           
     {                                                                         
       this->meth(Cmd->ItemID);                                                
     }                                                                          

#define END_CMD_MAP(base)                      
     else                                                                    
     {                                                                       
       base::dispatchToCmdMap(msg);                                      
     }                                                                       
   };

这里,例如:this->dissignToCmdMap(msg);是第41条。

1>d:develcodingvs2008 est2 est2messagemapper.h(41) : error C2059: syntax error : this 1>d:develcodingvs2008 est2 est2messagemapper.h(41) : error C2017: illegal escape sequence 1>d:develcodingvs2008 est2 est2messagemapper.h(42) : error C2059: syntax error : return 1>d:develcodingvs2008 est2 est2messagemapper.h(42) : error C2017: illegal escape sequence 1>d:develcodingvs2008 est2 est2messagemapper.h(43) : error C2059: syntax error : } 1>d:develcodingvs2008 est2 est2messagemapper.h(43) : error C2143: syntax error : missing ; before } 1>d:develcodingvs2008 est2 est2messagemapper.h(43) : error C2059: syntax error : }

最佳回答

“非法越航顺序”部分告诉我,在<条码><>/代码>之后,你有打白空间。 因此,下行不属于宏观。

问题回答

首先,检查一下,在线末的斜坡之后,你有 t的白色空间。

如果做不到这一点,那么,你就应当研究预先处理的产出,以了解实际正在编纂的内容(如果你需要的话,请做这样的职位)。

在“......”之后拆除空间。 这一编号应为最后一行。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?