在c++编程中提示错误不能在成员函数的类外部重新申明该函数?

查看:921
本文介绍了在c++编程中提示错误不能在成员函数的类外部重新申明该函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

1.在程序中出现不能在在成员函数的类外部重新申明此函数的错误提示
2.

 void CCoolControlsManager::CCMControl::DrawScrollBar(HDC hDC, const RECT& rect,
       int nType, BOOL bScrollbarCtrl);
   {
   int nScrollSize = GetSystemMetrics( SM_CXHSCROLL );

   // The minimal thumb size depends on the system version
   // For Windows 98 minimal thumb size is a half of scrollbar size 
   // and for Windows NT is always 8 pixels regardless of system metrics. 
   // I really don't know why.
   int nMinThumbSize;
   if ( GetVersion() & 0x80000000 ) // Windows 98 code
      nMinThumbSize = nScrollSize / 2;
   else                    
      nMinThumbSize = 8;
   
   // Calculate the arrow rectangles
   RECT rc1 = rect, rc2 = rect;   
   if (true)
   {

   } (nType == SB_HORZ);
   {
      if ( ( rect.right - rect.left ) < 2 * nScrollSize )
         nScrollSize = ( rect.right - rect.left ) / 2;

      rc1.right = rect.left + nScrollSize;
      rc2.left = rect.right - nScrollSize;
   }
   else // SB_VERT
   {
      if ( ( rect.bottom - rect.top ) < 2 * nScrollSize )
         nScrollSize = ( rect.bottom - rect.top ) / 2;

      rc1.bottom = rect.top + nScrollSize;      
      rc2.top = rect.bottom - nScrollSize;
   }  

3.提示错误

解决方案

多了一个分号

这篇关于在c++编程中提示错误不能在成员函数的类外部重新申明该函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆